[Asterisk-code-review] chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up (...asterisk[16])

Frederic LE FOLL asteriskteam at digium.com
Thu Sep 5 10:52:45 CDT 2019


Frederic LE FOLL has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/12846


Change subject: chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up
......................................................................

chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up

When the remote ISDN party ends an ISDN call on a PRI link
(DISCONNECT), CHANNEL(hangupsource) information is not available.

chan_dahdi already contains an ast_set_hangupsource() in
__dahdi_exception() function but it seems that ISDN message processing
does not use this part of code.

Two other channel modules associate ast_queue_hangup() and
ast_set_hangupsource() functions calls:
- chan_pjsip in chan_pjsip_session_end() function,
- chan_sip in sip_queue_hangup_cause() function.
chan_iax2 separates them, in iax2_queue_hangup()/iax2_destroy() and
set_hangup_source_and_cause().

Thus, I propose to include to add ast_set_hangupsource() beside
ast_queue_hangup() in sig_pri_queue_hangup(), like chan_pjsip and
chan_sip already do.

ASTERISK-28525

Change-Id: I0f588a4bcf15ccd0648fd69830d1b801c3f21b7c
---
M channels/sig_pri.c
1 file changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/46/12846/1

diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index 102e3c4..591e03a 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -1400,6 +1400,11 @@
 		ast_queue_hangup(pri->pvts[chanpos]->owner);
 		ast_channel_unlock(pri->pvts[chanpos]->owner);
 	}
+
+	/* Tell the CDR this DAHDI channel hung up */
+	if(pri->pvts[chanpos]->owner) {
+		ast_set_hangupsource(pri->pvts[chanpos]->owner, ast_channel_name(pri->pvts[chanpos]->owner), 0);
+	}
 }
 
 /*!

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12846
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I0f588a4bcf15ccd0648fd69830d1b801c3f21b7c
Gerrit-Change-Number: 12846
Gerrit-PatchSet: 1
Gerrit-Owner: Frederic LE FOLL <frederic.lefoll at c-s.fr>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190905/458f166c/attachment.html>


More information about the asterisk-code-review mailing list