[asterisk-commits] mmichelson: branch group/CCSS r232019 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 1 18:12:59 CST 2009


Author: mmichelson
Date: Tue Dec  1 18:12:55 2009
New Revision: 232019

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=232019
Log:
Lock the sip_pvt before we send the response.


Modified:
    team/group/CCSS/channels/chan_sip.c

Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=232019&r1=232018&r2=232019
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Tue Dec  1 18:12:55 2009
@@ -3516,12 +3516,14 @@
 	}
 	agent_pvt->original_call = dialog_unref(agent_pvt->original_call, "SIP CC agent destructor: Remove ref to original call");
 	if (agent_pvt->subscribe_pvt) {
+		sip_pvt_lock(agent_pvt->subscribe_pvt);
 		if (!ast_test_flag(&agent_pvt->subscribe_pvt->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED)) {
 			/* If we haven't sent a 200 OK for the SUBSCRIBE dialog yet, then we need to send a response letting
 			 * the subscriber know something went wrong
 			 */
 			transmit_response(agent_pvt->subscribe_pvt, "500 Internal Server Error", &agent_pvt->subscribe_pvt->initreq);
 		}
+		sip_pvt_unlock(agent_pvt->subscribe_pvt);
 		agent_pvt->subscribe_pvt = dialog_unref(agent_pvt->subscribe_pvt, "SIP CC agent destructor: Remove ref to subscription");
 	}
 	ast_free(agent_pvt);




More information about the asterisk-commits mailing list