[asterisk-commits] kmoore: branch 11 r371258 - /branches/11/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 15 12:52:57 CDT 2012


Author: kmoore
Date: Wed Aug 15 12:52:47 2012
New Revision: 371258

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=371258
Log:
Add HANGUPCAUSE information to callee channels

This adds HANGUPCAUSE information to called channels so that hangup
handlers can, in conjunction with predial dialplan execution, access
the hangupcause information when the dialed channel hangs up on a
one-to-one basis instead of a many-to-one basis as with HANGUPCAUSE
usage on the caller channel.

Review: https://reviewboard.asterisk.org/r/2069/
(closes issue ASTERISK-20198)

Modified:
    branches/11/channels/chan_dahdi.c
    branches/11/channels/chan_iax2.c
    branches/11/channels/chan_sip.c
    branches/11/channels/sig_analog.c
    branches/11/channels/sig_pri.c
    branches/11/channels/sig_ss7.c

Modified: branches/11/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_dahdi.c?view=diff&rev=371258&r1=371257&r2=371258
==============================================================================
--- branches/11/channels/chan_dahdi.c (original)
+++ branches/11/channels/chan_dahdi.c Wed Aug 15 12:52:47 2012
@@ -4248,6 +4248,7 @@
 	ast_copy_string(cause_code->chan_name, ast_channel_name(p->owner), AST_CHANNEL_NAME);
 	ast_copy_string(cause_code->code, cause_str, datalen + 1 - sizeof(*cause_code));
 	ast_queue_control_data(p->owner, AST_CONTROL_PVT_CAUSE_CODE, cause_code, datalen);
+	ast_channel_hangupcause_hash_set(p->owner, cause_code, datalen);
 
 	/* when we have an owner we don't call dahdi_r2_disconnect_call here, that will
 	   be done in dahdi_hangup */

Modified: branches/11/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_iax2.c?view=diff&rev=371258&r1=371257&r2=371258
==============================================================================
--- branches/11/channels/chan_iax2.c (original)
+++ branches/11/channels/chan_iax2.c Wed Aug 15 12:52:47 2012
@@ -10237,7 +10237,12 @@
 		cause_code->ast_cause = ies.causecode;
 		snprintf(cause_code->code, data_size - sizeof(*cause_code) + 1, "IAX2 %s(%d)", subclass, ies.causecode);
 
-		iax2_queue_control_data(fr->callno, AST_CONTROL_PVT_CAUSE_CODE, cause_code, data_size);
+		iax2_lock_owner(fr->callno);
+		if (iaxs[fr->callno] && iaxs[fr->callno]->owner) {
+			ast_queue_control_data(iaxs[fr->callno]->owner, AST_CONTROL_PVT_CAUSE_CODE, cause_code, data_size);
+			ast_channel_hangupcause_hash_set(iaxs[fr->callno]->owner, cause_code, data_size);
+			ast_channel_unlock(iaxs[fr->callno]->owner);
+		}
 		if (!iaxs[fr->callno]) {
 			ast_variables_destroy(ies.vars);
 			ast_mutex_unlock(&iaxsl[fr->callno]);

Modified: branches/11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_sip.c?view=diff&rev=371258&r1=371257&r2=371258
==============================================================================
--- branches/11/channels/chan_sip.c (original)
+++ branches/11/channels/chan_sip.c Wed Aug 15 12:52:47 2012
@@ -27207,6 +27207,7 @@
 				}
 
 				ast_queue_control_data(p->owner, AST_CONTROL_PVT_CAUSE_CODE, cause_code, data_size);
+				ast_channel_hangupcause_hash_set(p->owner, cause_code, data_size);
 			}
 
 			handle_response(p, respid, e + len, req, seqno);

Modified: branches/11/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/sig_analog.c?view=diff&rev=371258&r1=371257&r2=371258
==============================================================================
--- branches/11/channels/sig_analog.c (original)
+++ branches/11/channels/sig_analog.c Wed Aug 15 12:52:47 2012
@@ -2819,6 +2819,7 @@
 		cause_code->ast_cause = AST_CAUSE_NETWORK_OUT_OF_ORDER;
 	case ANALOG_EVENT_ONHOOK:
 		ast_queue_control_data(ast, AST_CONTROL_PVT_CAUSE_CODE, cause_code, data_size);
+		ast_channel_hangupcause_hash_set(ast, cause_code, data_size);
 		switch (p->sig) {
 		case ANALOG_SIG_FXOLS:
 		case ANALOG_SIG_FXOGS:
@@ -3498,6 +3499,7 @@
 					if (p->hanguponpolarityswitch) {
 						ast_debug(1, "HangingUp on polarity switch! channel %d\n", p->channel);
 						ast_queue_control_data(ast, AST_CONTROL_PVT_CAUSE_CODE, cause_code, data_size);
+						ast_channel_hangupcause_hash_set(ast, cause_code, data_size);
 						ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
 						p->polarity = POLARITY_IDLE;
 					} else {

Modified: branches/11/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/sig_pri.c?view=diff&rev=371258&r1=371257&r2=371258
==============================================================================
--- branches/11/channels/sig_pri.c (original)
+++ branches/11/channels/sig_pri.c Wed Aug 15 12:52:47 2012
@@ -1300,6 +1300,7 @@
 		ast_copy_string(cause_code->chan_name, ast_channel_name(chan), AST_CHANNEL_NAME);
 		ast_copy_string(cause_code->code, cause, datalen + 1 - sizeof(*cause_code));
 		ast_queue_control_data(chan, AST_CONTROL_PVT_CAUSE_CODE, cause_code, datalen);
+		ast_channel_hangupcause_hash_set(chan, cause_code, datalen);
 		ast_channel_unlock(chan);
 	}
 }

Modified: branches/11/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/sig_ss7.c?view=diff&rev=371258&r1=371257&r2=371258
==============================================================================
--- branches/11/channels/sig_ss7.c (original)
+++ branches/11/channels/sig_ss7.c Wed Aug 15 12:52:47 2012
@@ -397,6 +397,7 @@
 	ast_copy_string(cause_code->chan_name, ast_channel_name(owner), AST_CHANNEL_NAME);
 	ast_copy_string(cause_code->code, cause, datalen + 1 - sizeof(*cause_code));
 	ast_queue_control_data(owner, AST_CONTROL_PVT_CAUSE_CODE, cause_code, datalen);
+	ast_channel_hangupcause_hash_set(owner, cause_code, datalen);
 }
 
 




More information about the asterisk-commits mailing list