[Freeswitch-svn] [commit] r9238 - in freeswitch/trunk/src: . include mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Mon Aug 11 12:12:55 EDT 2008


Author: anthm
Date: Mon Aug 11 12:12:55 2008
New Revision: 9238

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_ivr_originate.c

Log:
add some clarification

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Mon Aug 11 12:12:55 2008
@@ -1186,7 +1186,8 @@
 	SWITCH_CAUSE_ALLOTTED_TIMEOUT = 602,
 	SWITCH_CAUSE_USER_CHALLENGE = 603,
 	SWITCH_CAUSE_MEDIA_TIMEOUT = 604,
-	SWITCH_CAUSE_PICKED_OFF = 605
+	SWITCH_CAUSE_PICKED_OFF = 605,
+	SWITCH_CAUSE_USER_NOT_REGISTERED = 606
 } switch_call_cause_t;
 
 typedef enum {

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	Mon Aug 11 12:12:55 2008
@@ -1616,8 +1616,8 @@
 	char *p;
 	sofia_profile_t *profile = NULL;
 	const char *exclude_contact = NULL;
-	char *reply = "";
-
+	char *reply = "error/facility_not_subscribed";
+	
 	if (!cmd) {
 		stream->write_function(stream, "%s", "");
 		return SWITCH_STATUS_SUCCESS;
@@ -1696,8 +1696,14 @@
 			if (!switch_strlen_zero(reply) && end_of(reply) == ',') {
 				end_of(reply) = '\0';
 			}
+
+			if (switch_strlen_zero(reply)) {
+				reply = "error/user_not_registered";
+			}
+
 			stream->write_function(stream, "%s", reply);
 			reply = NULL;
+			
 			switch_safe_free(mystream.data);
 		}
 	}
@@ -1960,7 +1966,7 @@
 				tech_pvt->local_url = switch_core_session_sprintf(nsession, "%s@%s", dest, host);
 			} else {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate registered user %s@%s\n", dest, host);
-				cause = SWITCH_CAUSE_NO_ROUTE_DESTINATION;
+				cause = SWITCH_CAUSE_USER_NOT_REGISTERED;
 				goto error;
 			}
 		} else if (!(host = strchr(dest, '@'))) {
@@ -1972,7 +1978,7 @@
 				host = profile_name;
 			} else {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate registered user %s@%s\n", dest, profile_name);
-				cause = SWITCH_CAUSE_NO_ROUTE_DESTINATION;
+				cause = SWITCH_CAUSE_USER_NOT_REGISTERED;
 				goto error;
 			}
 		} else {

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Mon Aug 11 12:12:55 2008
@@ -101,6 +101,7 @@
 	{"USER_CHALLENGE", SWITCH_CAUSE_USER_CHALLENGE},
 	{"MEDIA_TIMEOUT", SWITCH_CAUSE_MEDIA_TIMEOUT},
 	{"PICKED_OFF", SWITCH_CAUSE_PICKED_OFF},
+	{"USER_NOT_REGISTERED", SWITCH_CAUSE_USER_NOT_REGISTERED},
 	{NULL, 0}
 };
 

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Mon Aug 11 12:12:55 2008
@@ -536,10 +536,16 @@
 	char *loop_data = NULL;
 	uint32_t progress_timelimit_sec = 0;
 
+	*bleg = NULL;
+
+	if (!strncasecmp(bridgeto, "error/", 6)) {
+		*cause = switch_channel_str2cause(bridgeto + 6);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	switch_zmalloc(write_frame.data, SWITCH_RECOMMENDED_BUFFER_SIZE);
 	write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
 
-	*bleg = NULL;
 	odata = strdup(bridgeto);
 
 	if (!odata) {



More information about the Freeswitch-svn mailing list