Contact

Blogs

Take a look at the things that interest us.

Creating a call through Asterisk Ami with Originate Dial

Wesley Wesley 3 years

In my last post, I have written about setting up the Asterisk Ami, in this post I would like to do something a bit more exciting with the Asterisk Ami. Let's try making our first call through the Asterisk Ami with the Originate Dial action.

Asterisk AMI Originate Dial

In order to use the Asterisk AMI Originate Dial action, we first need to have a basic understanding of the required syntaxes which can be found through the following command.

manager show command Originate

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

# example
[Syntax]
Action: Originate
[ActionID:] <value>
Channel: <value>
[Exten:] <value>
[Context:] <value>
[Priority:] <value>
[Application:] <value>
[Data:] <value>
[Timeout:] <value>
[CallerID:] <value>
[Variable:] <value>
[Account:] <value>
[EarlyMedia:] <value>
[Async:] <value>
[Codecs:] <value>
[ChannelId:] <value>
[OtherChannelId:] <value>

[Synopsis]
Originate a call. 

[Description]
Generates an outgoing call to a <Extension>/<Context>/<Priority> or
<Application>/<Data>

[Arguments]
ActionID
    ActionID for this transaction. Will be returned.
Channel
    Channel name to call.
Exten
    Extension to use (requires 'Context' and 'Priority')
Context
    Context to use (requires 'Exten' and 'Priority')
Priority
    Priority to use (requires 'Exten' and 'Context')
Application
    Application to execute.
Data
    Data to use (requires 'Application').
Timeout
    How long to wait for call to be answered (in ms.).
CallerID
    Caller ID to be set on the outgoing channel.
Variable
    Channel variable to set, multiple Variable: headers are allowed.
Account
    Account code.
EarlyMedia
    Set to 'true' to force call bridge on early media..
Async
    Set to 'true' for fast origination.
Codecs
    Comma-separated list of codecs to use for this call.
ChannelId
    Channel UniqueId to be set on the channel.
OtherChannelId
    Channel UniqueId to be set on the second local channel.

[See Also]
OriginateResponse

[Privilege]
originate,all

[List Responses]
None

[Final Response]
None

The options within the [ ... ] brackets are optional values, meaning that alongside the action itself the only added value that needs to be set when issuing your AMI command are the following syntaxes.

# Example
Action: Originate
Channel: <value>

Making a Asterisk AMI Originate Call

The next step is to try it out. To do this, let's connect to the Asterisk Ami and log in by following the steps in our previous tutorial. Once connected, we will be able to start writing our AMI commands.

In this example, we'll make a call from our sip account 100 to 101. It is important to know that the syntaxes are case sensitive, so if your action command isn't working as expected, this may be a reason. Let's make our first call through the Asterisk Ami.

Action:Originate
Channel:PJSIP/100
Contect:phones
Exten:PJSIP/101
Priority:1

The result is that Asterisk calls extension 100 and upon the phone being answered, the system then tries to connect the call to extension 101.

That was it on the Asterism Ami Originate dial action.

Creating a call through Asterisk Ami with Originate Dial 2021-08-24 08:13:23

There are no comments.

4445

Have questions about our services?

Contact our Sales team to get answers.

Contact Us
gomibako@aska-ltd.jp