As we promised at the end of the last episode, here we are with our guide to connecting to and authenticating connections to the Asterisk AMI.
For the purposes of this tutorial, we will try to access the Asterisk AMI using telnet as this is the simplest option which makes it ideal for demonstration purposes. If you use Asterisk AMI encryption protocols, using telnet will not work as it does not support encryption.
To connect to the AMI using telnet, you can do so via the Asterisk CLI. Normally, you would be done using a programme and your preferred language libraries – however as we are using the same server we can test our setup this way. In order to connect to the Asterisk AMI, you can do so as the Asterisk root user with the following command:
telnet localhost 5038
This should result in the Asterisk Call Manager responding as you are now technically connecting to the AMI. This can be seen in the screenshot below:
We used the localhost specifically to highlight one of the security issues with the Asterisk AMI. If you remember from last time, we configured our AMI access to be restricted to the user Mathias via the IP address 192.168.100.55.
However, here in lies an important aspect of connecting to the Asterisk AMI which needs to be understood. The AMI has two security layers. Firstly, it checks the binding IP address and then secondly the AMI authenticates the user credentials including their IP address. As our bind address is 0.0.0.0. by connecting as above, we can “talk” to the AMI but are not be able to read any output or write any commands.
In order to test your AMI access authentication, simply follow the steps above and then issue a login command using the credentials we setup last time around and the following syntax:
Action: login Username: mathias Secret: 12345678
The response should be an Authentication Failed as by following the steps above we connected to the AMI using the local host. Now repeat the process, but substitute localhost with the permitted IP address:
telnet 192.168.100.55 5038 ..... Action: login Username: mathias Secret: 12345678
All going well should result in a “Successful” result as shown below:
If this is the case, simply make a call and you will be able to read all the AMI output (or the output permissions you defined last time). In a normal scenario, the output would then be automatically saved to whichever programme you are using which will enable you to set certain criteria to say, should something happen the following should occur.
That’s pretty much it when it comes to connecting to and authenticating Asterisk AMI connections.
If you have an Asterisk phone system question and would like us to do a tutorial on it, then let us know on Ideascale:
pascom are the developers of the enterprise grade mobydick VoIP phone system software. As an open standards IP PBX, mobydick offers a cost effective alternative to proprietary solutions and provides businesses with a fully featured Unified Communications solution to boost productivity, increase mobility and reduce costs.
For more on our mobydick phone system or to arrange a personalised demo, give us a call on +49 991 29691 200 / +44 203 1379 964. Alternatively, contact us via our website or take mobydick for a test spin with our free community download and find out how your business can benefit.
Until next time – Happy VoIPing!
Publish Date: July 20, 2016 5:00 AM
miSecureMessages is an encrypted messaging application designed as a pager replacement for healthcare organizations, call centers, and enterprise environments.
Contact Center Software
Startel is a leading provider of unified communications, business process automation and performance management solutions for contact centers. Since its founding in 1980, Startel has established a loyal customer base from a variety of industries, including contact centers, education, healthcare, insurance and telephone answering service. Startel's solutions are designed to enhance the customer experience, improve employee productivity, reduce operating costs, and increase revenues.
Engage with your customers in Real-Time.
Connect personally with your customers, generating new revenues and boosting CSAT scores. Synthetix Chat is the fastest way to engage your users, with a Live Key-Press Feed, ID and Verification, simultaneous chats and AI-Powered predictive suggestions, Synthetix Chat reduces averages handling times by up to 50%.
|Nexbridge UK SIP Provider pascom Interoperability||October 17, 2017 5:00 AM|
|What is Unified Communications?||September 29, 2017 5:00 AM|
|pascom 16 Focuses on UCC UX||September 26, 2017 5:00 AM|
|Summer Special: Cloud PBX Bundle||July 17, 2017 5:00 AM|
|pascom Boosts UC Offering with UK Hosted PBX||May 8, 2017 5:00 AM|
|pascom Launches UK Hosted PBX||May 5, 2017 5:00 AM|
|pascom Launch Hosted mobydick Telephony Service||October 4, 2016 5:00 AM|
|mobydick 7.13 Release||September 12, 2016 5:00 AM|
|Asterisk Tutorial 58 – Asterisk AMI Originate Dial||July 27, 2016 5:00 AM|
|Asterisk Tutorial 57 – Asterisk AMI Connect & Authenticate||July 20, 2016 5:00 AM|