Newer
Older
* Asterisk -- An open source telephony toolkit.
* Copyright (C) 1999 - 2006, Digium, Inc.
* Mark Spencer <markster@digium.com>
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
*
* \brief The Asterisk Management Interface - AMI
*
* \author Mark Spencer <markster@digium.com>
*
* OpenSSL http://www.openssl.org - for AMI/SSL
* At the moment this file contains a number of functions, namely:
*
* - data structures storing AMI state
* - AMI-related API functions, used by internal asterisk components
* - handlers for AMI-related CLI functions
* - handlers for AMI functions (available through the AMI socket)
* - the code for the main AMI listener thread and individual session threads
* - the http handlers invoked for AMI-over-HTTP by the threads in main/http.c
*
* \ref amiconf
/*! \li \ref manager.c uses the configuration file \ref manager.conf and \ref users.conf
* \addtogroup configuration_file
*/
/*! \page manager.conf manager.conf
* \verbinclude manager.conf.sample
*/
/*! \page users.conf users.conf
* \verbinclude users.conf.sample
*/
/*** MODULEINFO
<support_level>core</support_level>
***/
Kevin P. Fleming
committed
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/paths.h" /* use various ast_config_AST_* */
Mark Spencer
committed
#include <ctype.h>
Kevin P. Fleming
committed
#include <sys/mman.h>
#include <sys/types.h>
#include <regex.h>
Kevin P. Fleming
committed
#include "asterisk/channel.h"
#include "asterisk/file.h"
#include "asterisk/manager.h"
Joshua Colp
committed
#include "asterisk/module.h"
Kevin P. Fleming
committed
#include "asterisk/config.h"
#include "asterisk/callerid.h"
#include "asterisk/lock.h"
#include "asterisk/cli.h"
#include "asterisk/app.h"
#include "asterisk/pbx.h"
#include "asterisk/md5.h"
#include "asterisk/acl.h"
#include "asterisk/utils.h"
Mark Spencer
committed
#include "asterisk/http.h"
Russell Bryant
committed
#include "asterisk/ast_version.h"
#include "asterisk/threadstorage.h"
#include "asterisk/linkedlists.h"
#include "asterisk/features.h"
Russell Bryant
committed
#include "asterisk/security_events.h"
#include "asterisk/strings.h"
#include "asterisk/stringfields.h"
#include "asterisk/presencestate.h"
#include "asterisk/stasis_message_router.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/test.h"
#include "asterisk/json.h"
#include "asterisk/features_config.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/format_cache.h"
#include "asterisk/translate.h"
#include "asterisk/taskprocessor.h"
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*** DOCUMENTATION
<manager name="Ping" language="en_US">
<synopsis>
Keepalive command.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
</syntax>
<description>
<para>A 'Ping' action will ellicit a 'Pong' response. Used to keep the
manager connection open.</para>
</description>
</manager>
<manager name="Events" language="en_US">
<synopsis>
Control Event Flow.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="EventMask" required="true">
<enumlist>
<enum name="on">
<para>If all events should be sent.</para>
</enum>
<enum name="off">
<para>If no events should be sent.</para>
</enum>
<enum name="system,call,log,...">
<para>To select which flags events should have to be sent.</para>
</enum>
</enumlist>
</parameter>
</syntax>
<description>
<para>Enable/Disable sending of events to this manager client.</para>
</description>
</manager>
<manager name="Logoff" language="en_US">
<synopsis>
Logoff Manager.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
</syntax>
<description>
<para>Logoff the current manager session.</para>
</description>
<see-also>
<ref type="manager">Login</ref>
</see-also>
</manager>
<manager name="Login" language="en_US">
<synopsis>
Login Manager.
</synopsis>
<syntax>
<parameter name="ActionID">
<para>ActionID for this transaction. Will be returned.</para>
</parameter>
<parameter name="Username" required="true">
<para>Username to login with as specified in manager.conf.</para>
</parameter>
<parameter name="Secret">
<para>Secret to login with as specified in manager.conf.</para>
</parameter>
</syntax>
<description>
<para>Login Manager.</para>
</description>
<see-also>
<ref type="manager">Logoff</ref>
</see-also>
</manager>
<manager name="Challenge" language="en_US">
<synopsis>
Generate Challenge for MD5 Auth.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="AuthType" required="true">
<para>Digest algorithm to use in the challenge. Valid values are:</para>
<enumlist>
<enum name="MD5" />
</enumlist>
</parameter>
</syntax>
<description>
<para>Generate a challenge for MD5 authentication.</para>
</description>
</manager>
<manager name="Hangup" language="en_US">
<synopsis>
Hangup channel.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel" required="true">
<para>The exact channel name to be hungup, or to use a regular expression, set this parameter to: /regex/</para>
<para>Example exact channel: SIP/provider-0000012a</para>
<para>Example regular expression: /^SIP/provider-.*$/</para>
</parameter>
<parameter name="Cause">
<para>Numeric hangup cause.</para>
</parameter>
</syntax>
<description>
<para>Hangup a channel.</para>
</description>
</manager>
<manager name="Status" language="en_US">
<synopsis>
List channel status.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel" required="false">
<para>The name of the channel to query for status.</para>
</parameter>
<parameter name="Variables">
<para>Comma <literal>,</literal> separated list of variable to include.</para>
</parameter>
</syntax>
<description>
<para>Will return the status information of each channel along with the
value for the specified channel variables.</para>
</description>
<responses>
<list-elements>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='Status'])" />
</list-elements>
<xi:include xpointer="xpointer(/docs/managerEvent[@name='StatusComplete'])" />
</responses>
</manager>
<managerEvent language="en_US" name="Status">
<managerEventInstance class="EVENT_FLAG_CALL">
<synopsis>Raised in response to a Status command.</synopsis>
<syntax>
<parameter name="ActionID" required="false"/>
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<parameter name="Type">
<para>Type of channel</para>
</parameter>
<parameter name="DNID">
<para>Dialed number identifier</para>
</parameter>
<parameter name="TimeToHangup">
<para>Absolute lifetime of the channel</para>
</parameter>
<parameter name="BridgeID">
<para>Identifier of the bridge the channel is in, may be empty if not in one</para>
</parameter>
<parameter name="Linkedid">
</parameter>
<parameter name="Application">
<para>Application currently executing on the channel</para>
</parameter>
<parameter name="Data">
<para>Data given to the currently executing channel</para>
</parameter>
<parameter name="Nativeformats">
<para>Media formats the connected party is willing to send or receive</para>
</parameter>
<parameter name="Readformat">
<para>Media formats that frames from the channel are received in</para>
</parameter>
<parameter name="Readtrans">
<para>Translation path for media received in native formats</para>
</parameter>
<parameter name="Writeformat">
<para>Media formats that frames to the channel are accepted in</para>
</parameter>
<parameter name="Writetrans">
<para>Translation path for media sent to the connected party</para>
</parameter>
<parameter name="Callgroup">
<para>Configured call group on the channel</para>
</parameter>
<parameter name="Pickupgroup">
<para>Configured pickup group on the channel</para>
</parameter>
<parameter name="Seconds">
<para>Number of seconds the channel has been active</para>
</parameter>
</syntax>
<see-also>
<ref type="manager">Status</ref>
</see-also>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="StatusComplete">
<managerEventInstance class="EVENT_FLAG_CALL">
<synopsis>Raised in response to a Status command.</synopsis>
<syntax>
<parameter name="Items">
<para>Number of Status events returned</para>
</parameter>
</syntax>
<see-also>
<ref type="manager">Status</ref>
</see-also>
</managerEventInstance>
</managerEvent>
<manager name="Setvar" language="en_US">
<synopsis>
Sets a channel variable or function value.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel">
<para>Channel to set variable for.</para>
</parameter>
<parameter name="Variable" required="true">
<para>Variable name, function or expression.</para>
</parameter>
<parameter name="Value" required="true">
<para>Variable or function value.</para>
</parameter>
</syntax>
<description>
<para>This command can be used to set the value of channel variables or dialplan
functions.</para>
Richard Mudgett
committed
<note>
<para>If a channel name is not provided then the variable is considered global.</para>
Richard Mudgett
committed
</note>
</description>
<see-also>
<ref type="manager">Getvar</ref>
</see-also>
</manager>
<manager name="Getvar" language="en_US">
<synopsis>
Gets a channel variable or function value.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel">
<para>Channel to read variable from.</para>
</parameter>
<parameter name="Variable" required="true">
<para>Variable name, function or expression.</para>
</parameter>
</syntax>
<description>
<para>Get the value of a channel variable or function return.</para>
Richard Mudgett
committed
<note>
<para>If a channel name is not provided then the variable is considered global.</para>
Richard Mudgett
committed
</note>
</description>
<see-also>
<ref type="manager">Setvar</ref>
</see-also>
</manager>
<manager name="GetConfig" language="en_US">
<synopsis>
Retrieve configuration.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Filename" required="true">
<para>Configuration filename (e.g. <filename>foo.conf</filename>).</para>
</parameter>
<parameter name="Category">
<para>Category in configuration file.</para>
</parameter>
<parameter name="Filter">
<para>A comma separated list of
<replaceable>name_regex</replaceable>=<replaceable>value_regex</replaceable>
expressions which will cause only categories whose variables match all expressions
to be considered. The special variable name <literal>TEMPLATES</literal>
can be used to control whether templates are included. Passing
<literal>include</literal> as the value will include templates
along with normal categories. Passing
<literal>restrict</literal> as the value will restrict the operation to
ONLY templates. Not specifying a <literal>TEMPLATES</literal> expression
results in the default behavior which is to not include templates.</para>
</parameter>
</syntax>
<description>
<para>This action will dump the contents of a configuration
file by category and contents or optionally by specified category only.
In the case where a category name is non-unique, a filter may be specified
to match only categories with matching variable values.</para>
</description>
<see-also>
<ref type="manager">GetConfigJSON</ref>
<ref type="manager">UpdateConfig</ref>
<ref type="manager">CreateConfig</ref>
<ref type="manager">ListCategories</ref>
</see-also>
</manager>
<manager name="GetConfigJSON" language="en_US">
<synopsis>
Retrieve configuration (JSON format).
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Filename" required="true">
<para>Configuration filename (e.g. <filename>foo.conf</filename>).</para>
</parameter>
<parameter name="Category">
<para>Category in configuration file.</para>
</parameter>
<parameter name="Filter">
<xi:include xpointer="xpointer(/docs/manager[@name='GetConfig']/syntax/parameter[@name='Filter']/para[1])" />
</parameter>
</syntax>
<description>
<para>This action will dump the contents of a configuration file by category
and contents in JSON format or optionally by specified category only.
This only makes sense to be used using rawman over the HTTP interface.
In the case where a category name is non-unique, a filter may be specified
to match only categories with matching variable values.</para>
</description>
<see-also>
<ref type="manager">GetConfig</ref>
<ref type="manager">UpdateConfig</ref>
<ref type="manager">CreateConfig</ref>
<ref type="manager">ListCategories</ref>
</see-also>
</manager>
<manager name="UpdateConfig" language="en_US">
<synopsis>
Update basic configuration.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="SrcFilename" required="true">
<para>Configuration filename to read (e.g. <filename>foo.conf</filename>).</para>
</parameter>
<parameter name="DstFilename" required="true">
<para>Configuration filename to write (e.g. <filename>foo.conf</filename>)</para>
</parameter>
<parameter name="Reload">
<para>Whether or not a reload should take place (or name of specific module).</para>
</parameter>
George Joseph
committed
<parameter name="PreserveEffectiveContext">
<para>Whether the effective category contents should be preserved on template change. Default is true (pre 13.2 behavior).</para>
</parameter>
<parameter name="Action-000000">
<para>Action to take.</para>
<para>0's represent 6 digit number beginning with 000000.</para>
<enumlist>
<enum name="NewCat" />
<enum name="RenameCat" />
<enum name="DelCat" />
<enum name="EmptyCat" />
<enum name="Update" />
<enum name="Delete" />
<enum name="Append" />
<enum name="Insert" />
</enumlist>
</parameter>
<parameter name="Cat-000000">
<para>Category to operate on.</para>
<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-000000']/para[2])" />
</parameter>
<parameter name="Var-000000">
<para>Variable to work on.</para>
<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-000000']/para[2])" />
</parameter>
<parameter name="Value-000000">
<para>Value to work on.</para>
<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-000000']/para[2])" />
</parameter>
<parameter name="Match-000000">
<para>Extra match required to match line.</para>
<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-000000']/para[2])" />
</parameter>
<parameter name="Line-000000">
<para>Line in category to operate on (used with delete and insert actions).</para>
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-000000']/para[2])" />
</parameter>
<parameter name="Options-000000">
<para>A comma separated list of action-specific options.</para>
<enumlist>
<enum name="NewCat"><para>One or more of the following... </para>
<enumlist>
<enum name="allowdups"><para>Allow duplicate category names.</para></enum>
<enum name="template"><para>This category is a template.</para></enum>
<enum name="inherit="template[,...]""><para>Templates from which to inherit.</para></enum>
</enumlist>
</enum>
</enumlist>
<para> </para>
<para>The following actions share the same options...</para>
<enumlist>
<enum name="RenameCat"/>
<enum name="DelCat"/>
<enum name="EmptyCat"/>
<enum name="Update"/>
<enum name="Delete"/>
<enum name="Append"/>
<enum name="Insert"><para> </para>
<enumlist>
<enum name="catfilter="<expression>[,...]""><para> </para>
<xi:include xpointer="xpointer(/docs/manager[@name='GetConfig']/syntax/parameter[@name='Filter']/para[1])" />
<para><literal>catfilter</literal> is most useful when a file
contains multiple categories with the same name and you wish to
operate on specific ones instead of all of them.</para>
</enum>
</enumlist>
</enum>
</enumlist>
<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-000000']/para[2])" />
</parameter>
</syntax>
<description>
<para>This action will modify, create, or delete configuration elements
in Asterisk configuration files.</para>
</description>
<see-also>
<ref type="manager">GetConfig</ref>
<ref type="manager">GetConfigJSON</ref>
<ref type="manager">CreateConfig</ref>
<ref type="manager">ListCategories</ref>
</see-also>
</manager>
<manager name="CreateConfig" language="en_US">
<synopsis>
Creates an empty file in the configuration directory.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Filename" required="true">
<para>The configuration filename to create (e.g. <filename>foo.conf</filename>).</para>
</parameter>
</syntax>
<description>
<para>This action will create an empty file in the configuration
directory. This action is intended to be used before an UpdateConfig
action.</para>
</description>
<see-also>
<ref type="manager">GetConfig</ref>
<ref type="manager">GetConfigJSON</ref>
<ref type="manager">UpdateConfig</ref>
<ref type="manager">ListCategories</ref>
</see-also>
</manager>
<manager name="ListCategories" language="en_US">
<synopsis>
List categories in configuration file.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Filename" required="true">
<para>Configuration filename (e.g. <filename>foo.conf</filename>).</para>
</parameter>
</syntax>
<description>
<para>This action will dump the categories in a given file.</para>
</description>
<see-also>
<ref type="manager">GetConfig</ref>
<ref type="manager">GetConfigJSON</ref>
<ref type="manager">UpdateConfig</ref>
<ref type="manager">CreateConfig</ref>
</see-also>
</manager>
<manager name="Redirect" language="en_US">
<synopsis>
Redirect (transfer) a call.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel" required="true">
<para>Channel to redirect.</para>
</parameter>
<parameter name="ExtraChannel">
<para>Second call leg to transfer (optional).</para>
</parameter>
<parameter name="Exten" required="true">
<para>Extension to transfer to.</para>
</parameter>
<parameter name="ExtraExten">
<para>Extension to transfer extrachannel to (optional).</para>
</parameter>
<parameter name="Context" required="true">
<para>Context to transfer to.</para>
</parameter>
<parameter name="ExtraContext">
<para>Context to transfer extrachannel to (optional).</para>
</parameter>
<parameter name="Priority" required="true">
<para>Priority to transfer to.</para>
</parameter>
<parameter name="ExtraPriority">
<para>Priority to transfer extrachannel to (optional).</para>
</parameter>
</syntax>
<description>
<para>Redirect (transfer) a call.</para>
</description>
<see-also>
<ref type="manager">BlindTransfer</ref>
</see-also>
</manager>
<manager name="Atxfer" language="en_US">
<synopsis>
Attended transfer.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel" required="true">
<para>Transferer's channel.</para>
</parameter>
<parameter name="Exten" required="true">
<para>Extension to transfer to.</para>
</parameter>
<parameter name="Context">
<para>Context to transfer to.</para>
</parameter>
</syntax>
<description>
<para>Attended transfer.</para>
</description>
<see-also>
<ref type="managerEvent">AttendedTransfer</ref>
</see-also>
</manager>
<manager name="CancelAtxfer" language="en_US">
<synopsis>
Cancel an attended transfer.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel" required="true">
<para>The transferer channel.</para>
</parameter>
</syntax>
<description>
<para>Cancel an attended transfer. Note, this uses the configured cancel attended transfer
feature option (atxferabort) to cancel the transfer. If not available this action will fail.
</para>
</description>
<see-also>
<ref type="managerEvent">AttendedTransfer</ref>
</see-also>
</manager>
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
<manager name="Originate" language="en_US">
<synopsis>
Originate a call.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel" required="true">
<para>Channel name to call.</para>
</parameter>
<parameter name="Exten">
<para>Extension to use (requires <literal>Context</literal> and
<literal>Priority</literal>)</para>
</parameter>
<parameter name="Context">
<para>Context to use (requires <literal>Exten</literal> and
<literal>Priority</literal>)</para>
</parameter>
<parameter name="Priority">
<para>Priority to use (requires <literal>Exten</literal> and
<literal>Context</literal>)</para>
</parameter>
<parameter name="Application">
<para>Application to execute.</para>
</parameter>
<parameter name="Data">
<para>Data to use (requires <literal>Application</literal>).</para>
</parameter>
<parameter name="Timeout" default="30000">
<para>How long to wait for call to be answered (in ms.).</para>
</parameter>
<parameter name="CallerID">
<para>Caller ID to be set on the outgoing channel.</para>
</parameter>
<parameter name="Variable">
<para>Channel variable to set, multiple Variable: headers are allowed.</para>
</parameter>
<parameter name="Account">
<para>Account code.</para>
</parameter>
<parameter name="EarlyMedia">
<para>Set to <literal>true</literal> to force call bridge on early media..</para>
</parameter>
<parameter name="Async">
<para>Set to <literal>true</literal> for fast origination.</para>
</parameter>
<parameter name="Codecs">
<para>Comma-separated list of codecs to use for this call.</para>
</parameter>
<parameter name="ChannelId">
<para>Channel UniqueId to be set on the channel.</para>
</parameter>
<parameter name="OtherChannelId">
<para>Channel UniqueId to be set on the second local channel.</para>
</parameter>
</syntax>
<description>
<para>Generates an outgoing call to a
<replaceable>Extension</replaceable>/<replaceable>Context</replaceable>/<replaceable>Priority</replaceable>
or <replaceable>Application</replaceable>/<replaceable>Data</replaceable></para>
</description>
<see-also>
<ref type="managerEvent">OriginateResponse</ref>
</see-also>
</manager>
<managerEvent language="en_US" name="OriginateResponse">
<managerEventInstance class="EVENT_FLAG_CALL">
<synopsis>Raised in response to an Originate command.</synopsis>
<syntax>
<parameter name="ActionID" required="false"/>
<parameter name="Response">
<enumlist>
<enum name="Failure"/>
<enum name="Success"/>
</enumlist>
</parameter>
<parameter name="Channel"/>
<parameter name="Context"/>
<parameter name="Exten"/>
<parameter name="Application"/>
<parameter name="Data"/>
<parameter name="Reason"/>
<parameter name="Uniqueid"/>
<parameter name="CallerIDNum"/>
<parameter name="CallerIDName"/>
</syntax>
<see-also>
<ref type="manager">Originate</ref>
</see-also>
</managerEventInstance>
</managerEvent>
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
<manager name="Command" language="en_US">
<synopsis>
Execute Asterisk CLI Command.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Command" required="true">
<para>Asterisk CLI command to run.</para>
</parameter>
</syntax>
<description>
<para>Run a CLI command.</para>
</description>
</manager>
<manager name="ExtensionState" language="en_US">
<synopsis>
Check Extension Status.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Exten" required="true">
<para>Extension to check state on.</para>
</parameter>
<parameter name="Context" required="true">
<para>Context for extension.</para>
</parameter>
</syntax>
<description>
<para>Report the extension state for given extension. If the extension has a hint,
will use devicestate to check the status of the device connected to the extension.</para>
<para>Will return an <literal>Extension Status</literal> message. The response will include
the hint for the extension and the status.</para>
</description>
<see-also>
<ref type="managerEvent">ExtensionStatus</ref>
</see-also>
</manager>
<manager name="PresenceState" language="en_US">
<synopsis>
Check Presence State
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Provider" required="true">
<para>Presence Provider to check the state of</para>
</parameter>
</syntax>
<description>
<para>Report the presence state for the given presence provider.</para>
<para>Will return a <literal>Presence State</literal> message. The response will include the
presence state and, if set, a presence subtype and custom message.</para>
</description>
<see-also>
<ref type="managerEvent">PresenceStatus</ref>
</see-also>
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
<manager name="AbsoluteTimeout" language="en_US">
<synopsis>
Set absolute timeout.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel" required="true">
<para>Channel name to hangup.</para>
</parameter>
<parameter name="Timeout" required="true">
<para>Maximum duration of the call (sec).</para>
</parameter>
</syntax>
<description>
<para>Hangup a channel after a certain time. Acknowledges set time with
<literal>Timeout Set</literal> message.</para>
</description>
</manager>
<manager name="MailboxStatus" language="en_US">
<synopsis>
Check mailbox.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Mailbox" required="true">
<para>Full mailbox ID <replaceable>mailbox</replaceable>@<replaceable>vm-context</replaceable>.</para>
</parameter>
</syntax>
<description>
<para>Checks a voicemail account for status.</para>
Mark Michelson
committed
<para>Returns whether there are messages waiting.</para>
<para>Message: Mailbox Status.</para>
<para>Mailbox: <replaceable>mailboxid</replaceable>.</para>
<para>Waiting: <literal>0</literal> if messages waiting, <literal>1</literal>
if no messages waiting.</para>
</description>
<see-also>
<ref type="manager">MailboxCount</ref>
</see-also>
</manager>
<manager name="MailboxCount" language="en_US">
<synopsis>
Check Mailbox Message Count.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Mailbox" required="true">
<para>Full mailbox ID <replaceable>mailbox</replaceable>@<replaceable>vm-context</replaceable>.</para>
</parameter>
</syntax>
<description>
<para>Checks a voicemail account for new messages.</para>
<para>Returns number of urgent, new and old messages.</para>
<para>Message: Mailbox Message Count</para>
<para>Mailbox: <replaceable>mailboxid</replaceable></para>
<para>UrgentMessages: <replaceable>count</replaceable></para>
<para>NewMessages: <replaceable>count</replaceable></para>
<para>OldMessages: <replaceable>count</replaceable></para>
</description>
<see-also>
<ref type="manager">MailboxStatus</ref>
</see-also>
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
</manager>
<manager name="ListCommands" language="en_US">
<synopsis>
List available manager commands.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
</syntax>
<description>
<para>Returns the action name and synopsis for every action that
is available to the user.</para>
</description>
</manager>
<manager name="SendText" language="en_US">
<synopsis>
Send text message to channel.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Channel" required="true">
<para>Channel to send message to.</para>
</parameter>
<parameter name="Message" required="true">
<para>Message to send.</para>
</parameter>
</syntax>
<description>
<para>Sends A Text Message to a channel while in a call.</para>
</description>
</manager>
<manager name="UserEvent" language="en_US">
<synopsis>
Send an arbitrary event.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="UserEvent" required="true">
<para>Event string to send.</para>
</parameter>
<parameter name="Header1">
<para>Content1.</para>
</parameter>
<parameter name="HeaderN">
<para>ContentN.</para>
</parameter>
</syntax>
<description>
<para>Send an event to manager sessions.</para>
</description>
<see-also>
<ref type="managerEvent">UserEvent</ref>
<ref type="application">UserEvent</ref>
</see-also>
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
</manager>
<manager name="WaitEvent" language="en_US">
<synopsis>
Wait for an event to occur.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Timeout" required="true">
<para>Maximum time (in seconds) to wait for events, <literal>-1</literal> means forever.</para>
</parameter>
</syntax>
<description>
<para>This action will ellicit a <literal>Success</literal> response. Whenever
a manager event is queued. Once WaitEvent has been called on an HTTP manager
session, events will be generated and queued.</para>
</description>
</manager>
<manager name="CoreSettings" language="en_US">
<synopsis>
Show PBX core settings (version etc).
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
</syntax>
<description>
<para>Query for Core PBX settings.</para>
</description>
</manager>
<manager name="CoreStatus" language="en_US">
<synopsis>
Show PBX core status variables.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
</syntax>
<description>
<para>Query for Core PBX status.</para>
</description>
</manager>
<manager name="Reload" language="en_US">
<synopsis>
Send a reload event.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="Module">
<para>Name of the module to reload.</para>
</parameter>
</syntax>
<description>
<para>Send a reload event.</para>
</description>
<see-also>
<ref type="manager">ModuleLoad</ref>
</see-also>
</manager>
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<managerEvent language="en_US" name="CoreShowChannel">
<managerEventInstance class="EVENT_FLAG_CALL">
<synopsis>Raised in response to a CoreShowChannels command.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<channel_snapshot/>
<parameter name="BridgeId">
<para>Identifier of the bridge the channel is in, may be empty if not in one</para>
</parameter>
<parameter name="Application">
<para>Application currently executing on the channel</para>
</parameter>
<parameter name="ApplicationData">
<para>Data given to the currently executing application</para>
</parameter>
<parameter name="Duration">
<para>The amount of time the channel has existed</para>
</parameter>
</syntax>
<see-also>
<ref type="manager">CoreShowChannels</ref>
<ref type="managerEvent">CoreShowChannelsComplete</ref>
</see-also>
</managerEventInstance>
</managerEvent>
<managerEvent language="en_US" name="CoreShowChannelsComplete">
<managerEventInstance class="EVENT_FLAG_CALL">
<synopsis>Raised at the end of the CoreShowChannel list produced by the CoreShowChannels command.</synopsis>
<syntax>
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="EventList">
<para>Conveys the status of the command reponse list</para>
</parameter>
<parameter name="ListItems">
<para>The total number of list items produced</para>
</parameter>
</syntax>
<see-also>
<ref type="manager">CoreShowChannels</ref>
<ref type="managerEvent">CoreShowChannel</ref>