[asterisk-commits] file: trunk r404924 - in /trunk: ./ res/res_pjsip_outbound_registration.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 4 19:31:22 CST 2014


Author: file
Date: Sat Jan  4 19:31:19 2014
New Revision: 404924

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=404924
Log:
res_pjsip_outbound_registration: Create registration client in pj thread.

Depending on which threading was loading the outbound registration it was
possible for the registration client to be allocated outside of a pj thread.
This change moves the creation inside the synchronous task where it is
guaranteed it will occur in a pj thread.

Reported by: Rob Thomas
........

Merged revisions 404923 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_outbound_registration.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Sat Jan  4 19:31:19 2014
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403290,403292-403778,403781-404568,404581,404592,404605,404613,404652,404663,404676,404725,404737,404764,404781,404786,404843,404855,404859,404911
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403290,403292-403778,403781-404568,404581,404592,404605,404613,404652,404663,404676,404725,404737,404764,404781,404786,404843,404855,404859,404911,404923

Modified: trunk/res/res_pjsip_outbound_registration.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_outbound_registration.c?view=diff&rev=404924&r1=404923&r2=404924
==============================================================================
--- trunk/res/res_pjsip_outbound_registration.c (original)
+++ trunk/res/res_pjsip_outbound_registration.c Sat Jan  4 19:31:19 2014
@@ -538,10 +538,7 @@
 		return NULL;
 	}
 
-	if ((pjsip_regc_create(ast_sip_get_pjsip_endpoint(), state->client_state, sip_outbound_registration_response_cb, &state->client_state->client) != PJ_SUCCESS) ||
-		!(state->client_state->serializer = ast_sip_create_serializer())) {
-		/* This is on purpose, normal operation will have it be deallocated within the serializer */
-		pjsip_regc_destroy(state->client_state->client);
+	if (!(state->client_state->serializer = ast_sip_create_serializer())) {
 		ao2_cleanup(state->client_state);
 		ao2_cleanup(state);
 		return NULL;
@@ -723,6 +720,12 @@
 		} else {
 			return -1;
 		}
+	}
+
+	if (!registration->state->client_state->client &&
+		pjsip_regc_create(ast_sip_get_pjsip_endpoint(), registration->state->client_state, sip_outbound_registration_response_cb,
+		&registration->state->client_state->client) != PJ_SUCCESS) {
+		return -1;
 	}
 
 	pjsip_regc_set_transport(registration->state->client_state->client, &selector);




More information about the asterisk-commits mailing list