mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-06 13:07:21 +00:00
Merge "app_readexten: new option 'p' to stop reading on '#' key" into 16
This commit is contained in:
@@ -63,6 +63,10 @@
|
|||||||
<option name="n">
|
<option name="n">
|
||||||
<para>Read digits even if the channel is not answered.</para>
|
<para>Read digits even if the channel is not answered.</para>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="p">
|
||||||
|
<para>The extension entered will be considered complete when a <literal>#</literal>
|
||||||
|
is entered.</para>
|
||||||
|
</option>
|
||||||
</optionlist>
|
</optionlist>
|
||||||
</parameter>
|
</parameter>
|
||||||
<parameter name="timeout">
|
<parameter name="timeout">
|
||||||
@@ -100,12 +104,14 @@ enum readexten_option_flags {
|
|||||||
OPT_SKIP = (1 << 0),
|
OPT_SKIP = (1 << 0),
|
||||||
OPT_INDICATION = (1 << 1),
|
OPT_INDICATION = (1 << 1),
|
||||||
OPT_NOANSWER = (1 << 2),
|
OPT_NOANSWER = (1 << 2),
|
||||||
|
OPT_POUND_TO_END = (1 << 3),
|
||||||
};
|
};
|
||||||
|
|
||||||
AST_APP_OPTIONS(readexten_app_options, {
|
AST_APP_OPTIONS(readexten_app_options, {
|
||||||
AST_APP_OPTION('s', OPT_SKIP),
|
AST_APP_OPTION('s', OPT_SKIP),
|
||||||
AST_APP_OPTION('i', OPT_INDICATION),
|
AST_APP_OPTION('i', OPT_INDICATION),
|
||||||
AST_APP_OPTION('n', OPT_NOANSWER),
|
AST_APP_OPTION('n', OPT_NOANSWER),
|
||||||
|
AST_APP_OPTION('p', OPT_POUND_TO_END),
|
||||||
});
|
});
|
||||||
|
|
||||||
static char *app = "ReadExten";
|
static char *app = "ReadExten";
|
||||||
@@ -226,6 +232,11 @@ static int readexten_exec(struct ast_channel *chan, const char *data)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ast_test_flag(&flags, OPT_POUND_TO_END) && res == '#') {
|
||||||
|
exten[x] = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
exten[x] = res;
|
exten[x] = res;
|
||||||
if (!ast_matchmore_extension(chan, arglist.context, exten, 1 /* priority */,
|
if (!ast_matchmore_extension(chan, arglist.context, exten, 1 /* priority */,
|
||||||
S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
|
S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
|
||||||
|
3
doc/CHANGES-staging/app_readexten_pound.txt
Normal file
3
doc/CHANGES-staging/app_readexten_pound.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Subject: ReadExten
|
||||||
|
|
||||||
|
Add 'p' option to stop reading extension if user presses '#' key.
|
Reference in New Issue
Block a user