<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16416">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Benjamin Keith Ford: Looks good to me, but someone else must approve
Friendly Automation: Approved for Submit
</div><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>A doc/CHANGES-staging/app_voicemail.txt<br>2 files changed, 23 insertions(+), 3 deletions(-)<br><br></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 9e0e74d..43aa5dd 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -182,6 +182,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>@@ -671,7 +676,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>@@ -691,6 +697,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>@@ -6886,8 +6893,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>@@ -12400,7 +12413,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>diff --git a/doc/CHANGES-staging/app_voicemail.txt b/doc/CHANGES-staging/app_voicemail.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..c52d1f0</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_voicemail.txt</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_voicemail</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Add a new 'S' option to VoiceMail which prevents the instructions</span><br><span style="color: hsl(120, 100%, 40%);">+(vm-intro) from being played if a busy/unavailable/temporary greeting</span><br><span style="color: hsl(120, 100%, 40%);">+from the voicemail user is played. This is similar to the existing 's'</span><br><span style="color: hsl(120, 100%, 40%);">+option except that instructions will still be played if no user</span><br><span style="color: hsl(120, 100%, 40%);">+greeting is available.</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16416">change 16416</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/+/16416"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I03f2f043a9beb9d99deab302247e2a8686066fb4 </div>
<div style="display:none"> Gerrit-Change-Number: 16416 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>