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

FreeSWITCH SVN anthm at freeswitch.org
Wed Mar 11 08:14:24 PDT 2009


Author: anthm
Date: Wed Mar 11 10:14:24 2009
New Revision: 12566

Log:
add sip_from_display var and fix backwards switch_strisr calls 

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

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	Wed Mar 11 10:14:24 2009
@@ -1176,6 +1176,7 @@
 		const char *invite_contact_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_contact_params");
 		const char *invite_from_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_from_params");
 		const char *from_var = switch_channel_get_variable(tech_pvt->channel, "sip_from_uri");
+		const char *from_display = switch_channel_get_variable(tech_pvt->channel, "sip_from_display");
 		
 		if (switch_strlen_zero(tech_pvt->dest)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "URL Error!\n");
@@ -1277,10 +1278,11 @@
 		   or did he just suggest it to make our lives miserable?
 		 */
 		use_from_str = from_str;
-		if (!strcasecmp(tech_pvt->caller_profile->caller_id_name, "_undef_")) {
+		if (!from_display && !strcasecmp(tech_pvt->caller_profile->caller_id_name, "_undef_")) {
 			from_str = switch_core_session_sprintf(session, "<%s>", use_from_str);
 		} else {
-			from_str = switch_core_session_sprintf(session, "\"%s\" <%s>", tech_pvt->caller_profile->caller_id_name, use_from_str);
+			from_str = switch_core_session_sprintf(session, "\"%s\" <%s>", from_display ? from_display : 
+												   tech_pvt->caller_profile->caller_id_name, use_from_str);
 		}
 		
 		if (!(call_id = switch_channel_get_variable(channel, "sip_outgoing_call_id"))) {

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Wed Mar 11 10:14:24 2009
@@ -1435,15 +1435,15 @@
 
 					new_profile->flags = SWITCH_CPF_NONE;
 
-					if (switch_stristr(tmp, "screen")) {
+					if (switch_stristr("screen", tmp)) {
 						switch_set_flag(new_profile, SWITCH_CPF_SCREEN);
 					}
 
-					if (switch_stristr(tmp, "hide_name")) {
+					if (switch_stristr("hide_name", tmp)) {
 						switch_set_flag(new_profile, SWITCH_CPF_HIDE_NAME);
 					}
 
-					if (switch_stristr(tmp, "hide_number")) {
+					if (switch_stristr("hide_number", tmp)) {
 						switch_set_flag(new_profile, SWITCH_CPF_HIDE_NUMBER);
 					}
 



More information about the Freeswitch-svn mailing list