<p>Friendly Automation <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12859">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up<br><br>When the remote ISDN party ends an ISDN call on a PRI link<br>(DISCONNECT), CHANNEL(hangupsource) information is not available.<br><br>chan_dahdi already contains an ast_set_hangupsource() in<br>__dahdi_exception() function but it seems that ISDN message processing<br>does not use this part of code.<br><br>Two other channel modules associate ast_queue_hangup() and<br>ast_set_hangupsource() functions calls:<br>- chan_pjsip in chan_pjsip_session_end() function,<br>- chan_sip in sip_queue_hangup_cause() function.<br>chan_iax2 separates them, in iax2_queue_hangup()/iax2_destroy() and<br>set_hangup_source_and_cause().<br><br>Thus, I propose to add ast_set_hangupsource() beside<br>ast_queue_hangup() in sig_pri_queue_hangup(), like chan_pjsip and<br>chan_sip already do.<br><br>ASTERISK-28525<br><br>Change-Id: I0f588a4bcf15ccd0648fd69830d1b801c3f21b7c<br>---<br>M channels/sig_pri.c<br>1 file changed, 14 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/sig_pri.c b/channels/sig_pri.c</span><br><span>index a8c042f..82048b3 100644</span><br><span>--- a/channels/sig_pri.c</span><br><span>+++ b/channels/sig_pri.c</span><br><span>@@ -1391,14 +1391,25 @@</span><br><span> */</span><br><span> static void sig_pri_queue_hangup(struct sig_pri_span *pri, int chanpos)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_channel *owner;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if (sig_pri_callbacks.queue_control) {</span><br><span> sig_pri_callbacks.queue_control(pri->pvts[chanpos]->chan_pvt, AST_CONTROL_HANGUP);</span><br><span> }</span><br><span> </span><br><span> sig_pri_lock_owner(pri, chanpos);</span><br><span style="color: hsl(0, 100%, 40%);">- if (pri->pvts[chanpos]->owner) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_queue_hangup(pri->pvts[chanpos]->owner);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_channel_unlock(pri->pvts[chanpos]->owner);</span><br><span style="color: hsl(120, 100%, 40%);">+ owner = pri->pvts[chanpos]->owner;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (owner) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_ref(owner, +1);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_queue_hangup(owner);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_unlock(owner);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Tell the CDR this DAHDI channel hung up */</span><br><span style="color: hsl(120, 100%, 40%);">+ sig_pri_unlock_private(pri->pvts[chanpos]);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_set_hangupsource(owner, ast_channel_name(owner), 0);</span><br><span style="color: hsl(120, 100%, 40%);">+ sig_pri_lock_private(pri->pvts[chanpos]);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_ref(owner, -1);</span><br><span> }</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12859">change 12859</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/+/12859"/><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: I0f588a4bcf15ccd0648fd69830d1b801c3f21b7c </div>
<div style="display:none"> Gerrit-Change-Number: 12859 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Frederic LE FOLL <frederic.lefoll@c-s.fr> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>