[asterisk-commits] mmichelson: branch 1.8 r397112 - in /branches/1.8/channels: ./ sip/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 20 11:13:03 CDT 2013


Author: mmichelson
Date: Tue Aug 20 11:13:01 2013
New Revision: 397112

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397112
Log:
Fix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of pvts.

(closes issue ASTERISK-22248)
reported by Corey Farrell
patches:
	test_sip_rtpqos.patch uploaded by Corey Farrell (license #5909)


Modified:
    branches/1.8/channels/chan_sip.c
    branches/1.8/channels/sip/dialplan_functions.c

Modified: branches/1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_sip.c?view=diff&rev=397112&r1=397111&r2=397112
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Tue Aug 20 11:13:01 2013
@@ -216,6 +216,7 @@
 #include <regex.h>
 #include <inttypes.h>
 
+#define REF_DEBUG 1
 #include "asterisk/network.h"
 #include "asterisk/paths.h"	/* need ast_config_AST_SYSTEM_NAME */
 /*

Modified: branches/1.8/channels/sip/dialplan_functions.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sip/dialplan_functions.c?view=diff&rev=397112&r1=397111&r2=397112
==============================================================================
--- branches/1.8/channels/sip/dialplan_functions.c (original)
+++ branches/1.8/channels/sip/dialplan_functions.c Tue Aug 20 11:13:01 2013
@@ -353,7 +353,7 @@
 		goto done;
 	}
 	chan->tech = &sip_tech;
-	chan->tech_pvt = p;
+	chan->tech_pvt = dialog_ref(p, "Give the owner channel a reference to the dialog");
 	p->owner = chan;
 
 	varstr = ast_str_create(16);
@@ -397,8 +397,9 @@
 	ast_free(varstr);
 	ast_free(buffer);
 
-	/* This unref will take care of destroying the channel, RTP instance, and SIP pvt */
+	/* This unlink and unref will take care of destroying the channel, RTP instance, and SIP pvt */
 	if (p) {
+		dialog_unlink_all(p);
 		dialog_unref(p, "Destroy test object");
 	}
 	ast_rtp_engine_unregister(&test_engine);




More information about the asterisk-commits mailing list