<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18279">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: Add music on hold option to Queue.<br><br>Adds the m option to the Queue application, which allows a<br>music on hold class to be specified at runtime which will<br>override the class configured in queues.conf.<br><br>This option functions like the m option to Dial.<br><br>ASTERISK-29876 #close<br><br>Change-Id: Ie25a48569cf8755c305c9438b1ed292c3adcf8d7<br>---<br>M apps/app_queue.c<br>M configs/samples/queues.conf.sample<br>A doc/CHANGES-staging/app_queue_music.txt<br>3 files changed, 32 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/79/18279/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_queue.c b/apps/app_queue.c</span><br><span>index 3505413..a54f524 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -185,10 +185,6 @@</span><br><span>                                        <option name="H"></span><br><span>                                            <para>Allow <emphasis>caller</emphasis> to hang up by pressing <literal>*</literal>.</para></span><br><span>                                      </option></span><br><span style="color: hsl(0, 100%, 40%);">-                                 <option name="n"></span><br><span style="color: hsl(0, 100%, 40%);">-                                               <para>No retries on the timeout; will exit this application and</span><br><span style="color: hsl(0, 100%, 40%);">-                                           go to the next step.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                       </option></span><br><span>                                      <option name="i"></span><br><span>                                            <para>Ignore call forward requests from queue members and do nothing</span><br><span>                                           when they are requested.</para></span><br><span>@@ -197,6 +193,23 @@</span><br><span>                                                 <para>Asterisk will ignore any connected line update requests or any redirecting party</span><br><span>                                                 update requests it may receive on this dial attempt.</para></span><br><span>                                    </option></span><br><span style="color: hsl(120, 100%, 40%);">+                                       <option name="k"></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>Allow the <emphasis>called</emphasis> party to enable parking of the call by sending</span><br><span style="color: hsl(120, 100%, 40%);">+                                          the DTMF sequence defined for call parking in <filename>features.conf</filename>.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                    </option></span><br><span style="color: hsl(120, 100%, 40%);">+                                       <option name="K"></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>Allow the <emphasis>calling</emphasis> party to enable parking of the call by sending</span><br><span style="color: hsl(120, 100%, 40%);">+                                         the DTMF sequence defined for call parking in <filename>features.conf</filename>.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                    </option></span><br><span style="color: hsl(120, 100%, 40%);">+                                       <option name="m"></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>Custom music on hold class to use, which will override the</span><br><span style="color: hsl(120, 100%, 40%);">+                                                music on hold class configured in <filename>queues.conf</filename>,</span><br><span style="color: hsl(120, 100%, 40%);">+                                               if specified.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                    </option></span><br><span style="color: hsl(120, 100%, 40%);">+                                       <option name="n"></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>No retries on the timeout; will exit this application and</span><br><span style="color: hsl(120, 100%, 40%);">+                                         go to the next step.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                     </option></span><br><span>                                      <option name="r"></span><br><span>                                            <para>Ring instead of playing MOH. Periodic Announcements are still made, if applicable.</para></span><br><span>                                  </option></span><br><span>@@ -217,14 +230,6 @@</span><br><span>                                               <para>Allow the <emphasis>calling</emphasis> user to write the conversation to</span><br><span>                                             disk via Monitor.</para></span><br><span>                                       </option></span><br><span style="color: hsl(0, 100%, 40%);">-                                 <option name="k"></span><br><span style="color: hsl(0, 100%, 40%);">-                                               <para>Allow the <emphasis>called</emphasis> party to enable parking of the call by sending</span><br><span style="color: hsl(0, 100%, 40%);">-                                            the DTMF sequence defined for call parking in <filename>features.conf</filename>.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                      </option></span><br><span style="color: hsl(0, 100%, 40%);">-                                 <option name="K"></span><br><span style="color: hsl(0, 100%, 40%);">-                                               <para>Allow the <emphasis>calling</emphasis> party to enable parking of the call by sending</span><br><span style="color: hsl(0, 100%, 40%);">-                                           the DTMF sequence defined for call parking in <filename>features.conf</filename>.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                      </option></span><br><span>                                      <option name="x"></span><br><span>                                            <para>Allow the <emphasis>called</emphasis> user to write the conversation</span><br><span>                                                 to disk via MixMonitor.</para></span><br><span>@@ -1468,12 +1473,14 @@</span><br><span>       OPT_CALLER_AUTOMON =         (1 << 18),</span><br><span>        OPT_PREDIAL_CALLEE =         (1 << 19),</span><br><span>        OPT_PREDIAL_CALLER =         (1 << 20),</span><br><span style="color: hsl(120, 100%, 40%);">+ OPT_MUSICONHOLD_CLASS =      (1 << 21),</span><br><span> };</span><br><span> </span><br><span> enum {</span><br><span>    OPT_ARG_CALLEE_GO_ON = 0,</span><br><span>    OPT_ARG_PREDIAL_CALLEE,</span><br><span>      OPT_ARG_PREDIAL_CALLER,</span><br><span style="color: hsl(120, 100%, 40%);">+       OPT_ARG_MUSICONHOLD_CLASS,</span><br><span>   /* note: this entry _MUST_ be the last one in the enum */</span><br><span>    OPT_ARG_ARRAY_SIZE</span><br><span> };</span><br><span>@@ -1491,6 +1498,7 @@</span><br><span>     AST_APP_OPTION('I', OPT_IGNORE_CONNECTEDLINE),</span><br><span>       AST_APP_OPTION('k', OPT_CALLEE_PARK),</span><br><span>        AST_APP_OPTION('K', OPT_CALLER_PARK),</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_APP_OPTION_ARG('m', OPT_MUSICONHOLD_CLASS, OPT_ARG_MUSICONHOLD_CLASS),</span><br><span>   AST_APP_OPTION('n', OPT_NO_RETRY),</span><br><span>   AST_APP_OPTION('r', OPT_RINGING),</span><br><span>    AST_APP_OPTION('R', OPT_RING_WHEN_RINGING),</span><br><span>@@ -8625,6 +8633,12 @@</span><br><span>                 ast_app_exec_sub(NULL, chan, opt_args[OPT_ARG_PREDIAL_CALLER], 0);</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Music on hold class override */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (ast_test_flag(&opts, OPT_MUSICONHOLD_CLASS)</span><br><span style="color: hsl(120, 100%, 40%);">+           && !ast_strlen_zero(opt_args[OPT_ARG_MUSICONHOLD_CLASS])) {</span><br><span style="color: hsl(120, 100%, 40%);">+           ast_copy_string(qe.moh, opt_args[OPT_ARG_MUSICONHOLD_CLASS], sizeof(qe.moh));</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  copy_rules(&qe, args.rule);</span><br><span>      qe.pr = AST_LIST_FIRST(&qe.qe_rules);</span><br><span> check_turns:</span><br><span>diff --git a/configs/samples/queues.conf.sample b/configs/samples/queues.conf.sample</span><br><span>index aa7e03d..0a1a64e 100644</span><br><span>--- a/configs/samples/queues.conf.sample</span><br><span>+++ b/configs/samples/queues.conf.sample</span><br><span>@@ -64,6 +64,7 @@</span><br><span> ;</span><br><span> ; Musicclass sets which music applies for this particular call queue.</span><br><span> ; The only class which can override this one is if the MOH class is set</span><br><span style="color: hsl(120, 100%, 40%);">+; using the m option when calling the Queue application or if set</span><br><span> ; directly on the channel using Set(CHANNEL(musicclass)=whatever) in the</span><br><span> ; dialplan.</span><br><span> ;</span><br><span>diff --git a/doc/CHANGES-staging/app_queue_music.txt b/doc/CHANGES-staging/app_queue_music.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..254a45d</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_queue_music.txt</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_queue</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The m option now allows an override music on hold</span><br><span style="color: hsl(120, 100%, 40%);">+class to be specified for the Queue application</span><br><span style="color: hsl(120, 100%, 40%);">+within the dialplan.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18279">change 18279</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/+/18279"/><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: Ie25a48569cf8755c305c9438b1ed292c3adcf8d7 </div>
<div style="display:none"> Gerrit-Change-Number: 18279 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>