Asterisk AMI

With the Asterisk AMI interface, an Asterisk server can be monitored and configured.

Info: The interface automatically synchronizes with the slowest cycle of the associated PLC. The telegrams are buffered by the system so that no telegram is lost.

Note: Events can also be created directly in the Telephone. These communicate with an existing Visualization object.

Function Description

The Asterisk Manager Interface (AMI) is a monitor and also serves to manage the Asterisk telephone system. All commands are transmitted via TCP/IP using plain text.

If the connection is inactive for 30 seconds, a ping command is automatically sent.

Send Actions

Actions are sent as multi-line strings to the variable action. The normal line ending of Antcas Control is transmitted. This differs from the Asterisk documentation.

Here is an example:

Action: SIPpeerstatus
ActionID: 1234

The response to the executed command is sent to the variable response. A queried list is then sent to event. This can be evaluated like an event.

Note: The documentation can be found at: https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+AMI+Actions from the second generation onwards, this is https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+AMI+Events

Example

Dial a number.

Action: Originate
Channel: SIP/<TARGETNUMBER@HOST>
Context: dp<PROJECTID>
Exten: <PHONEID>
Priority: 1
Async: True

Evaluate Events

Each event is synchronized with the cycle time of the slowest application. This means that when multiple responses occur in succession, each response can be evaluated and none are lost.

Here is an example to detect a call. A positive edge is generated at the Ring function block. The participant ID is to be changed after the value Exten:. The ID can be taken from the Telephone or the monitor.

Note: The documentation can be found at: https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+AMI+Events

Using the Internal Server

The Asterisk server running on the Antcas server has various limitations. Among other things, no system changes can be made. Furthermore, it is not possible to make the connection available from outside.

To establish a connection, select the Internal option under outgoing interface in the configuration.