<p>Michael Bradeen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19798">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_directory: add skip call option<br><br>Adds 's' option to skip calling the extension and instead set the<br>extension as DIRECTORY_EXTEN channel variable.<br><br>ASTERISK-30405<br><br>Change-Id: Ib9d9db1ba5b7524594c640461b4aa8f752db8299<br>---<br>M apps/app_directory.c<br>1 file changed, 29 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/98/19798/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_directory.c b/apps/app_directory.c</span><br><span>index 36da702..8ed48d9 100644</span><br><span>--- a/apps/app_directory.c</span><br><span>+++ b/apps/app_directory.c</span><br><span>@@ -103,6 +103,9 @@</span><br><span>                                            receiver to their ear while entering DTMF.</para></span><br><span>                                              <argument name="n" required="true" /></span><br><span>                                      </option></span><br><span style="color: hsl(120, 100%, 40%);">+                                       <option name="s"></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>Skip calling the extension, intead set it in the DIRECTORY_EXTEN channel variable.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                   </option></span><br><span>                              </optionlist></span><br><span>                          <note><para>Only one of the <replaceable>f</replaceable>, <replaceable>l</replaceable>, or <replaceable>b</replaceable></span><br><span>                              options may be specified. <emphasis>If more than one is specified</emphasis>, then Directory will act as</span><br><span>@@ -132,6 +135,13 @@</span><br><span>                                  <value name="FAILED">The application failed</value></span><br><span>                            </variable></span><br><span>                    </variablelist></span><br><span style="color: hsl(120, 100%, 40%);">+                 <para>If the skip calling option is set, this application will also set the following</span><br><span style="color: hsl(120, 100%, 40%);">+                   channel variable, provided an extension is selected:</para></span><br><span style="color: hsl(120, 100%, 40%);">+                     <variablelist></span><br><span style="color: hsl(120, 100%, 40%);">+                          <variable name="DIRECTORY_EXTEN"></span><br><span style="color: hsl(120, 100%, 40%);">+                                     <para>Extension selected.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                          </variable></span><br><span style="color: hsl(120, 100%, 40%);">+                     </variablelist></span><br><span>                </description></span><br><span>         </application></span><br><span> </span><br><span>@@ -153,6 +163,7 @@</span><br><span>       OPT_PAUSE =           (1 << 5),</span><br><span>        OPT_NOANSWER =        (1 << 6),</span><br><span>        OPT_ALIAS =           (1 << 7),</span><br><span style="color: hsl(120, 100%, 40%);">+ OPT_SKIP =            (1 << 8),</span><br><span> };</span><br><span> </span><br><span> enum {</span><br><span>@@ -183,6 +194,7 @@</span><br><span>      AST_APP_OPTION('m', OPT_SELECTFROMMENU),</span><br><span>     AST_APP_OPTION('n', OPT_NOANSWER),</span><br><span>   AST_APP_OPTION('a', OPT_ALIAS),</span><br><span style="color: hsl(120, 100%, 40%);">+       AST_APP_OPTION('s', OPT_SKIP),</span><br><span> });</span><br><span> </span><br><span> static int compare(const char *text, const char *template)</span><br><span>@@ -318,6 +330,9 @@</span><br><span>        if (ast_test_flag(flags, OPT_FROMVOICEMAIL)) {</span><br><span>               /* We still want to set the exten though */</span><br><span>          ast_channel_exten_set(chan, item->exten);</span><br><span style="color: hsl(120, 100%, 40%);">+  } else if (ast_test_flag(flags, OPT_SKIP)) {</span><br><span style="color: hsl(120, 100%, 40%);">+          /* Skip calling the extension, only set it in the channel variable. */</span><br><span style="color: hsl(120, 100%, 40%);">+                pbx_builtin_setvar_helper(chan, "DIRECTORY_EXTEN", item->exten);</span><br><span>        } else if (ast_goto_if_exists(chan, S_OR(dialcontext, item->context), item->exten, 1)) {</span><br><span>               ast_log(LOG_WARNING,</span><br><span>                         "Can't find extension '%s' in context '%s'.  "</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19798">change 19798</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/+/19798"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: Ib9d9db1ba5b7524594c640461b4aa8f752db8299 </div>
<div style="display:none"> Gerrit-Change-Number: 19798 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>