mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
app_originate: Add async option.
Add an option to make app_originate not wait for the created channel to answer. Change-Id: I7fc2facd77079abc6321f44e8bcd4e39298de2ae Requested-by: Frederic Steinfels <fst@highdefinition.ch> Signed-off-by: Russell Bryant <russell@russellbryant.net>
This commit is contained in:
committed by
Joshua Colp
parent
fa892d8dfd
commit
75715b95b4
7
CHANGES
7
CHANGES
@@ -17,6 +17,13 @@ app_fax
|
|||||||
* The app_fax module is now deprecated, users should migrate to the
|
* The app_fax module is now deprecated, users should migrate to the
|
||||||
replacement module res_fax.
|
replacement module res_fax.
|
||||||
|
|
||||||
|
app_originate
|
||||||
|
------------------
|
||||||
|
* An 'a' option has been added to the Originate dialplan application which
|
||||||
|
will execute the originate in an asynchronous fashion. If set then the
|
||||||
|
application will return immediately without waiting for the originated
|
||||||
|
channel to answer.
|
||||||
|
|
||||||
Build System
|
Build System
|
||||||
------------------
|
------------------
|
||||||
* MALLOC_DEBUG no longer has an effect on Asterisk's ABI. Asterisk built
|
* MALLOC_DEBUG no longer has an effect on Asterisk's ABI. Asterisk built
|
||||||
|
@@ -74,6 +74,10 @@ static const char app_originate[] = "Originate";
|
|||||||
</parameter>
|
</parameter>
|
||||||
<parameter name="options" required="false">
|
<parameter name="options" required="false">
|
||||||
<optionlist>
|
<optionlist>
|
||||||
|
<option name="a">
|
||||||
|
<para>Originate asynchronously. In other words, continue in the dialplan
|
||||||
|
without waiting for the originated channel to answer.</para>
|
||||||
|
</option>
|
||||||
<option name="b" argsep="^">
|
<option name="b" argsep="^">
|
||||||
<para>Before originating the outgoing call, Gosub to the specified
|
<para>Before originating the outgoing call, Gosub to the specified
|
||||||
location using the newly created channel.</para>
|
location using the newly created channel.</para>
|
||||||
@@ -123,6 +127,7 @@ static const char app_originate[] = "Originate";
|
|||||||
enum {
|
enum {
|
||||||
OPT_PREDIAL_CALLEE = (1 << 0),
|
OPT_PREDIAL_CALLEE = (1 << 0),
|
||||||
OPT_PREDIAL_CALLER = (1 << 1),
|
OPT_PREDIAL_CALLER = (1 << 1),
|
||||||
|
OPT_ASYNC = (1 << 2),
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -133,6 +138,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
AST_APP_OPTIONS(originate_exec_options, BEGIN_OPTIONS
|
AST_APP_OPTIONS(originate_exec_options, BEGIN_OPTIONS
|
||||||
|
AST_APP_OPTION('a', OPT_ASYNC),
|
||||||
AST_APP_OPTION_ARG('b', OPT_PREDIAL_CALLEE, OPT_ARG_PREDIAL_CALLEE),
|
AST_APP_OPTION_ARG('b', OPT_PREDIAL_CALLEE, OPT_ARG_PREDIAL_CALLEE),
|
||||||
AST_APP_OPTION_ARG('B', OPT_PREDIAL_CALLER, OPT_ARG_PREDIAL_CALLER),
|
AST_APP_OPTION_ARG('B', OPT_PREDIAL_CALLER, OPT_ARG_PREDIAL_CALLER),
|
||||||
END_OPTIONS );
|
END_OPTIONS );
|
||||||
@@ -250,7 +256,8 @@ static int originate_exec(struct ast_channel *chan, const char *data)
|
|||||||
|
|
||||||
res = ast_pbx_outgoing_exten_predial(chantech, cap_slin, chandata,
|
res = ast_pbx_outgoing_exten_predial(chantech, cap_slin, chandata,
|
||||||
timeout * 1000, args.arg1, exten, priority, &outgoing_status,
|
timeout * 1000, args.arg1, exten, priority, &outgoing_status,
|
||||||
AST_OUTGOING_WAIT, NULL, NULL, NULL, NULL, NULL, 0, NULL,
|
ast_test_flag64(&opts, OPT_ASYNC) ? AST_OUTGOING_NO_WAIT : AST_OUTGOING_WAIT,
|
||||||
|
NULL, NULL, NULL, NULL, NULL, 0, NULL,
|
||||||
predial_callee);
|
predial_callee);
|
||||||
} else {
|
} else {
|
||||||
ast_debug(1, "Originating call to '%s/%s' and connecting them to %s(%s)\n",
|
ast_debug(1, "Originating call to '%s/%s' and connecting them to %s(%s)\n",
|
||||||
@@ -258,7 +265,8 @@ static int originate_exec(struct ast_channel *chan, const char *data)
|
|||||||
|
|
||||||
res = ast_pbx_outgoing_app_predial(chantech, cap_slin, chandata,
|
res = ast_pbx_outgoing_app_predial(chantech, cap_slin, chandata,
|
||||||
timeout * 1000, args.arg1, args.arg2, &outgoing_status,
|
timeout * 1000, args.arg1, args.arg2, &outgoing_status,
|
||||||
AST_OUTGOING_WAIT, NULL, NULL, NULL, NULL, NULL, NULL,
|
ast_test_flag64(&opts, OPT_ASYNC) ? AST_OUTGOING_NO_WAIT : AST_OUTGOING_WAIT,
|
||||||
|
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
predial_callee);
|
predial_callee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user