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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 5 10:01:55 CST 2014


Author: file
Date: Sun Jan  5 10:01:53 2014
New Revision: 404936

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=404936
Log:
res_pjsip_outbound_registration: Don't assume that a registration client will always exist.
........

Merged revisions 404935 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 Sun Jan  5 10:01:53 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,404923
+/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,404935

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=404936&r1=404935&r2=404936
==============================================================================
--- trunk/res/res_pjsip_outbound_registration.c (original)
+++ trunk/res/res_pjsip_outbound_registration.c Sun Jan  5 10:01:53 2014
@@ -307,27 +307,30 @@
 static int handle_client_state_destruction(void *data)
 {
 	RAII_VAR(struct sip_outbound_registration_client_state *, client_state, data, ao2_cleanup);
-	pjsip_regc_info info;
 
 	cancel_registration(client_state);
 
-	pjsip_regc_get_info(client_state->client, &info);
-
-	if (info.is_busy == PJ_TRUE) {
-		/* If a client transaction is in progress we defer until it is complete */
-		client_state->destroy = 1;
-		return 0;
-	}
-
-	if (client_state->status != SIP_REGISTRATION_UNREGISTERED && client_state->status != SIP_REGISTRATION_REJECTED_PERMANENT) {
-		pjsip_tx_data *tdata;
-
-		if (pjsip_regc_unregister(client_state->client, &tdata) == PJ_SUCCESS) {
-			pjsip_regc_send(client_state->client, tdata);
-		}
-	}
-
-	pjsip_regc_destroy(client_state->client);
+	if (client_state->client) {
+		pjsip_regc_info info;
+
+		pjsip_regc_get_info(client_state->client, &info);
+
+		if (info.is_busy == PJ_TRUE) {
+			/* If a client transaction is in progress we defer until it is complete */
+			client_state->destroy = 1;
+			return 0;
+		}
+
+		if (client_state->status != SIP_REGISTRATION_UNREGISTERED && client_state->status != SIP_REGISTRATION_REJECTED_PERMANENT) {
+			pjsip_tx_data *tdata;
+
+			if (pjsip_regc_unregister(client_state->client, &tdata) == PJ_SUCCESS) {
+				pjsip_regc_send(client_state->client, tdata);
+			}
+		}
+
+		pjsip_regc_destroy(client_state->client);
+	}
 
 	client_state->status = SIP_REGISTRATION_STOPPED;
 	ast_sip_auth_vector_destroy(&client_state->outbound_auths);




More information about the asterisk-commits mailing list