<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19584">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pbx_builtins: Allow Answer to return immediately.<br><br>The Answer application currently waits for up to 500ms<br>for media, even if users specify a different timeout.<br><br>This adds an option to not wait for media on the channel<br>by doing a raw answer instead. The default 500ms threshold<br>is also documented.<br><br>ASTERISK-30308 #close<br><br>Change-Id: Id59cd340c44b8b8b2384c479e17e5123e917cba4<br>---<br>A doc/CHANGES-staging/answer.txt<br>M main/pbx_builtins.c<br>2 files changed, 40 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/84/19584/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/doc/CHANGES-staging/answer.txt b/doc/CHANGES-staging/answer.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..7e04701</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/answer.txt</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: pbx_builtins</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+It is now possible to not wait for media on</span><br><span style="color: hsl(120, 100%, 40%);">+a channel when answering it using Answer,</span><br><span style="color: hsl(120, 100%, 40%);">+by specifying the i option.</span><br><span>diff --git a/main/pbx_builtins.c b/main/pbx_builtins.c</span><br><span>index 7ef4d03..fa6e63d 100644</span><br><span>--- a/main/pbx_builtins.c</span><br><span>+++ b/main/pbx_builtins.c</span><br><span>@@ -49,11 +49,23 @@</span><br><span>                      <parameter name="delay"></span><br><span>                             <para>Asterisk will wait this number of milliseconds before returning to</span><br><span>                               the dialplan after answering the call.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                           <para>The minimum is 500 ms. To answer immediately without waiting for media,</span><br><span style="color: hsl(120, 100%, 40%);">+                           use the i option.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                        </parameter></span><br><span style="color: hsl(120, 100%, 40%);">+                    <parameter name="options"></span><br><span style="color: hsl(120, 100%, 40%);">+                            <optionlist></span><br><span style="color: hsl(120, 100%, 40%);">+                                    <option name="i"></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>Answer the channel immediately without waiting for media.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                    </option></span><br><span style="color: hsl(120, 100%, 40%);">+                               </optionlist></span><br><span>                  </parameter></span><br><span>           </syntax></span><br><span>              <description></span><br><span>                  <para>If the call has not been answered, this application will</span><br><span>                         answer it. Otherwise, it has no effect on the call.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                      <para>By default, Asterisk will wait for media for up to 500 ms, or</span><br><span style="color: hsl(120, 100%, 40%);">+                     the user specified delay, whichever is longer. If you do not want</span><br><span style="color: hsl(120, 100%, 40%);">+                     to wait for media at all, use the i option.</para></span><br><span>             </description></span><br><span>                 <see-also></span><br><span>                     <ref type="application">Hangup</ref></span><br><span>@@ -836,6 +848,11 @@</span><br><span>            delay = 0;</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_strlen_zero(args.answer_cdr) && !strcmp(args.answer_cdr, "i")) {</span><br><span style="color: hsl(120, 100%, 40%);">+           /*! \todo We will remove the nocdr stuff for 21 entirely, as part of another review. */</span><br><span style="color: hsl(120, 100%, 40%);">+               return ast_raw_answer(chan);</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (!ast_strlen_zero(args.answer_cdr) && !strcasecmp(args.answer_cdr, "nocdr")) {</span><br><span>          ast_log(AST_LOG_WARNING, "The nocdr option for the Answer application has been removed and is no longer supported.\n");</span><br><span>    }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19584">change 19584</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/19584"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: Id59cd340c44b8b8b2384c479e17e5123e917cba4 </div>
<div style="display:none"> Gerrit-Change-Number: 19584 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>