<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19715">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sig_analog: Allow immediate fake ring to be suppressed.<br><br>When immediate=yes on an FXS channel, sig_analog will<br>start fake audible ringback that continues until the<br>channel is answered. Even if it answers immediately,<br>the ringback is still audible for a brief moment.<br>This can be disruptive and unwanted behavior.<br><br>This adds an option to disable this behavior, though<br>the default behavior remains unchanged.<br><br>ASTERISK-30003 #close<br><br>Change-Id: Idda6e56c30e7efbb6f766366d9752e78f4da3167<br>---<br>M channels/chan_dahdi.c<br>M channels/chan_dahdi.h<br>M channels/sig_analog.c<br>M channels/sig_analog.h<br>M configs/samples/chan_dahdi.conf.sample<br>A doc/CHANGES-staging/chan_dahdi_immediatering.txt<br>6 files changed, 48 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/15/19715/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c</span><br><span>index 5607eb0..9b0160e 100644</span><br><span>--- a/channels/chan_dahdi.c</span><br><span>+++ b/channels/chan_dahdi.c</span><br><span>@@ -1027,6 +1027,7 @@</span><br><span> #endif</span><br><span>                .chan = {</span><br><span>                    .context = "default",</span><br><span style="color: hsl(120, 100%, 40%);">+                       .immediatering = 1,</span><br><span>                  .cid_num = "",</span><br><span>                     .cid_name = "",</span><br><span>                    .cid_tag = "",</span><br><span>@@ -12779,6 +12780,7 @@</span><br><span>           }</span><br><span> #endif</span><br><span>          tmp->immediate = conf->chan.immediate;</span><br><span style="color: hsl(120, 100%, 40%);">+          tmp->immediatering = conf->chan.immediatering;</span><br><span>                 tmp->transfertobusy = conf->chan.transfertobusy;</span><br><span>               if (chan_sig & __DAHDI_SIG_FXS) {</span><br><span>                        tmp->mwimonitor_fsk = conf->chan.mwimonitor_fsk;</span><br><span>@@ -13108,6 +13110,7 @@</span><br><span>                             analog_p->canpark = conf->chan.canpark;</span><br><span>                                analog_p->dahditrcallerid = conf->chan.dahditrcallerid;</span><br><span>                                analog_p->immediate = conf->chan.immediate;</span><br><span style="color: hsl(120, 100%, 40%);">+                             analog_p->immediatering = conf->chan.immediatering;</span><br><span>                            analog_p->permhidecallerid = conf->chan.permhidecallerid;</span><br><span>                              analog_p->pulse = conf->chan.pulse;</span><br><span>                            analog_p->threewaycalling = conf->chan.threewaycalling;</span><br><span>@@ -18312,6 +18315,8 @@</span><br><span>                      }</span><br><span>            } else if (!strcasecmp(v->name, "immediate")) {</span><br><span>                         confp->chan.immediate = ast_true(v->value);</span><br><span style="color: hsl(120, 100%, 40%);">+             } else if (!strcasecmp(v->name, "immediatering")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      confp->chan.immediatering = ast_true(v->value);</span><br><span>                } else if (!strcasecmp(v->name, "transfertobusy")) {</span><br><span>                    confp->chan.transfertobusy = ast_true(v->value);</span><br><span>               } else if (!strcasecmp(v->name, "mwimonitor")) {</span><br><span>diff --git a/channels/chan_dahdi.h b/channels/chan_dahdi.h</span><br><span>index de813f2..bc69a0c 100644</span><br><span>--- a/channels/chan_dahdi.h</span><br><span>+++ b/channels/chan_dahdi.h</span><br><span>@@ -298,6 +298,12 @@</span><br><span>         * \note Set from the "immediate" value read in from chan_dahdi.conf</span><br><span>        */</span><br><span>  unsigned int immediate:1;</span><br><span style="color: hsl(120, 100%, 40%);">+     /*!</span><br><span style="color: hsl(120, 100%, 40%);">+    * \brief TRUE if audible ringback should be provided</span><br><span style="color: hsl(120, 100%, 40%);">+  * when immediate = yes.</span><br><span style="color: hsl(120, 100%, 40%);">+       * \note Set from the "immediatering" value read in from chan_dahdi.conf</span><br><span style="color: hsl(120, 100%, 40%);">+     */</span><br><span style="color: hsl(120, 100%, 40%);">+   unsigned int immediatering:1;</span><br><span>        /*! \brief TRUE if in an alarm condition. */</span><br><span>         unsigned int inalarm:1;</span><br><span>      /*! \brief TRUE if TDD in MATE mode */</span><br><span>diff --git a/channels/sig_analog.c b/channels/sig_analog.c</span><br><span>index b694a96..cea1e71 100644</span><br><span>--- a/channels/sig_analog.c</span><br><span>+++ b/channels/sig_analog.c</span><br><span>@@ -3779,7 +3779,10 @@</span><br><span>                     if (i->immediate) {</span><br><span>                               analog_set_echocanceller(i, 1);</span><br><span>                              /* The channel is immediately up.  Start right away */</span><br><span style="color: hsl(0, 100%, 40%);">-                          res = analog_play_tone(i, ANALOG_SUB_REAL, ANALOG_TONE_RINGTONE);</span><br><span style="color: hsl(120, 100%, 40%);">+                             if (i->immediatering) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                    /* Play fake ringing, if we've been told to... */</span><br><span style="color: hsl(120, 100%, 40%);">+                                 res = analog_play_tone(i, ANALOG_SUB_REAL, ANALOG_TONE_RINGTONE);</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span>                            chan = analog_new_ast_channel(i, AST_STATE_RING, 1, ANALOG_SUB_REAL, NULL);</span><br><span>                          if (!chan) {</span><br><span>                                         ast_log(LOG_WARNING, "Unable to start PBX on channel %d\n", i->channel);</span><br><span>diff --git a/channels/sig_analog.h b/channels/sig_analog.h</span><br><span>index 7e9acda..e95474f 100644</span><br><span>--- a/channels/sig_analog.h</span><br><span>+++ b/channels/sig_analog.h</span><br><span>@@ -288,6 +288,7 @@</span><br><span>         unsigned int dahditrcallerid:1;                 /*!< should we use the callerid from incoming call on dahdi transfer or not */</span><br><span>    unsigned int hanguponpolarityswitch:1;</span><br><span>       unsigned int immediate:1;</span><br><span style="color: hsl(120, 100%, 40%);">+     unsigned int immediatering:1;                   /*!< TRUE if ringing should be provided for immediate execution */</span><br><span>        unsigned int permcallwaiting:1;                 /*!< TRUE if call waiting is enabled. (Configured option) */</span><br><span>      unsigned int permhidecallerid:1;                /*!< Whether to hide our outgoing caller ID or not */</span><br><span>     unsigned int pulse:1;</span><br><span>diff --git a/configs/samples/chan_dahdi.conf.sample b/configs/samples/chan_dahdi.conf.sample</span><br><span>index 6b29549..1ac0eca 100644</span><br><span>--- a/configs/samples/chan_dahdi.conf.sample</span><br><span>+++ b/configs/samples/chan_dahdi.conf.sample</span><br><span>@@ -948,6 +948,13 @@</span><br><span> ;</span><br><span> ;immediate=yes</span><br><span> ;</span><br><span style="color: hsl(120, 100%, 40%);">+; On FXS channels (FXO signaled), specifies whether fake audible ringback should</span><br><span style="color: hsl(120, 100%, 40%);">+; be provided as soon as the channel goes off hook and immediate=yes.</span><br><span style="color: hsl(120, 100%, 40%);">+; If audio should come only from the dialplan, this option should be disabled.</span><br><span style="color: hsl(120, 100%, 40%);">+; Default is 'yes'</span><br><span style="color: hsl(120, 100%, 40%);">+;</span><br><span style="color: hsl(120, 100%, 40%);">+;immediatering=no</span><br><span style="color: hsl(120, 100%, 40%);">+;</span><br><span> ; Specify whether flash-hook transfers to 'busy' channels should complete or</span><br><span> ; return to the caller performing the transfer (default is yes).</span><br><span> ;</span><br><span>diff --git a/doc/CHANGES-staging/chan_dahdi_immediatering.txt b/doc/CHANGES-staging/chan_dahdi_immediatering.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..fc6c640</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/chan_dahdi_immediatering.txt</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: chan_dahdi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The immediatering option can now be set to no</span><br><span style="color: hsl(120, 100%, 40%);">+to suppress the fake audible ringback provided</span><br><span style="color: hsl(120, 100%, 40%);">+when immediate=yes on FXS channels.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19715">change 19715</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/+/19715"/><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: Idda6e56c30e7efbb6f766366d9752e78f4da3167 </div>
<div style="display:none"> Gerrit-Change-Number: 19715 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>