<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16442">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail.c: Ability to silence instructions if greeting is present.<br><br>There is an option to silence voicemail instructions but it does not<br>take into consideration if a recorded greeting exists or not. Add a<br>new 'S' option that does that.<br><br>ASTERISK-29632 #close<br><br>Change-Id: I03f2f043a9beb9d99deab302247e2a8686066fb4<br>---<br>M apps/app_voicemail.c<br>1 file changed, 16 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/42/16442/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index db531e9..cb70ed6 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -149,6 +149,11 @@</span><br><span>                                           <para>Skip the playback of instructions for leaving a message to the</span><br><span>                                           calling party.</para></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 the playback of instructions for leaving a message to the</span><br><span style="color: hsl(120, 100%, 40%);">+                                            calling party, but only if a greeting has been recorded by the</span><br><span style="color: hsl(120, 100%, 40%);">+                                                mailbox user.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                    </option></span><br><span>                                      <option name="t"></span><br><span>                                            <argument name="x" required="false" /></span><br><span>                                             <para>Play a custom beep tone to the caller instead of the default one.</span><br><span>@@ -588,7 +593,8 @@</span><br><span>  OPT_MESSAGE_Urgent =   (1 << 8),</span><br><span>       OPT_MESSAGE_PRIORITY = (1 << 9),</span><br><span>       OPT_EARLYM_GREETING =  (1 << 10),</span><br><span style="color: hsl(0, 100%, 40%);">- OPT_BEEP =             (1 << 11)</span><br><span style="color: hsl(120, 100%, 40%);">+        OPT_BEEP =             (1 << 11),</span><br><span style="color: hsl(120, 100%, 40%);">+       OPT_SILENT_IF_GREET =  (1 << 12),</span><br><span> };</span><br><span> </span><br><span> enum vm_option_args {</span><br><span>@@ -608,6 +614,7 @@</span><br><span> </span><br><span> AST_APP_OPTIONS(vm_app_options, {</span><br><span>    AST_APP_OPTION('s', OPT_SILENT),</span><br><span style="color: hsl(120, 100%, 40%);">+      AST_APP_OPTION('S', OPT_SILENT_IF_GREET),</span><br><span>    AST_APP_OPTION('b', OPT_BUSY_GREETING),</span><br><span>      AST_APP_OPTION('u', OPT_UNAVAIL_GREETING),</span><br><span>   AST_APP_OPTION_ARG('g', OPT_RECORDGAIN, OPT_ARG_RECORDGAIN),</span><br><span>@@ -6781,8 +6788,14 @@</span><br><span> #endif</span><br><span>                      RETRIEVE(prefile, -1, ext, context);</span><br><span>                 if (ast_fileexists(prefile, NULL, NULL) > 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1)</span><br><span style="color: hsl(120, 100%, 40%);">+                        if (ast_streamfile(chan, prefile, ast_channel_language(chan)) > -1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                              /* We know we have a greeting at this point, so squelch the instructions</span><br><span style="color: hsl(120, 100%, 40%);">+                               * if that is what is being asked of us */</span><br><span style="color: hsl(120, 100%, 40%);">+                            if (ast_test_flag(options, OPT_SILENT_IF_GREET)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                    ast_set_flag(options, OPT_SILENT);</span><br><span style="color: hsl(120, 100%, 40%);">+                            }</span><br><span>                            res = ast_waitstream(chan, ecodes);</span><br><span style="color: hsl(120, 100%, 40%);">+                   }</span><br><span> #ifdef ODBC_STORAGE</span><br><span>                     if (success == -1) {</span><br><span>                                 /* We couldn't retrieve the file from the database, but we found it on the file system. Let's put it in the database. */</span><br><span>@@ -12295,7 +12308,7 @@</span><br><span>           if (args.argc == 2) {</span><br><span>                        if (ast_app_parse_options(vm_app_options, &flags, opts, args.argv1))</span><br><span>                             return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                      ast_copy_flags(&leave_options, &flags, OPT_SILENT | OPT_BUSY_GREETING | OPT_UNAVAIL_GREETING | OPT_MESSAGE_Urgent | OPT_MESSAGE_PRIORITY | OPT_DTMFEXIT);</span><br><span style="color: hsl(120, 100%, 40%);">+                     ast_copy_flags(&leave_options, &flags, OPT_SILENT | OPT_SILENT_IF_GREET | OPT_BUSY_GREETING | OPT_UNAVAIL_GREETING | OPT_MESSAGE_Urgent | OPT_MESSAGE_PRIORITY | OPT_DTMFEXIT);</span><br><span>                      if (ast_test_flag(&flags, OPT_RECORDGAIN)) {</span><br><span>                             int gain;</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16442">change 16442</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/+/16442"/><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: I03f2f043a9beb9d99deab302247e2a8686066fb4 </div>
<div style="display:none"> Gerrit-Change-Number: 16442 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>