<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19873">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, 27 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/73/19873/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 a84b374..b4de22c 100644</span><br><span>--- a/apps/app_directory.c</span><br><span>+++ b/apps/app_directory.c</span><br><span>@@ -107,6 +107,9 @@</span><br><span>                                               <para>Load the specified config file instead of voicemail.conf</para></span><br><span>                                            <argument name="filename" 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>@@ -123,7 +126,7 @@</span><br><span>                   received and the extension to jump to exists:</para></span><br><span>                   <para><literal>0</literal> - Jump to the 'o' extension, if it exists.</para></span><br><span>                         <para><literal>*</literal> - Jump to the 'a' extension, if it exists.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                    <para>This application will set the following channel variable before completion:</para></span><br><span style="color: hsl(120, 100%, 40%);">+                  <para>This application will set the following channel variables before completion:</para></span><br><span>                        <variablelist></span><br><span>                                 <variable name="DIRECTORY_RESULT"></span><br><span>                                   <para>Reason Directory application exited.</para></span><br><span>@@ -135,6 +138,10 @@</span><br><span>                                         <value name="USEREXIT">User exited with '#' during selection</value></span><br><span>                                   <value name="FAILED">The application failed</value></span><br><span>                            </variable></span><br><span style="color: hsl(120, 100%, 40%);">+                             <variable name="DIRECTORY_EXTEN"></span><br><span style="color: hsl(120, 100%, 40%);">+                                     <para>If the skip calling option is set this will be set to the selected extension</span><br><span style="color: hsl(120, 100%, 40%);">+                                      provided one is selected.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                </variable></span><br><span>                    </variablelist></span><br><span>                </description></span><br><span>         </application></span><br><span>@@ -158,6 +165,7 @@</span><br><span>   OPT_NOANSWER =        (1 << 6),</span><br><span>        OPT_ALIAS =           (1 << 7),</span><br><span>        OPT_CONFIG_FILE =     (1 << 8),</span><br><span style="color: hsl(120, 100%, 40%);">+ OPT_SKIP =            (1 << 9),</span><br><span> };</span><br><span> </span><br><span> enum {</span><br><span>@@ -190,6 +198,7 @@</span><br><span>      AST_APP_OPTION('n', OPT_NOANSWER),</span><br><span>   AST_APP_OPTION('a', OPT_ALIAS),</span><br><span>      AST_APP_OPTION_ARG('c', OPT_CONFIG_FILE, OPT_ARG_FILENAME),</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>@@ -323,6 +332,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/+/19873">change 19873</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/+/19873"/><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-Change-Id: Ib9d9db1ba5b7524594c640461b4aa8f752db8299 </div>
<div style="display:none"> Gerrit-Change-Number: 19873 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-CC: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>