mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
app_directory: Add a 'skip call' option.
Adds 's' option to skip calling the extension and instead set the extension as DIRECTORY_EXTEN channel variable. ASTERISK-30405 Change-Id: Ib9d9db1ba5b7524594c640461b4aa8f752db8299
This commit is contained in:
committed by
George Joseph
parent
114630279d
commit
3b75e6d45e
@@ -107,6 +107,10 @@
|
|||||||
<para>Load the specified config file instead of voicemail.conf</para>
|
<para>Load the specified config file instead of voicemail.conf</para>
|
||||||
<argument name="filename" required="true" />
|
<argument name="filename" required="true" />
|
||||||
</option>
|
</option>
|
||||||
|
<option name="s">
|
||||||
|
<para>Skip calling the extension, instead set it in the <variable>DIRECTORY_EXTEN</variable>
|
||||||
|
channel variable.</para>
|
||||||
|
</option>
|
||||||
</optionlist>
|
</optionlist>
|
||||||
<note><para>Only one of the <replaceable>f</replaceable>, <replaceable>l</replaceable>, or <replaceable>b</replaceable>
|
<note><para>Only one of the <replaceable>f</replaceable>, <replaceable>l</replaceable>, or <replaceable>b</replaceable>
|
||||||
options may be specified. <emphasis>If more than one is specified</emphasis>, then Directory will act as
|
options may be specified. <emphasis>If more than one is specified</emphasis>, then Directory will act as
|
||||||
@@ -123,7 +127,7 @@
|
|||||||
received and the extension to jump to exists:</para>
|
received and the extension to jump to exists:</para>
|
||||||
<para><literal>0</literal> - Jump to the 'o' extension, if it exists.</para>
|
<para><literal>0</literal> - Jump to the 'o' extension, if it exists.</para>
|
||||||
<para><literal>*</literal> - Jump to the 'a' extension, if it exists.</para>
|
<para><literal>*</literal> - Jump to the 'a' extension, if it exists.</para>
|
||||||
<para>This application will set the following channel variable before completion:</para>
|
<para>This application will set the following channel variables before completion:</para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<variable name="DIRECTORY_RESULT">
|
<variable name="DIRECTORY_RESULT">
|
||||||
<para>Reason Directory application exited.</para>
|
<para>Reason Directory application exited.</para>
|
||||||
@@ -135,6 +139,10 @@
|
|||||||
<value name="USEREXIT">User exited with '#' during selection</value>
|
<value name="USEREXIT">User exited with '#' during selection</value>
|
||||||
<value name="FAILED">The application failed</value>
|
<value name="FAILED">The application failed</value>
|
||||||
</variable>
|
</variable>
|
||||||
|
<variable name="DIRECTORY_EXTEN">
|
||||||
|
<para>If the skip calling option is set this will be set to the selected extension
|
||||||
|
provided one is selected.</para>
|
||||||
|
</variable>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</description>
|
</description>
|
||||||
</application>
|
</application>
|
||||||
@@ -158,6 +166,7 @@ enum {
|
|||||||
OPT_NOANSWER = (1 << 6),
|
OPT_NOANSWER = (1 << 6),
|
||||||
OPT_ALIAS = (1 << 7),
|
OPT_ALIAS = (1 << 7),
|
||||||
OPT_CONFIG_FILE = (1 << 8),
|
OPT_CONFIG_FILE = (1 << 8),
|
||||||
|
OPT_SKIP = (1 << 9),
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -190,6 +199,7 @@ AST_APP_OPTIONS(directory_app_options, {
|
|||||||
AST_APP_OPTION('n', OPT_NOANSWER),
|
AST_APP_OPTION('n', OPT_NOANSWER),
|
||||||
AST_APP_OPTION('a', OPT_ALIAS),
|
AST_APP_OPTION('a', OPT_ALIAS),
|
||||||
AST_APP_OPTION_ARG('c', OPT_CONFIG_FILE, OPT_ARG_FILENAME),
|
AST_APP_OPTION_ARG('c', OPT_CONFIG_FILE, OPT_ARG_FILENAME),
|
||||||
|
AST_APP_OPTION('s', OPT_SKIP),
|
||||||
});
|
});
|
||||||
|
|
||||||
static int compare(const char *text, const char *template)
|
static int compare(const char *text, const char *template)
|
||||||
@@ -325,6 +335,9 @@ static int select_entry(struct ast_channel *chan, const char *dialcontext, const
|
|||||||
if (ast_test_flag(flags, OPT_FROMVOICEMAIL)) {
|
if (ast_test_flag(flags, OPT_FROMVOICEMAIL)) {
|
||||||
/* We still want to set the exten though */
|
/* We still want to set the exten though */
|
||||||
ast_channel_exten_set(chan, item->exten);
|
ast_channel_exten_set(chan, item->exten);
|
||||||
|
} else if (ast_test_flag(flags, OPT_SKIP)) {
|
||||||
|
/* Skip calling the extension, only set it in the channel variable. */
|
||||||
|
pbx_builtin_setvar_helper(chan, "DIRECTORY_EXTEN", item->exten);
|
||||||
} else if (ast_goto_if_exists(chan, S_OR(dialcontext, item->context), item->exten, 1)) {
|
} else if (ast_goto_if_exists(chan, S_OR(dialcontext, item->context), item->exten, 1)) {
|
||||||
ast_log(LOG_WARNING,
|
ast_log(LOG_WARNING,
|
||||||
"Can't find extension '%s' in context '%s'. "
|
"Can't find extension '%s' in context '%s'. "
|
||||||
|
5
doc/CHANGES-staging/app_directory_skip_call.txt
Normal file
5
doc/CHANGES-staging/app_directory_skip_call.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Subject: app_directory
|
||||||
|
|
||||||
|
A new option 's' has been added to the Directory() application that
|
||||||
|
will skip calling the extension and instead set the extension as
|
||||||
|
DIRECTORY_EXTEN channel variable.
|
Reference in New Issue
Block a user