[asterisk-commits] twilson: trunk r369217 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 22 15:05:24 CDT 2012


Author: twilson
Date: Fri Jun 22 15:05:22 2012
New Revision: 369217

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=369217
Log:
Don't crash on a guest directmedia call

A sip_pvt may not have relatedpeer set if a call doesn't match up
with a peer. If there is no relatedpeer, there is no direct media
ACL to apply, so just return that it is allowed.
........

Merged revisions 369214 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369215 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=369217&r1=369216&r2=369217
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Jun 22 15:05:22 2012
@@ -30842,17 +30842,17 @@
 	}
 
 	sip_pvt_lock(p2);
-	if (p2->relatedpeer->directmediaha) {
+	if (p2->relatedpeer && p2->relatedpeer->directmediaha) {
 		p2_directmediaha = ast_duplicate_ha_list(p2->relatedpeer->directmediaha);
 	}
 	sip_pvt_unlock(p2);
 
 	sip_pvt_lock(p1);
-	if (p1->relatedpeer->directmediaha) {
+	if (p1->relatedpeer && p1->relatedpeer->directmediaha) {
 		p1_directmediaha = ast_duplicate_ha_list(p1->relatedpeer->directmediaha);
 	}
 
-	if (ast_test_flag(&p1->flags[0], SIP_DIRECT_MEDIA)) {
+	if (p2_directmediaha && ast_test_flag(&p1->flags[0], SIP_DIRECT_MEDIA)) {
 		if (!apply_directmedia_ha(p1, p2_directmediaha, rtptype)) {
 			res = 0;
 		}
@@ -30864,7 +30864,7 @@
 	}
 
 	sip_pvt_lock(p2);
-	if (ast_test_flag(&p2->flags[0], SIP_DIRECT_MEDIA)) {
+	if (p1_directmediaha && ast_test_flag(&p2->flags[0], SIP_DIRECT_MEDIA)) {
 		if (!apply_directmedia_ha(p2, p1_directmediaha, rtptype)) {
 			res = 0;
 		}




More information about the asterisk-commits mailing list