<ref type="function">TESTTIME</ref>
</see-also>
</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.</para>
- </description>
- <see-also>
- <ref type="application">Set</ref>
- </see-also>
- </application>
<application name="Hangup" language="en_US">
<synopsis>
Hang up the calling channel.
<ref type="function">SAYFILES</ref>
</see-also>
</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>
- <warning><para>This application is deprecated. Please use the CHANNEL function instead.</para></warning>
- </description>
- <see-also>
- <ref type="function">CDR</ref>
- <ref type="function">CHANNEL</ref>
- </see-also>
- </application>
<application name="Wait" language="en_US">
<synopsis>
Waits for some time.
char *parse;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(delay);
- AST_APP_ARG(answer_cdr);
+ AST_APP_ARG(options);
);
if (ast_strlen_zero(data)) {
delay = 0;
}
- if (!ast_strlen_zero(args.answer_cdr) && !strcmp(args.answer_cdr, "i")) {
- /*! \todo We will remove the nocdr stuff for 21 entirely, as part of another review. */
+ if (!ast_strlen_zero(args.options) && !strcmp(args.options, "i")) {
return ast_raw_answer(chan);
}
- if (!ast_strlen_zero(args.answer_cdr) && !strcasecmp(args.answer_cdr, "nocdr")) {
- ast_log(AST_LOG_WARNING, "The nocdr option for the Answer application has been removed and is no longer supported.\n");
- }
-
return __ast_answer(chan, delay);
}
return AST_PBX_INCOMPLETE;
}
-/*!
- * \ingroup applications
- */
-static int pbx_builtin_setamaflags(struct ast_channel *chan, const char *data)
-{
- ast_log(AST_LOG_WARNING, "The SetAMAFlags application is deprecated. Please use the CHANNEL function instead.\n");
-
- if (ast_strlen_zero(data)) {
- ast_log(AST_LOG_WARNING, "No parameter passed to SetAMAFlags\n");
- return 0;
- }
- /* Copy the AMA Flags as specified */
- ast_channel_lock(chan);
- if (isdigit(data[0])) {
- int amaflags;
- if (sscanf(data, "%30d", &amaflags) != 1) {
- ast_log(AST_LOG_WARNING, "Unable to set AMA flags on channel %s\n", ast_channel_name(chan));
- ast_channel_unlock(chan);
- return 0;
- }
- ast_channel_amaflags_set(chan, amaflags);
- } else {
- ast_channel_amaflags_set(chan, ast_channel_string2amaflag(data));
- }
- ast_channel_unlock(chan);
- return 0;
-}
-
/*!
* \ingroup applications
*/
return res;
}
-static int pbx_builtin_importvar(struct ast_channel *chan, const char *data)
-{
- char *name;
- char *value;
- char *channel;
- char tmp[VAR_BUF_SIZE];
- static int deprecation_warning = 0;
-
- if (ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "Ignoring, since there is no variable to set\n");
- return 0;
- }
- tmp[0] = 0;
- if (!deprecation_warning) {
- ast_log(LOG_WARNING, "ImportVar is deprecated. Please use Set(varname=${IMPORT(channel,variable)}) instead.\n");
- deprecation_warning = 1;
- }
-
- value = ast_strdupa(data);
- name = strsep(&value,"=");
- channel = strsep(&value,",");
- if (channel && value && name) { /*! \todo XXX should do !ast_strlen_zero(..) of the args ? */
- struct ast_channel *chan2 = ast_channel_get_by_name(channel);
- if (chan2) {
- char *s = ast_alloca(strlen(value) + 4);
- sprintf(s, "${%s}", value);
- pbx_substitute_variables_helper(chan2, s, tmp, sizeof(tmp) - 1);
- chan2 = ast_channel_unref(chan2);
- }
- pbx_builtin_setvar_helper(chan, name, tmp);
- }
-
- return(0);
-}
-
/*! \brief Declaration of builtin applications */
struct pbx_builtin {
char name[AST_MAX_APP];
{ "Goto", pbx_builtin_goto },
{ "GotoIf", pbx_builtin_gotoif },
{ "GotoIfTime", pbx_builtin_gotoiftime },
- { "ImportVar", pbx_builtin_importvar },
{ "Hangup", pbx_builtin_hangup },
{ "Incomplete", pbx_builtin_incomplete },
{ "NoOp", pbx_builtin_noop },
{ "SayNumber", pbx_builtin_saynumber },
{ "SayOrdinal", pbx_builtin_sayordinal },
{ "SayPhonetic", pbx_builtin_sayphonetic },
- { "SetAMAFlags", pbx_builtin_setamaflags },
{ "Wait", pbx_builtin_wait },
{ "WaitDigit", pbx_builtin_waitdigit },
{ "WaitExten", pbx_builtin_waitexten }