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

Freeswitch SVN mikej at freeswitch.org
Sat Feb 10 18:16:43 EST 2007


Author: mikej
Date: Sat Feb 10 18:16:43 2007
New Revision: 4195

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

Log:
add some better returns to invite failures.

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Sat Feb 10 18:16:43 2007
@@ -4215,6 +4215,7 @@
 
     if (!(sip && 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;
     }
 
@@ -4226,12 +4227,13 @@
 
     if (!(session = switch_core_session_request(&sofia_endpoint_interface, NULL))) {
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Session Alloc Failed!\n");
-        return;
+		nua_respond(nh, SIP_503_SERVICE_UNAVAILABLE, TAG_END());
+		return;
     }
 
     if (!(tech_pvt = (private_object_t *) switch_core_session_alloc(session, sizeof(private_object_t)))) {
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
-        terminate_session(&session, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, __LINE__);
+        terminate_session(&session, SWITCH_CAUSE_SWITCH_CONGESTION, __LINE__);
         return;
     }
 



More information about the Freeswitch-svn mailing list