Asterisk Tutorial 58 — Asterisk AMI Originate Dial

As we hinted to at the end of our last tutorial, it is time for us to something a bit more exciting with the Asterisk manager interface other than simply logging in. That means it is time to take a look at Asterisk AMI actions and more specifically the Asterisk AMI Originate Dial action.

Asterisk AMI Actions

Before getting started with using the originate dial action, we also recommend finding out which other AMI commands are available for your version of Asterisk. Rather than searching through Google to find the a list, there is a simpler way which also has the benefit of being specific to your Asterisk phone system.

All you need to do is simply log into the Asterisk CLI and use the following command:

manager show commands

This will bring up a list view of all the available AMI actions as shown below:

Asterisk AMI Originate Dial

For demonstration purposes we choose to use the Originate dial action, as after login, it is possibly the most commonly used AMI action. In order to use the Asterisk AMI Originate Dial action, you will first need to understand the required syntax which can be found by reviewing the action’s documentation as follows:

manager show command Originate

This will open the Originate documentation and provide an overview of the relevant options available:

The options contained within the [] brackets are optional values, meaning that alongside the action itself the only additional value that needs to be set when issuing your AMI command is the “Channel”.

That said, should you use an optional value, then further values may also be required. For example when setting the “Context” value, you will also be required to set the “Exten” and “Priority” values.

The next step is to try it out. To do this, connect to and authenticate yourself with the Asterisk AMI following the steps in our previous tutorials. Once connected and authenticated, you will be able to start issuing AMI commands to perform actions.

In our example, the objective is to get a specific channel to connect to certain element of our dialplan for which we used the syntax as below. However, before going further it is worth noting that the syntax is case sensitive so if your action command isn’t working as expected this may be a reason.

Action:Originate
Channel:SIP/james
Contect:phones
Exten:100
Priority:1

The result is that the Asterisk phone system calls the Channel SIP/james and upon the channel being answered, the system then tries to connect the call to the extension 100.

If like us, you try to issue the action command manually — meaning actually typing your command, you may encounter a “time out” of sorts. To avoid this, simply take your notepad editor and copy and past the syntax from their. Obviously, if you are using your preferred programming language library, then the time out will not be an issue for you.

VoIP Guys on Ideascale

That’s it on the Asterisk AMI and for Introducing Asterisk for a short while as we take a Summer Break. However, get voting for your favourite Asterisk phone system topic on our ideascale page and we will be back with loads of new, fresh and exciting tutorials very soon.

pascom.ideascale.com

More Info

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.

Originally posted on blog.pascom.net