System information
Events
Manager events always have an Event header and a Privilege header. The Event header
gives the name of the event, while the Privilege header lists the privilege levels asso-
ciated with the event. Any other headers included with the event are specific to the
event type. Here’s an example:
Event: Hangup
Privilege: call,all
Channel: SIP/0004F2060EB4-00000000
Uniqueid: 1283174108.0
CallerIDNum: 2565551212
CallerIDName: Russell Bryant
Cause: 16
Cause-txt: Normal Clearing
Actions
When executing a manager action, it must include the Action header. The Action header
identifies which manager action is being executed. The rest of the headers are argu-
ments to the manager action. Some headers are required.
To get a list of the headers associated with a particular manager action,
type manager show command <Action> at the Asterisk command line.
To get a full list of manager actions supported by the version of Asterisk
you are running, enter manager show commands at the Asterisk CLI.
The final response to a manager action is typically a message that includes the
Response header. The value of the Response header will be Success if the manager action
was successfully executed. If the manager action was not successfully executed, the
value of the Response header will be Error. For example:
Action: Login
Username: russell
Secret: russell
Response: Success
Message: Authentication accepted
AMI over HTTP
In addition to the native TCP interface, it is also possible to access the Asterisk Manager
Interface over HTTP. Programmers with previous experience writing applications that
use web APIs will likely prefer this over the native TCP connectivity.
Authentication and session handling
There are two methods of performing authentication against the AMI over HTTP. The
first is to use the Login action, similar to authentication with the native TCP interface.
Protocol Overview | 467