[Freeswitch-svn] [commit] r11463 - freeswitch/trunk/src/mod/endpoints/mod_sofia

FreeSWITCH SVN mikej at freeswitch.org
Fri Jan 23 08:22:50 PST 2009


Author: mikej
Date: Fri Jan 23 10:22:50 2009
New Revision: 11463

Log:
mod_sofia: fix segfault due to missing contact header in invite (MODENDP-177) 

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Fri Jan 23 10:22:50 2009
@@ -3769,6 +3769,12 @@
 		return;
 	}
 
+	if (!(sip->sip_contact && sip->sip_contact->m_url)) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO CONTACT!\n");
+		nua_respond(nh, 400, "Missing Contact Header", TAG_END());
+		return;
+	}
+
 	get_addr(network_ip, sizeof(network_ip), my_addrinfo->ai_addr, my_addrinfo->ai_addrlen);
 	network_port = ntohs(((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_port);
 
@@ -3860,12 +3866,6 @@
 		is_auth++;
 	}
 
-	if (!(sip->sip_contact && sip->sip_contact->m_url)) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO CONTACT!\n");
-		nua_respond(nh, 400, "Missing Contact Header", TAG_END());
-		return;
-	}
-
 	if (sofia_endpoint_interface) {
 		if (profile->pflags & PFLAG_CALLID_AS_UUID) {
 			session = switch_core_session_request_uuid(sofia_endpoint_interface, NULL, sip->sip_call_id->i_id);



More information about the Freeswitch-svn mailing list