[asterisk-commits] eliel: branch group/appdocsxml r147801 - /team/group/appdocsxml/main/pbx.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Oct 9 08:28:01 CDT 2008
Author: eliel
Date: Thu Oct 9 08:28:00 2008
New Revision: 147801
URL: http://svn.digium.com/view/asterisk?view=rev&rev=147801
Log:
Introduce:
Answer(), BackGround(), Busy(), Congestion(), ExecIfTime(), Goto(), GotoIf(), GotoIfTime()
ImportVar(), Hangup(), Incomplete(), KeepAlive(), NoOp(), Proceeding(), Progress(), RaiseException()
ResetCDR(), Ringing(), SayAlpha(), SayDigits(), SayNumber(), SayPhonetic(), Set(), MSet(), SetAMAFlags()
Wait(), WaitExten() applications XML documentation.
Modified:
team/group/appdocsxml/main/pbx.c
Modified: team/group/appdocsxml/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/pbx.c?view=diff&rev=147801&r1=147800&r2=147801
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Thu Oct 9 08:28:00 2008
@@ -89,6 +89,506 @@
* speed in small dialplans, they are worth the trouble in large dialplans.
*
*/
+
+/*** DOCUMENTATION
+ <application name="Answer" language="en_US">
+ <synopsis>
+ Answer a channel if ringing.
+ </synopsis>
+ <syntax>
+ <parameter name="delay">
+ <para>Asterisk will wait this number of milliseconds before returning to
+ the dialplan after answering the call.</para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>If the call has not been answered, this application will
+ answer it. Otherwise, it has no effect on the call.</para>
+ </description>
+ </application>
+ <application name="BackGround" language="en_US">
+ <synopsis>
+ Play an audio file while waiting for digits of an extension to go to.
+ </synopsis>
+ <syntax>
+ <parameter name="filenames" required="true" argsep="&">
+ <argument name="filename1" required="true" />
+ <argument name="filename2" multiple="true" />
+ </parameter>
+ <parameter name="options">
+ <optionlist>
+ <option name="s">
+ <para>Causes the playback of the message to be skipped
+ if the channel is not in the <literal>up</literal> state (i.e. it
+ hasn't been answered yet). If this happens, the
+ application will return immediately.</para>
+ </option>
+ <option name="n">
+ <para>Don't answer the channel before playing the files.</para>
+ </option>
+ <option name="m">
+ <para>Only break if a digit hit matches a one digit
+ extension in the destination context.</para>
+ </option>
+ </optionlist>
+ </parameter>
+ <parameter name="langoverride">
+ <para>Explicitly specifies which language to attempt to use for the requested sound files.</para>
+ </parameter>
+ <parameter name="context">
+ <para>This is the dialplan context that this application will use when exiting
+ to a dialed extension.</para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application will play the given list of files <emphasis>(do not put extension)</emphasis>
+ while waiting for an extension to be dialed by the calling channel. To continue waiting
+ for digits after this application has finished playing files, the <literal>WaitExten</literal>
+ application should be used.</para>
+ <para>If one of the requested sound files does not exist, call processing will be terminated.</para>
+ <para>This application sets the following channel variable upon completion:</para>
+ <variablelist>
+ <variable name="BACKGROUNDSTATUS">
+ <para>The status of the background attempt as a text string.</para>
+ <value name="SUCCESS" />
+ <value name="FAILED" />
+ </variable>
+ </variablelist>
+ <para>See Also: Playback (application) -- Play sound file(s) to the channel, that cannot be interrupted</para>
+ </description>
+ </application>
+ <application name="Busy" language="en_US">
+ <synopsis>
+ Indicate the Busy condition.
+ </synopsis>
+ <syntax>
+ <parameter name="timeout">
+ <para>If specified, the calling channel will be hung up after the specified number of seconds.
+ Otherwise, this application will wait until the calling channel hangs up.</para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application will indicate the busy condition to the calling channel.</para>
+ </description>
+ </application>
+ <application name="Congestion" language="en_US">
+ <synopsis>
+ Indicate the Congestion condition.
+ </synopsis>
+ <syntax>
+ <parameter name="timeout">
+ <para>If specified, the calling channel will be hung up after the specified number of seconds.
+ Otherwise, this application will wait until the calling channel hangs up.</para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application will indicate the congestion condition to the calling channel.</para>
+ </description>
+ </application>
+ <application name="ExecIfTime" language="en_US">
+ <synopsis>
+ Conditional application execution based on the current time.
+ </synopsis>
+ <syntax argsep="?">
+ <parameter name="day_condition" required="true">
+ <argument name="times" required="true" />
+ <argument name="weekdays" required="true" />
+ <argument name="mdays" required="true" />
+ <argument name="months" required="true" />
+ </parameter>
+ <parameter name="application" required="true" argsep="">
+ <argument name="appname" required="true" />
+ <argument name="(appargs)" />
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application will execute the specified dialplan application, with optional
+ arguments, if the current time matches the given time specification.</para>
+ </description>
+ </application>
+ <application name="Goto" language="en_US">
+ <synopsis>
+ Jump to a particular priority, extension, or context.
+ </synopsis>
+ <syntax>
+ <parameter name="context" />
+ <parameter name="extensions" />
+ <parameter name="priority" required="true" />
+ </syntax>
+ <description>
+ <para>This application will set the current context, extension, and priority in the channel structure.
+ After it completes, the pbx engine will continue dialplan execution at the specified location.
+ If no specific <replaceable>extension</replaceable>, or <replaceable>extension</replaceable> and
+ <replaceable>context</replaceable>, are specified, then this application will
+ just set the specified <replaceable>priority</replaceable> of the current extension.</para>
+ <para>At least a <replaceable>priority</replaceable> is required as an argument, or the goto will
+ return a <literal>-1</literal>, and the channel and call will be terminated.</para>
+ <para>If the location that is put into the channel information is bogus, and asterisk cannot
+ find that location in the dialplan, then the execution engine will try to find and execute the code in
+ the <literal>i</literal> (invalid) extension in the current context. If that does not exist, it will try to execute the
+ <literal>h</literal> extension. If either or neither the <literal>h</literal> or <literal>i</literal> extensions
+ have been defined, the channel is hung up, and the execution of instructions on the channel is terminated.
+ What this means is that, for example, you specify a context that does not exist, then
+ it will not be possible to find the <literal>h</literal> or <literal>i</literal> extensions,
+ and the call will terminate!</para>
+ </description>
+ </application>
+ <application name="GotoIf" language="en_US">
+ <synopsis>
+ Conditional goto.
+ </synopsis>
+ <syntax argsep="?">
+ <parameter name="condition" required="true" />
+ <parameter name="destination" required="true" argsep=":">
+ <argument name="labeliftrue">
+ <para>Continue at <replaceable>labeliftrue</replaceable> if the condition is true.</para>
+ </argument>
+ <argument name="labeliffalse">
+ <para>Continue at <replaceable>labeliffalse</replaceable> if the condition is false.</para>
+ </argument>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application will set the current context, extension, and priority in the channel structure
+ based on the evaluation of the given condition. After this application completes, the
+ pbx engine will continue dialplan execution at the specified location in the dialplan.
+ The labels are specified with the same syntax as used within the Goto application.
+ If the label chosen by the condition is omitted, no jump is performed, and the execution passes to the
+ next instruction. If the target location is bogus, and does not exist, the execution engine will try
+ to find and execute the code in the <literal>i</literal> (invalid) extension in the current context.
+ If that does not exist, it will try to execute the <literal>h</literal> extension.
+ If either or neither the <literal>h</literal> or <literal>i</literal> extensions have been defined,
+ the channel is hung up, and the execution of instructions on the channel is terminated.
+ Remember that this command can set the current context, and if the context specified
+ does not exist, then it will not be able to find any 'h' or 'i' extensions there, and
+ the channel and call will both be terminated!.</para>
+ </description>
+ </application>
+ <application name="GotoIfTime" language="en_US">
+ <synopsis>
+ Conditional Goto based on the current time.
+ </synopsis>
+ <syntax argsep="?">
+ <parameter name="condition" required="true">
+ <argument name="times" required="true" />
+ <argument name="weekdays" required="true" />
+ <argument name="mdays" required="true" />
+ <argument name="months" required="true" />
+ </parameter>
+ <parameter name="destination" required="true" argsep=":">
+ <argument name="labeliftrue" />
+ <argument name="labeliffalse" />
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application will set the context, extension, and priority in the channel structure
+ based on the evaluation of the given time specification. After this application completes,
+ the pbx engine will continue dialplan execution at the specified location in the dialplan.
+ If the current time is within the given time specification, the channel will continue at
+ <replaceable>labeliftrue</replaceable>. Otherwise the channel will continue at <replaceable>labeliffalse</replaceable>.
+ If the label chosen by the condition is omitted, no jump is performed, and execution passes to the next
+ instruction. If the target jump location is bogus, the same actions would be taken as for <literal>Goto</literal>.
+ Further information on the time specification can be found in examples
+ illustrating how to do time-based context includes in the dialplan.</para>
+ </description>
+ </application>
+ <application name="ImportVar" language="en_US">
+ <synopsis>
+ Import a variable from a channel into a new variable.
+ </synopsis>
+ <syntax argsep="=">
+ <parameter name="newvar" required="true" />
+ <parameter name="vardata" required="true">
+ <argument name="channelname" required="true" />
+ <argument name="variable" required="true" />
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application imports a <replaceable>variable</replaceable> from the specified
+ <replaceable>channel</replaceable> (as opposed to the current one) and stores it as a variable
+ (<replaceable>newvar</replaceable>) in the current channel (the channel that is calling this
+ application). Variables created by this application have the same inheritance properties as those
+ created with the <literal>Set</literal> application. See the documentation for <literal>Set</literal>
+ for more information.</para>
+ </description>
+ </application>
+ <application name="Hangup" language="en_US">
+ <synopsis>
+ Hang up the calling channel.
+ </synopsis>
+ <syntax>
+ <parameter name="causecode">
+ <para>If a <replaceable>causecode</replaceable> is given the channel's
+ hangup cause will be set to the given value.</para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application will hang up the calling channel.</para>
+ </description>
+ </application>
+ <application name="Incomplete" language="en_US">
+ <synopsis>
+ Returns AST_PBX_INCOMPLETE value.
+ </synopsis>
+ <syntax>
+ <parameter name="n">
+ <para>If specified, then Incomplete will not attempt to answer the channel first.</para>
+ <note><para>Most channel types need to be in Answer state in order to receive DTMF.</para></note>
+ </parameter>
+ </syntax>
+ <description>
+ <para>Signals the PBX routines that the previous matched extension is incomplete
+ and that further input should be allowed before matching can be considered
+ to be complete. Can be used within a pattern match when certain criteria warrants
+ a longer match.</para>
+
+ </description>
+ </application>
+ <application name="KeepAlive" language="en_US">
+ <synopsis>
+ Returns AST_PBX_KEEPALIVE value.
+ </synopsis>
+ <syntax />
+ <description>
+ <para>This application is chiefly meant for internal use with Gosubs. Please do not run
+ it alone from the dialplan!</para>
+ </description>
+ </application>
+ <application name="NoOp" language="en_US">
+ <synopsis>
+ Do Nothing (No Operation).
+ </synopsis>
+ <syntax>
+ <parameter name="text">
+ <para>Any text provided can be viewed at the Asterisk CLI.</para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application does nothing. However, it is useful for debugging purposes.</para>
+ <para>This method can be used to see the evaluations of variables or functions without having any effect.
+ Alternatively, see the <literal>Verbose()</literal> application for finer grain control of output at
+ custom verbose levels.</para>
+ </description>
+ </application>
+ <application name="Proceeding" language="en_US">
+ <synopsis>
+ Indicate proceeding.
+ </synopsis>
+ <syntax />
+ <description>
+ <para>This application will request that a proceeding message be provided to the calling channel.</para>
+ </description>
+ </application>
+ <application name="Progress" language="en_US">
+ <synopsis>
+ Indicate progress.
+ </synopsis>
+ <syntax />
+ <description>
+ <para>This application will request that in-band progress information be provided to the calling channel.</para>
+ </description>
+ </application>
+ <application name="RaiseException" language="en_US">
+ <synopsis>
+ Handle an exceptional condition.
+ </synopsis>
+ <syntax>
+ <parameter name="reason" required="true" />
+ </syntax>
+ <description>
+ <para>This application will jump to the <literal>e</literal> extension in the current context, setting the
+ dialplan function EXCEPTION(). If the <literal>e</literal> extension does not exist, the call will hangup.</para>
+ </description>
+ </application>
+ <application name="ResetCDR" language="en_US">
+ <synopsis>
+ Resets the Call Data Record.
+ </synopsis>
+ <syntax>
+ <parameter name="options">
+ <optionlist>
+ <option name="w">
+ <para>Store the current CDR record before resetting it.</para>
+ </option>
+ <option name="a">
+ <para>Store any stacked records.</para>
+ </option>
+ <option name="v">
+ <para>Save CDR variables.</para>
+ </option>
+ <option name="e">
+ <para>Enable CDR only (negate effects of NoCDR).</para>
+ </option>
+ </optionlist>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application causes the Call Data Record to be reset.</para>
+ </description>
+ </application>
+ <application name="Ringing" language="en_US">
+ <synopsis>
+ Indicate ringing tone.
+ </synopsis>
+ <syntax />
+ <description>
+ <para>This application will request that the channel indicate a ringing tone to the user.</para>
+ </description>
+ </application>
+ <application name="SayAlpha" language="en_US">
+ <synopsis>
+ Say Alpha.
+ </synopsis>
+ <syntax>
+ <parameter name="string" required="true" />
+ </syntax>
+ <description>
+ <para>This application will play the sounds that correspond to the letters of the
+ given <replaceable>string</replaceable>.</para>
+ </description>
+ </application>
+ <application name="SayDigits" language="en_US">
+ <synopsis>
+ Say Digits.
+ </synopsis>
+ <syntax>
+ <parameter name="digits" required="true" />
+ </syntax>
+ <description>
+ <para>This application will play the sounds that correspond to the digits of
+ the given number. This will use the language that is currently set for the channel.
+ See the LANGUAGE() function for more information on setting the language for the channel.</para>
+ </description>
+ </application>
+ <application name="SayNumber" language="en_US">
+ <synopsis>
+ Say Number.
+ </synopsis>
+ <syntax>
+ <parameter name="digits" required="true" />
+ <parameter name="gender" />
+ </syntax>
+ <description>
+ <para>This application will play the sounds that correspond to the given <replaceable>digits</replaceable>.
+ Optionally, a <replaceable>gender</replaceable> may be specified. This will use the language that is currently
+ set for the channel. See the LANGUAGE() function for more information on setting the language for the channel.</para>
+ </description>
+ </application>
+ <application name="SayPhonetic" language="en_US">
+ <synopsis>
+ Say Phonetic.
+ </synopsis>
+ <syntax>
+ <parameter name="string" required="true" />
+ </syntax>
+ <description>
+ <para>This application will play the sounds from the phonetic alphabet that correspond to the
+ letters in the given <replaceable>string</replaceable>.</para>
+ </description>
+ </application>
+ <application name="Set" language="en_US">
+ <synopsis>
+ Set channel variable or function value.
+ </synopsis>
+ <syntax argsep="=">
+ <parameter name="name" required="true" />
+ <parameter name="value" required="true" />
+ </syntax>
+ <description>
+ <para>This function can be used to set the value of channel variables or dialplan functions.
+ When setting variables, if the variable name is prefixed with <literal>_</literal>,
+ the variable will be inherited into channels created from the current channel.
+ If the variable name is prefixed with <literal>__</literal>, the variable will be
+ inherited into channels created from the current channel and all children channels.</para>
+ <note><para>If (and only if), in <filename>/etc/asterisk/asterisk.conf</filename>, you have
+ a <literal>[compat]</literal> category, and you have <literal>app_set = 1.6</literal> under that,then
+ the behavior of this app changes, and does not strip surrounding quotes from the right hand side as
+ it did previously in 1.4. The <literal>app_set = 1.6</literal> is only inserted if <literal>make samples</literal>
+ is executed, or if users insert this by hand into the <filename>asterisk.conf</filename> file.
+ The advantages of not stripping out quoting, and not caring about the separator characters (comma and vertical bar)
+ were sufficient to make these changes in 1.6. Confusion about how many backslashes would be needed to properly
+ protect separators and quotes in various database access strings has been greatly
+ reduced by these changes.</para></note>
+ </description>
+ </application>
+ <application name="MSet" language="en_US">
+ <synopsis>
+ Set channel variable(s) or function value(s).
+ </synopsis>
+ <syntax>
+ <parameter name="set1" required="true" argsep="=">
+ <argument name="name1" required="true" />
+ <argument name="value1" required="true" />
+ </parameter>
+ <parameter name="set2" multiple="true" argsep="=">
+ <argument name="name2" required="true" />
+ <argument name="value2" required="true" />
+ </parameter>
+ </syntax>
+ <description>
+ <para>This function can be used to set the value of channel variables or dialplan functions.
+ When setting variables, if the variable name is prefixed with <literal>_</literal>,
+ the variable will be inherited into channels created from the current channel
+ If the variable name is prefixed with <literal>__</literal>, the variable will be
+ inherited into channels created from the current channel and all children channels.
+ MSet behaves in a similar fashion to the way Set worked in 1.2/1.4 and is thus
+ prone to doing things that you may not expect. For example, it strips surrounding
+ double-quotes from the right-hand side (value). If you need to put a separator
+ character (comma or vert-bar), you will need to escape them by inserting a backslash
+ before them. Avoid its use if possible.</para>
+ </description>
+ </application>
+ <application name="SetAMAFlags" language="en_US">
+ <synopsis>
+ Set the AMA Flags.
+ </synopsis>
+ <syntax>
+ <parameter name="flag" />
+ </syntax>
+ <description>
+ <para>This application will set the channel's AMA Flags for billing purposes.</para>
+ </description>
+ </application>
+ <application name="Wait" language="en_US">
+ <synopsis>
+ </synopsis>
+ <syntax>
+ <parameter name="seconds" required="true">
+ <para>Can be passed with fractions of a second. For example, <literal>1.5</literal> will ask the
+ application to wait for 1.5 seconds.</para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application waits for a specified number of <replaceable>seconds</replaceable>.</para>
+ </description>
+ </application>
+ <application name="WaitExten" language="en_US">
+ <synopsis>
+ Waits for an extension to be entered.
+ </synopsis>
+ <syntax>
+ <parameter name="seconds">
+ <para>Can be passed with fractions of a second. For example, <literal>1.5</literal> will ask the
+ application to wait for 1.5 seconds.</para>
+ </parameter>
+ <parameter name="options">
+ <optionlist>
+ <option name="m">
+ <para>Provide music on hold to the caller while waiting for an extension.</para>
+ <argument name="x">
+ <para>Specify the class for music on hold.</para>
+ </argument>
+ </option>
+ </optionlist>
+ </parameter>
+ </syntax>
+ <description>
+ <para>This application waits for the user to enter a new extension for a specified number
+ of <replaceable>seconds</replaceable>.</para>
+ <para>See Also: Playback(application), Background(application).</para>
+ </description>
+ </application>
+ ***/
#ifdef LOW_MEMORY
#define EXT_DATA_SIZE 256
@@ -451,296 +951,38 @@
static struct pbx_builtin {
char name[AST_MAX_APP];
int (*execute)(struct ast_channel *chan, void *data);
- char *synopsis;
- char *description;
} builtins[] =
{
/* These applications are built into the PBX core and do not
need separate modules */
- { "Answer", pbx_builtin_answer,
- "Answer a channel if ringing",
- " Answer([delay]): If the call has not been answered, this application will\n"
- "answer it. Otherwise, it has no effect on the call. If a delay is specified,\n"
- "Asterisk will wait this number of milliseconds before returning to\n"
- "the dialplan after answering the call.\n"
- },
-
- { "BackGround", pbx_builtin_background,
- "Play an audio file while waiting for digits of an extension to go to.",
- " Background(filename1[&filename2...][,options[,langoverride][,context]]):\n"
- "This application will play the given list of files (do not put extension)\n"
- "while waiting for an extension to be dialed by the calling channel. To\n"
- "continue waiting for digits after this application has finished playing\n"
- "files, the WaitExten application should be used. The 'langoverride' option\n"
- "explicitly specifies which language to attempt to use for the requested sound\n"
- "files. If a 'context' is specified, this is the dialplan context that this\n"
- "application will use when exiting to a dialed extension."
- " If one of the requested sound files does not exist, call processing will be\n"
- "terminated.\n"
- " Options:\n"
- " s - Causes the playback of the message to be skipped\n"
- " if the channel is not in the 'up' state (i.e. it\n"
- " hasn't been answered yet). If this happens, the\n"
- " application will return immediately.\n"
- " n - Don't answer the channel before playing the files.\n"
- " m - Only break if a digit hit matches a one digit\n"
- " extension in the destination context.\n"
- "This application sets the following channel variable upon completion:\n"
- " BACKGROUNDSTATUS The status of the background attempt as a text string, one of\n"
- " SUCCESS | FAILED\n"
- "See Also: Playback (application) -- Play sound file(s) to the channel,\n"
- " that cannot be interrupted\n"
- },
-
- { "Busy", pbx_builtin_busy,
- "Indicate the Busy condition",
- " Busy([timeout]): This application will indicate the busy condition to\n"
- "the calling channel. If the optional timeout is specified, the calling channel\n"
- "will be hung up after the specified number of seconds. Otherwise, this\n"
- "application will wait until the calling channel hangs up.\n"
- },
-
- { "Congestion", pbx_builtin_congestion,
- "Indicate the Congestion condition",
- " Congestion([timeout]): This application will indicate the congestion\n"
- "condition to the calling channel. If the optional timeout is specified, the\n"
- "calling channel will be hung up after the specified number of seconds.\n"
- "Otherwise, this application will wait until the calling channel hangs up.\n"
- },
-
- { "ExecIfTime", pbx_builtin_execiftime,
- "Conditional application execution based on the current time",
- " ExecIfTime(<times>,<weekdays>,<mdays>,<months>?appname[(appargs)]):\n"
- "This application will execute the specified dialplan application, with optional\n"
- "arguments, if the current time matches the given time specification.\n"
- },
-
- { "Goto", pbx_builtin_goto,
- "Jump to a particular priority, extension, or context",
- " Goto([[context,]extension,]priority): This application will set the current\n"
- "context, extension, and priority in the channel structure. After it completes, the\n"
- "pbx engine will continue dialplan execution at the specified location.\n"
- "If no specific extension, or extension and context, are specified, then this\n"
- "application will just set the specified priority of the current extension.\n"
- " At least a priority is required as an argument, or the goto will return a -1,\n"
- "and the channel and call will be terminated.\n"
- " If the location that is put into the channel information is bogus, and asterisk cannot\n"
- "find that location in the dialplan,\n"
- "then the execution engine will try to find and execute the code in the 'i' (invalid)\n"
- "extension in the current context. If that does not exist, it will try to execute the\n"
- "'h' extension. If either or neither the 'h' or 'i' extensions have been defined, the\n"
- "channel is hung up, and the execution of instructions on the channel is terminated.\n"
- "What this means is that, for example, you specify a context that does not exist, then\n"
- "it will not be possible to find the 'h' or 'i' extensions, and the call will terminate!\n"
- },
-
- { "GotoIf", pbx_builtin_gotoif,
- "Conditional goto",
- " GotoIf(condition?[labeliftrue]:[labeliffalse]): This application will set the current\n"
- "context, extension, and priority in the channel structure based on the evaluation of\n"
- "the given condition. After this application completes, the\n"
- "pbx engine will continue dialplan execution at the specified location in the dialplan.\n"
- "The channel will continue at\n"
- "'labeliftrue' if the condition is true, or 'labeliffalse' if the condition is\n"
- "false. The labels are specified with the same syntax as used within the Goto\n"
- "application. If the label chosen by the condition is omitted, no jump is\n"
- "performed, and the execution passes to the next instruction.\n"
- "If the target location is bogus, and does not exist, the execution engine will try \n"
- "to find and execute the code in the 'i' (invalid)\n"
- "extension in the current context. If that does not exist, it will try to execute the\n"
- "'h' extension. If either or neither the 'h' or 'i' extensions have been defined, the\n"
- "channel is hung up, and the execution of instructions on the channel is terminated.\n"
- "Remember that this command can set the current context, and if the context specified\n"
- "does not exist, then it will not be able to find any 'h' or 'i' extensions there, and\n"
- "the channel and call will both be terminated!\n"
- },
-
- { "GotoIfTime", pbx_builtin_gotoiftime,
- "Conditional Goto based on the current time",
- " GotoIfTime(<times>,<weekdays>,<mdays>,<months>?[labeliftrue]:[labeliffalse]):\n"
- "This application will set the context, extension, and priority in the channel structure\n"
- "based on the evaluation of the given time specification. After this application completes,\n"
- "the pbx engine will continue dialplan execution at the specified location in the dialplan.\n"
- "If the current time is within the given time specification, the channel will continue at\n"
- "'labeliftrue'. Otherwise the channel will continue at 'labeliffalse'. If the label chosen\n"
- "by the condition is omitted, no jump is performed, and execution passes to the next\n"
- "instruction. If the target jump location is bogus, the same actions would be taken as for\n"
- "Goto.\n"
- "Further information on the time specification can be found in examples\n"
- "illustrating how to do time-based context includes in the dialplan.\n"
- },
-
- { "ImportVar", pbx_builtin_importvar,
- "Import a variable from a channel into a new variable",
- " ImportVar(newvar=channelname,variable): This application imports a variable\n"
- "from the specified channel (as opposed to the current one) and stores it as\n"
- "a variable in the current channel (the channel that is calling this\n"
- "application). Variables created by this application have the same inheritance\n"
- "properties as those created with the Set application. See the documentation for\n"
- "Set for more information.\n"
- },
-
- { "Hangup", pbx_builtin_hangup,
- "Hang up the calling channel",
- " Hangup([causecode]): This application will hang up the calling channel.\n"
- "If a causecode is given the channel's hangup cause will be set to the given\n"
- "value.\n"
- },
-
- { "Incomplete", pbx_builtin_incomplete,
- "returns AST_PBX_INCOMPLETE value",
- " Incomplete([n]): Signals the PBX routines that the previous matched extension\n"
- "is incomplete and that further input should be allowed before matching can\n"
- "be considered to be complete. Can be used within a pattern match when\n"
- "certain criteria warrants a longer match.\n"
- " If the 'n' option is specified, then Incomplete will not attempt to answer\n"
- "the channel first. Note that most channel types need to be in Answer state\n"
- "in order to receive DTMF.\n"
- },
-
- { "KeepAlive", pbx_builtin_keepalive,
- "returns AST_PBX_KEEPALIVE value",
- " KeepAlive(): This application is chiefly meant for internal use with Gosubs.\n"
- "Please do not run it alone from the dialplan!\n"
- },
-
- { "NoOp", pbx_builtin_noop,
- "Do Nothing (No Operation)",
- " NoOp(): This application does nothing. However, it is useful for debugging\n"
- "purposes. Any text that is provided as arguments to this application can be\n"
- "viewed at the Asterisk CLI. This method can be used to see the evaluations of\n"
- "variables or functions without having any effect. Alternatively, see the\n"
- "Verbose() application for finer grain control of output at custom verbose levels.\n"
- },
-
- { "Proceeding", pbx_builtin_proceeding,
- "Indicate proceeding",
- " Proceeding(): This application will request that a proceeding message\n"
- "be provided to the calling channel.\n"
- },
-
- { "Progress", pbx_builtin_progress,
- "Indicate progress",
- " Progress(): This application will request that in-band progress information\n"
- "be provided to the calling channel.\n"
- },
-
- { "RaiseException", pbx_builtin_raise_exception,
- "Handle an exceptional condition",
- " RaiseException(<reason>): This application will jump to the \"e\" extension\n"
- "in the current context, setting the dialplan function EXCEPTION(). If the \"e\"\n"
- "extension does not exist, the call will hangup.\n"
- },
-
- { "ResetCDR", pbx_builtin_resetcdr,
- "Resets the Call Data Record",
- " ResetCDR([options]): This application causes the Call Data Record to be\n"
- "reset.\n"
- " Options:\n"
- " w -- Store the current CDR record before resetting it.\n"
- " a -- Store any stacked records.\n"
- " v -- Save CDR variables.\n"
- " e -- Enable CDR only (negate effects of NoCDR).\n"
- },
-
- { "Ringing", pbx_builtin_ringing,
- "Indicate ringing tone",
- " Ringing(): This application will request that the channel indicate a ringing\n"
- "tone to the user.\n"
- },
-
- { "SayAlpha", pbx_builtin_saycharacters,
- "Say Alpha",
- " SayAlpha(string): This application will play the sounds that correspond to\n"
- "the letters of the given string.\n"
- },
-
- { "SayDigits", pbx_builtin_saydigits,
- "Say Digits",
- " SayDigits(digits): This application will play the sounds that correspond\n"
- "to the digits of the given number. This will use the language that is currently\n"
- "set for the channel. See the LANGUAGE function for more information on setting\n"
- "the language for the channel.\n"
- },
-
- { "SayNumber", pbx_builtin_saynumber,
- "Say Number",
- " SayNumber(digits[,gender]): This application will play the sounds that\n"
- "correspond to the given number. Optionally, a gender may be specified.\n"
- "This will use the language that is currently set for the channel. See the\n"
- "LANGUAGE function for more information on setting the language for the channel.\n"
- },
-
- { "SayPhonetic", pbx_builtin_sayphonetic,
- "Say Phonetic",
- " SayPhonetic(string): This application will play the sounds from the phonetic\n"
- "alphabet that correspond to the letters in the given string.\n"
- },
-
- { "Set", pbx_builtin_setvar,
- "Set channel variable or function value",
- " Set(name=value)\n"
- "This function can be used to set the value of channel variables or dialplan\n"
- "functions. When setting variables, if the variable name is prefixed with _,\n"
- "the variable will be inherited into channels created from the current\n"
- "channel. If the variable name is prefixed with __, the variable will be\n"
- "inherited into channels created from the current channel and all children\n"
- "channels.\n"
- "Compatibility note: If (and only if), in /etc/asterisk/asterisk.conf, you have a [compat]\n"
- "category, and you have app_set = 1.6 under that, then the behavior of this\n"
- "app changes, and does not strip surrounding quotes from the right hand side\n"
- "as it did previously in 1.4. The app_set = 1.6 is only inserted if 'make samples'\n"
- "is executed, or if users insert this by hand into the asterisk.conf file.\n"
- "/nThe advantages of not stripping out quoting, and not caring about the\n"
- "separator characters (comma and vertical bar) were sufficient to make these\n"
- "changes in 1.6. Confusion about how many backslashes would be needed to properly\n"
- "protect separators and quotes in various database access strings has been greatly\n"
- "reduced by these changes.\n"
- },
-
- { "MSet", pbx_builtin_setvar_multiple,
- "Set channel variable(s) or function value(s)",
- " MSet(name1=value1,name2=value2,...)\n"
- "This function can be used to set the value of channel variables or dialplan\n"
- "functions. When setting variables, if the variable name is prefixed with _,\n"
- "the variable will be inherited into channels created from the current\n"
- "channel. If the variable name is prefixed with __, the variable will be\n"
- "inherited into channels created from the current channel and all children\n"
- "channels.\n\n"
- "MSet behaves in a similar fashion to the way Set worked in 1.2/1.4 and is thus\n"
- "prone to doing things that you may not expect. For example, it strips surrounding\n"
- "double-quotes from the right-hand side (value). If you need to put a separator\n"
- "character (comma or vert-bar), you will need to escape them by inserting a backslash\n"
- "before them. Avoid its use if possible.\n"
- },
-
- { "SetAMAFlags", pbx_builtin_setamaflags,
- "Set the AMA Flags",
- " SetAMAFlags([flag]): This application will set the channel's AMA Flags for\n"
- " billing purposes.\n"
- },
-
- { "Wait", pbx_builtin_wait,
- "Waits for some time",
- " Wait(seconds): This application waits for a specified number of seconds.\n"
- "Then, dialplan execution will continue at the next priority.\n"
- " Note that the seconds can be passed with fractions of a second. For example,\n"
- "'1.5' will ask the application to wait for 1.5 seconds.\n"
- },
-
- { "WaitExten", pbx_builtin_waitexten,
- "Waits for an extension to be entered",
- " WaitExten([seconds][,options]): This application waits for the user to enter\n"
- "a new extension for a specified number of seconds.\n"
- " Note that the seconds can be passed with fractions of a second. For example,\n"
- "'1.5' will ask the application to wait for 1.5 seconds.\n"
- " Options:\n"
- " m[(x)] - Provide music on hold to the caller while waiting for an extension.\n"
- " Optionally, specify the class for music on hold within parenthesis.\n"
- "See Also: Playback(application), Background(application).\n"
- },
-
+ { "Answer", pbx_builtin_answer },
+ { "BackGround", pbx_builtin_background },
+ { "Busy", pbx_builtin_busy },
+ { "Congestion", pbx_builtin_congestion },
+ { "ExecIfTime", pbx_builtin_execiftime },
+ { "Goto", pbx_builtin_goto },
+ { "GotoIf", pbx_builtin_gotoif },
+ { "GotoIfTime", pbx_builtin_gotoiftime },
+ { "ImportVar", pbx_builtin_importvar },
+ { "Hangup", pbx_builtin_hangup },
+ { "Incomplete", pbx_builtin_incomplete },
+ { "KeepAlive", pbx_builtin_keepalive },
+ { "NoOp", pbx_builtin_noop },
+ { "Proceeding", pbx_builtin_proceeding },
+ { "Progress", pbx_builtin_progress },
+ { "RaiseException", pbx_builtin_raise_exception },
+ { "ResetCDR", pbx_builtin_resetcdr },
+ { "Ringing", pbx_builtin_ringing },
+ { "SayAlpha", pbx_builtin_saycharacters },
+ { "SayDigits", pbx_builtin_saydigits },
+ { "SayNumber", pbx_builtin_saynumber },
+ { "SayPhonetic", pbx_builtin_sayphonetic },
+ { "Set", pbx_builtin_setvar },
+ { "MSet", pbx_builtin_setvar_multiple },
+ { "SetAMAFlags", pbx_builtin_setamaflags },
+ { "Wait", pbx_builtin_wait },
+ { "WaitExten", pbx_builtin_waitexten }
};
static struct ast_context *contexts;
@@ -10015,7 +10257,7 @@
/* Register builtin applications */
for (x = 0; x < sizeof(builtins) / sizeof(struct pbx_builtin); x++) {
ast_verb(1, "[%s]\n", builtins[x].name);
- if (ast_register_application2(builtins[x].name, builtins[x].execute, builtins[x].synopsis, builtins[x].description, NULL)) {
+ if (ast_register_application2(builtins[x].name, builtins[x].execute, NULL, NULL, NULL)) {
ast_log(LOG_ERROR, "Unable to register builtin application '%s'\n", builtins[x].name);
return -1;
}
More information about the asterisk-commits
mailing list