<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8623">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_originate: Add async option.<br><br>Add an option to make app_originate not wait for the created channel<br>to answer.<br><br>Change-Id: I7fc2facd77079abc6321f44e8bcd4e39298de2ae<br>Requested-by: Frederic Steinfels <fst@highdefinition.ch><br>Signed-off-by: Russell Bryant <russell@russellbryant.net><br>---<br>M CHANGES<br>M apps/app_originate.c<br>2 files changed, 17 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/CHANGES b/CHANGES<br>index 09a7659..ac50a6d 100644<br>--- a/CHANGES<br>+++ b/CHANGES<br>@@ -17,6 +17,13 @@<br> * The app_fax module is now deprecated, users should migrate to the<br> replacement module res_fax.<br> <br>+app_originate<br>+------------------<br>+ * An 'a' option has been added to the Originate dialplan application which<br>+ will execute the originate in an asynchronous fashion. If set then the<br>+ application will return immediately without waiting for the originated<br>+ channel to answer.<br>+<br> Build System<br> ------------------<br> * MALLOC_DEBUG no longer has an effect on Asterisk's ABI. Asterisk built<br>diff --git a/apps/app_originate.c b/apps/app_originate.c<br>index 30fa565..107be84 100644<br>--- a/apps/app_originate.c<br>+++ b/apps/app_originate.c<br>@@ -74,6 +74,10 @@<br> </parameter><br> <parameter name="options" required="false"><br> <optionlist><br>+ <option name="a"><br>+ <para>Originate asynchronously. In other words, continue in the dialplan<br>+ without waiting for the originated channel to answer.</para><br>+ </option><br> <option name="b" argsep="^"><br> <para>Before originating the outgoing call, Gosub to the specified<br> location using the newly created channel.</para><br>@@ -123,6 +127,7 @@<br> enum {<br> OPT_PREDIAL_CALLEE = (1 << 0),<br> OPT_PREDIAL_CALLER = (1 << 1),<br>+ OPT_ASYNC = (1 << 2),<br> };<br> <br> enum {<br>@@ -133,6 +138,7 @@<br> };<br> <br> AST_APP_OPTIONS(originate_exec_options, BEGIN_OPTIONS<br>+ AST_APP_OPTION('a', OPT_ASYNC),<br> AST_APP_OPTION_ARG('b', OPT_PREDIAL_CALLEE, OPT_ARG_PREDIAL_CALLEE),<br> AST_APP_OPTION_ARG('B', OPT_PREDIAL_CALLER, OPT_ARG_PREDIAL_CALLER),<br> END_OPTIONS );<br>@@ -250,7 +256,8 @@<br> <br> res = ast_pbx_outgoing_exten_predial(chantech, cap_slin, chandata,<br> timeout * 1000, args.arg1, exten, priority, &outgoing_status,<br>- AST_OUTGOING_WAIT, NULL, NULL, NULL, NULL, NULL, 0, NULL,<br>+ ast_test_flag64(&opts, OPT_ASYNC) ? AST_OUTGOING_NO_WAIT : AST_OUTGOING_WAIT,<br>+ NULL, NULL, NULL, NULL, NULL, 0, NULL,<br> predial_callee);<br> } else {<br> ast_debug(1, "Originating call to '%s/%s' and connecting them to %s(%s)\n",<br>@@ -258,7 +265,8 @@<br> <br> res = ast_pbx_outgoing_app_predial(chantech, cap_slin, chandata,<br> timeout * 1000, args.arg1, args.arg2, &outgoing_status,<br>- AST_OUTGOING_WAIT, NULL, NULL, NULL, NULL, NULL, NULL,<br>+ ast_test_flag64(&opts, OPT_ASYNC) ? AST_OUTGOING_NO_WAIT : AST_OUTGOING_WAIT,<br>+ NULL, NULL, NULL, NULL, NULL, NULL,<br> predial_callee);<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8623">change 8623</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8623"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I7fc2facd77079abc6321f44e8bcd4e39298de2ae </div>
<div style="display:none"> Gerrit-Change-Number: 8623 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Russell Bryant <russell@russellbryant.net> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Leif Madsen <leif@leifmadsen.com> </div>
<div style="display:none"> Gerrit-Reviewer: Russell Bryant <russell@russellbryant.net> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>