[asterisk-commits] file: branch group/pimp_my_sip r379451 - /team/group/pimp_my_sip/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 18 10:59:10 CST 2013


Author: file
Date: Fri Jan 18 10:59:07 2013
New Revision: 379451

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379451
Log:
Make session_begin an optional callback and increment the session reference count so it does not get destroyed prematurely.

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=379451&r1=379450&r2=379451
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_session.c (original)
+++ team/group/pimp_my_sip/res/res_sip_session.c Fri Jan 18 10:59:07 2013
@@ -450,9 +450,12 @@
 		return NULL;
 	}
 	AST_LIST_TRAVERSE(&session->supplements, iter, next) {
-		iter->session_begin(session);
+		if (iter->session_begin) {
+			iter->session_begin(session);
+		}
 	}
 	inv_session->mod_data[session_module.id] = session;
+	ao2_ref(session, +1);
 	return session;
 }
 




More information about the asterisk-commits mailing list