Page 282 - Asterisk™: The Future of Telephony
P. 282
Line-000000-000012: callreturn=yes
Line-000000-000013: callgroup=1
Line-000000-000014: pickupgroup=1
Line-000000-000015: host=dynamic
Category-000001: 6007
Line-000001-000000: fullname=Bill Savage
Line-000001-000001: secret=1234
Line-000001-000002: email=bsavage@digium.com
Line-000001-000003: cid_number=6001
Line-000001-000004: zapchan=
Line-000001-000005: context=numberplan-custom-1
Line-000001-000006: hasvoicemail=yes
Line-000001-000007: hasdirectory=no
Line-000001-000008: hassip=yes
Line-000001-000009: hasiax=yes
Line-000001-000010: hasmanager=no
Line-000001-000011: callwaiting=yes
Line-000001-000012: threewaycalling=yes
Line-000001-000013: mailbox=6007
Line-000001-000014: hasagent=yes
Line-000001-000015: group=
Updating configuration files using UPDATECONFIG
The UPDATECONFIG action is used to update one or more settings in a configuration file.
For example, to delete a user you should use a URL like this:
http://localhost:8088/asterisk/rawman?action=updateconfig&reload=yes&srcfilename
=users.conf&dstfilename=users.conf&Action-000000=delcat&Cat-000000=6003&
Var-000000=&Value-000000=
Error response
A user must be logged in to the web server before any other commands can be issued.
Any of the commands we’ve discussed will return an error response if the user is not
authenticated. If it’s not given by an authenticated user, this URI http://localhost:8088/
asterisk/rawman?action=ping returns this response to indicate an error:
Response: Error
Message: Authentication Required
Ajax, AJAM, and Asterisk
As an acronym, Ajax stands for Asynchronous JavaScript and XML. While the term
includes the words asynchronous and XML, this does not mean that you can make only
asynchronous requests, nor are you required to use XML. Some authors describe Ajax
as simply a combination of HTML, JavaScript, DHTML, and DOM. The next gener-
ation browsers, such as Mozilla/Firefox, use an XMLHttpRequest (a JavaScript object)
to send an asynchronous request to the server. The request is made in the background
and processed by the server.
254 | Chapter 11: The Asterisk GUI Framework