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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 22 13:36:13 CST 2013


Author: mmichelson
Date: Tue Jan 22 13:36:09 2013
New Revision: 379914

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379914
Log:
Add a couple of places to cleanup the session if the initial INVITE encounters a problem.


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

Modified: team/group/pimp_my_sip/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_session.c?view=diff&rev=379914&r1=379913&r2=379914
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_session.c (original)
+++ team/group/pimp_my_sip/res/res_sip_session.c Tue Jan 22 13:36:09 2013
@@ -711,7 +711,6 @@
 		}
 	}
 
-
 	switch (get_destination(session, rdata)) {
 	case SIP_GET_DEST_EXTEN_FOUND:
 		/* Things worked. Keep going */
@@ -731,10 +730,11 @@
 		} else {
 			pjsip_inv_terminate(inv_session, 404, PJ_FALSE);
 		}
+		ao2_cleanup(session);
 		return;
 	};
 
-        if ((sdp_info = pjsip_rdata_get_sdp_info(rdata)) && (sdp_info->sdp_err == PJ_SUCCESS)) {
+	if ((sdp_info = pjsip_rdata_get_sdp_info(rdata)) && (sdp_info->sdp_err == PJ_SUCCESS)) {
 		if (handle_incoming_sdp(session, sdp_info->sdp)) {
 			if (pjsip_inv_end_session(inv_session, 500, NULL, &tdata) == PJ_SUCCESS) {
 				ast_sip_session_send_response(session, tdata);
@@ -745,7 +745,7 @@
 		}
 		/* We are creating a local SDP which is an answer to their offer */
 		local = create_local_sdp(inv_session, session, sdp_info->sdp);
-        } else {
+	} else {
 		/* We are creating a local SDP which is an offer */
 		local = create_local_sdp(inv_session, session, NULL);
 	}
@@ -757,6 +757,7 @@
 		} else {
 			pjsip_inv_terminate(inv_session, 500, PJ_FALSE);
 		}
+		ao2_cleanup(session);
 		return;
 	} else {
 		pjsip_inv_set_local_sdp(inv_session, local);




More information about the asterisk-commits mailing list