[asterisk-commits] mmichelson: branch group/pimp_my_sip r380100 - /team/group/pimp_my_sip/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 25 10:31:28 CST 2013


Author: mmichelson
Date: Fri Jan 25 10:31:25 2013
New Revision: 380100

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380100
Log:
Fix improper access of the session channel.

On an incoming INVITE, the channel has not been allocated yet when the SDP
is handled. For error cases, we therefore cannot be setting the channel's
hangupcause.


Modified:
    team/group/pimp_my_sip/res/res_sip_sdp_audio.c

Modified: team/group/pimp_my_sip/res/res_sip_sdp_audio.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_sdp_audio.c?view=diff&rev=380100&r1=380099&r2=380100
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_sdp_audio.c (original)
+++ team/group/pimp_my_sip/res/res_sip_sdp_audio.c Fri Jan 25 10:31:25 2013
@@ -126,7 +126,9 @@
 	/* Ensure that the address provided is valid */
 	if ((addrs_cnt = ast_sockaddr_resolve(&addrs, host, PARSE_PORT_FORBID, AST_AF_UNSPEC)) <= 0) {
 		/* The provided host was actually invalid so we kill the session as it would just end up being broken */
-		ast_channel_hangupcause_set(session->channel, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+		if (session->channel) {
+			ast_channel_hangupcause_set(session->channel, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+		}
 		return -1;
 	}
 
@@ -171,7 +173,9 @@
 	ast_format_cap_remove_bytype(cap, AST_FORMAT_TYPE_VIDEO);
 
 	if (!(jointcap = ast_format_cap_joint(cap, peercap))) {
-		ast_channel_hangupcause_set(session->channel, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+		if (session->channel) {
+			ast_channel_hangupcause_set(session->channel, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+		}
 		res = -1;
 		goto cleanup;
 	}




More information about the asterisk-commits mailing list