<p>Sarah Autumn has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17948">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_dahdi: allow audio to pass during call setup phase<br><br>This patch allows the user to specify channels where the audio<br>should be passed to the caller immediately, instead of waiting for<br>call setup to complete. This is useful for those wishing to<br>troubleshoot or otherwise interact with electromechanical switching<br>equipment, where inband audio during call setup is the expected norm.<br><br>Users can configure this setting in chan_dahdi.conf by using "hearpulsing=yes"<br>on the desired channels. Separate configuration of DAHDI system.conf is also required.<br><br>ASTERISK-29890<br><br>Change-Id: Ibcef6e21020ab6e64f16f4761ec1e0e7fce9c260<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>5 files changed, 29 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/48/17948/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 ad7a8e5..6263a3a 100644</span><br><span>--- a/channels/chan_dahdi.c</span><br><span>+++ b/channels/chan_dahdi.c</span><br><span>@@ -963,6 +963,7 @@</span><br><span> .use_callerid = 1,</span><br><span> .sig = -1,</span><br><span> .outsigmod = -1,</span><br><span style="color: hsl(120, 100%, 40%);">+ .hearpulsing = 0,</span><br><span> </span><br><span> .cid_rxgain = +5.0,</span><br><span> </span><br><span>@@ -12660,6 +12661,7 @@</span><br><span> tmp->dahditrcallerid = conf->chan.dahditrcallerid;</span><br><span> tmp->restrictcid = conf->chan.restrictcid;</span><br><span> tmp->use_callingpres = conf->chan.use_callingpres;</span><br><span style="color: hsl(120, 100%, 40%);">+ tmp->hearpulsing = conf->chan.hearpulsing;</span><br><span> if (tmp->usedistinctiveringdetection) {</span><br><span> if (!tmp->use_callerid) {</span><br><span> ast_log(LOG_NOTICE, "Distinctive Ring detect requires 'usecallerid' be on\n");</span><br><span>@@ -12810,6 +12812,7 @@</span><br><span> tmp->ani_info_digits = conf->chan.ani_info_digits;</span><br><span> tmp->ani_wink_time = conf->chan.ani_wink_time;</span><br><span> tmp->ani_timeout = conf->chan.ani_timeout;</span><br><span style="color: hsl(120, 100%, 40%);">+ tmp->hearpulsing = conf->chan.hearpulsing;</span><br><span> tmp->hanguponpolarityswitch = conf->chan.hanguponpolarityswitch;</span><br><span> tmp->sendcalleridafter = conf->chan.sendcalleridafter;</span><br><span> ast_cc_copy_config_params(tmp->cc_params, conf->chan.cc_params);</span><br><span>@@ -12918,6 +12921,7 @@</span><br><span> analog_p->ani_info_digits = conf->chan.ani_info_digits;</span><br><span> analog_p->ani_timeout = conf->chan.ani_timeout;</span><br><span> analog_p->ani_wink_time = conf->chan.ani_wink_time;</span><br><span style="color: hsl(120, 100%, 40%);">+ analog_p->hearpulsing = conf->chan.hearpulsing;</span><br><span> analog_p->hanguponpolarityswitch = conf->chan.hanguponpolarityswitch;</span><br><span> analog_p->permcallwaiting = conf->chan.callwaiting; /* permcallwaiting possibly modified in analog_config_complete */</span><br><span> analog_p->callreturn = conf->chan.callreturn;</span><br><span>@@ -18221,6 +18225,8 @@</span><br><span> confp->chan.hanguponpolarityswitch = ast_true(v->value);</span><br><span> } else if (!strcasecmp(v->name, "sendcalleridafter")) {</span><br><span> confp->chan.sendcalleridafter = atoi(v->value);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if(!strcasecmp(v->name, "hearpulsing")) {</span><br><span style="color: hsl(120, 100%, 40%);">+ confp->chan.hearpulsing = ast_true(v->value);</span><br><span> } else if (!strcasecmp(v->name, "mwimonitornotify")) {</span><br><span> ast_copy_string(mwimonitornotify, v->value, sizeof(mwimonitornotify));</span><br><span> } else if (ast_cc_is_config_param(v->name)) {</span><br><span>diff --git a/channels/chan_dahdi.h b/channels/chan_dahdi.h</span><br><span>index de813f2..fe321b5 100644</span><br><span>--- a/channels/chan_dahdi.h</span><br><span>+++ b/channels/chan_dahdi.h</span><br><span>@@ -441,6 +441,11 @@</span><br><span> struct sig_pri_span *pri;</span><br><span> int logicalspan;</span><br><span> #endif /* defined(HAVE_PRI) */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /*!\brief TRUE if the caller should hear signaling on analog</span><br><span style="color: hsl(120, 100%, 40%);">+ * \analog channels</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned int hearpulsing:0;</span><br><span> /*!</span><br><span> * \brief TRUE if SMDI (Simplified Message Desk Interface) is enabled</span><br><span> * \note Set from the "usesmdi" value read in from chan_dahdi.conf</span><br><span>diff --git a/channels/sig_analog.c b/channels/sig_analog.c</span><br><span>index 64f1114..415e701 100644</span><br><span>--- a/channels/sig_analog.c</span><br><span>+++ b/channels/sig_analog.c</span><br><span>@@ -1243,6 +1243,12 @@</span><br><span> ast_debug(1, "not yet implemented\n");</span><br><span> return -1;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (p->hearpulsing == 1) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(3, "Enqueueing progress frame when dialling has begun in chan %d\n", p->channel);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_queue_control(p->owner, AST_CONTROL_PROGRESS);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span>diff --git a/channels/sig_analog.h b/channels/sig_analog.h</span><br><span>index 488be36..768a197 100644</span><br><span>--- a/channels/sig_analog.h</span><br><span>+++ b/channels/sig_analog.h</span><br><span>@@ -304,6 +304,11 @@</span><br><span> /*! \brief The SMDI interface to get SMDI messages from. */</span><br><span> struct ast_smdi_interface *smdi_iface;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /*!\brief TRUE if the caller should hear signaling on analog</span><br><span style="color: hsl(120, 100%, 40%);">+ * \analog channels</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned int hearpulsing:0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Not used for anything but log messages. Could be just the TCID */</span><br><span> int channel; /*!< Channel Number */</span><br><span> </span><br><span>diff --git a/configs/samples/chan_dahdi.conf.sample b/configs/samples/chan_dahdi.conf.sample</span><br><span>index 5c3af43..6df3632 100644</span><br><span>--- a/configs/samples/chan_dahdi.conf.sample</span><br><span>+++ b/configs/samples/chan_dahdi.conf.sample</span><br><span>@@ -629,6 +629,13 @@</span><br><span> ;</span><br><span> ;dialtone_detect=no</span><br><span> ;</span><br><span style="color: hsl(120, 100%, 40%);">+; Select yes to enable early-audio cut through on analog channels.</span><br><span style="color: hsl(120, 100%, 40%);">+; This is useful for working with analog or electromechanical switches</span><br><span style="color: hsl(120, 100%, 40%);">+; where the signalling would normally be audible.</span><br><span style="color: hsl(120, 100%, 40%);">+;</span><br><span style="color: hsl(120, 100%, 40%);">+;hearpulsing=no</span><br><span style="color: hsl(120, 100%, 40%);">+;</span><br><span style="color: hsl(120, 100%, 40%);">+;</span><br><span> ; The following option enables receiving MWI on FXO lines. The default</span><br><span> ; value is no.</span><br><span> ; The mwimonitor can take the following values</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17948">change 17948</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/+/17948"/><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: Ibcef6e21020ab6e64f16f4761ec1e0e7fce9c260 </div>
<div style="display:none"> Gerrit-Change-Number: 17948 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sarah Autumn <sarah@endlesstemple.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>