Page 258 - Asterisk™: The Future of Telephony
P. 258
Action: Redirect
Channel: SIP/John-ae201e78
Context: Lab
Exten: 6001
Priority: 1
ActionID: 2340981650981
For each action you sent over the manager interface, you can send along
an arbitrary ActionID value. This will allow you to recognize the re-
sponses from Asterisk as being related to your actions. It is strongly
recommended that you send a unique ActionID with each of your AMI
commands.
This URL transfers the specified channel to another extension and priority in the
dialplan. The response to this action is:
Response: Success
ActionID: 2340981650981
Message: Redirect Successful
Reading a configuration file
To read an Asterisk configuration file via the Manger interface, we can use the the
GetConfig action. The GetConfig action returns the contents of a configuration file, or
portion thereof. The following command retrieves the contents of the file users.conf.
Action: GetConfig
Filename: users.conf
ActionID: 9873497149817
Asterisk then returns the contents of the users.conf file. The response looks like:
Response: Success
ActionID: 987397149817
Category-000000: general
Line-000000-000000: fullname=New User
Line-000000-000001: userbase=6000
Line-000000-000002: hasvoicemail=yes
Line-000000-000003: hassip=yes
Line-000000-000004: hasiax=yes
Line-000000-000005: hasmanager=no
Line-000000-000006: callwaiting=yes
Line-000000-000007: threewaycalling=yes
Line-000000-000008: callwaitingcallerid=yes
Line-000000-000009: transfer=yes
Line-000000-000010: canpark=yes
Line-000000-000011: cancallforward=yes
Line-000000-000012: callreturn=yes
Line-000000-000013: callgroup=1
Line-000000-000014: pickupgroup=1
Line-000000-000015: host=dynamic
230 | Chapter 10: Asterisk Manager Interface (AMI) and Adhearsion