[asterisk-commits] alecdavis: branch 1.8 r310287 - /branches/1.8/main/rtp_engine.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 11 00:47:52 CST 2011


Author: alecdavis
Date: Fri Mar 11 00:47:44 2011
New Revision: 310287

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=310287
Log:
remote_bridge_loop: prevent segfault when after transfer of IAX2 of DAHDI call 

If the channel condition is one of the following after breaking out of the loop, don't try to update_peer
(where x = 0/1)
 1). ZOMBIE
 2). cx->tech_pvt != pvtx
 3). gluex != ast_rtp_instance_get_glue(cx->tech->type))

(closes issue #18781)
Reported by: alecdavis
Patches: 
      bug18781.diff3.txt uploaded by alecdavis (license 585)
Tested by: alecdavis, ZX81

Review: https://reviewboard.asterisk.org/r/1128/


Modified:
    branches/1.8/main/rtp_engine.c

Modified: branches/1.8/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/rtp_engine.c?view=diff&rev=310287&r1=310286&r2=310287
==============================================================================
--- branches/1.8/main/rtp_engine.c (original)
+++ branches/1.8/main/rtp_engine.c Fri Mar 11 00:47:44 2011
@@ -1202,10 +1202,22 @@
 		cs[1] = cs[2];
 	}
 
-	if (glue0->update_peer(c0, NULL, NULL, NULL, 0, 0)) {
+	if (ast_test_flag(c0, AST_FLAG_ZOMBIE)) {
+		ast_debug(1, "Channel '%s' Zombie cleardown from bridge\n", c0->name);
+	} else if (c0->tech_pvt != pvt0) {
+		ast_debug(1, "Channel c0->'%s' pvt changed, in bridge with c1->'%s'\n", c0->name, c1->name);
+	} else if (glue0 != ast_rtp_instance_get_glue(c0->tech->type)) {
+		ast_debug(1, "Channel c0->'%s' technology changed, in bridge with c1->'%s'\n", c0->name, c1->name);
+	} else if (glue0->update_peer(c0, NULL, NULL, NULL, 0, 0)) {
 		ast_log(LOG_WARNING, "Channel '%s' failed to break RTP bridge\n", c0->name);
 	}
-	if (glue1->update_peer(c1, NULL, NULL, NULL, 0, 0)) {
+	if (ast_test_flag(c1, AST_FLAG_ZOMBIE)) {
+		ast_debug(1, "Channel '%s' Zombie cleardown from bridge\n", c1->name);
+	} else if (c1->tech_pvt != pvt1) {
+		ast_debug(1, "Channel c1->'%s' pvt changed, in bridge with c0->'%s'\n", c1->name, c0->name);
+	} else if (glue1 != ast_rtp_instance_get_glue(c1->tech->type)) {
+		ast_debug(1, "Channel c1->'%s' technology changed, in bridge with c0->'%s'\n", c1->name, c0->name);
+	} else if (glue1->update_peer(c1, NULL, NULL, NULL, 0, 0)) {
 		ast_log(LOG_WARNING, "Channel '%s' failed to break RTP bridge\n", c1->name);
 	}
 




More information about the asterisk-commits mailing list