[Freeswitch-svn] [commit] r5267 - in freeswitch/trunk/src: . include

Freeswitch SVN anthm at freeswitch.org
Tue Jun 5 12:50:51 EDT 2007


Author: anthm
Date: Tue Jun  5 12:50:51 2007
New Revision: 5267

Modified:
   freeswitch/trunk/src/include/switch_utils.h
   freeswitch/trunk/src/switch_caller.c
   freeswitch/trunk/src/switch_channel.c

Log:
update

Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h	(original)
+++ freeswitch/trunk/src/include/switch_utils.h	Tue Jun  5 12:50:51 2007
@@ -177,11 +177,13 @@
 
 #define switch_set_string(_dst, _src) switch_copy_string(_dst, _src, sizeof(_dst))
 
-static __inline__ void switch_clean_string(char *s)
+static __inline__ char *switch_clean_string(char *s)
 {                                                                                                                                                                   char *p;
 
     for (p = s; p && *p; p++) {                                                                                                                                         uint8_t x = (uint8_t) *p;                                                                                                                                       if (x < 32 || x > 127) {                                                                                                                                            *p = ' ';                                                                                                                                                   }
     }
+
+	return s;
 }
 
 

Modified: freeswitch/trunk/src/switch_caller.c
==============================================================================
--- freeswitch/trunk/src/switch_caller.c	(original)
+++ freeswitch/trunk/src/switch_caller.c	Tue Jun  5 12:50:51 2007
@@ -51,17 +51,17 @@
 		if (!context) {
 			context = "default";
 		}
-		profile->username = switch_core_strdup(pool, switch_str_nil(username));
-		profile->dialplan = switch_core_strdup(pool, switch_str_nil(dialplan));
-		profile->caller_id_name = switch_core_strdup(pool, switch_str_nil(caller_id_name));
-		profile->caller_id_number = switch_core_strdup(pool, switch_str_nil(caller_id_number));
-		profile->network_addr = switch_core_strdup(pool, switch_str_nil(network_addr));
-		profile->ani = switch_core_strdup(pool, switch_str_nil(ani));
-		profile->aniii = switch_core_strdup(pool, switch_str_nil(aniii));
-		profile->rdnis = switch_core_strdup(pool, switch_str_nil(rdnis));
-		profile->source = switch_core_strdup(pool, switch_str_nil(source));
-		profile->context = switch_core_strdup(pool, switch_str_nil(context));
-		profile->destination_number = switch_core_strdup(pool, switch_str_nil(destination_number));
+		profile->username = switch_clean_string(switch_core_strdup(pool, switch_str_nil(username)));
+		profile->dialplan = switch_clean_string(switch_core_strdup(pool, switch_str_nil(dialplan)));
+		profile->caller_id_name = switch_clean_string(switch_core_strdup(pool, switch_str_nil(caller_id_name)));
+		profile->caller_id_number = switch_clean_string(switch_core_strdup(pool, switch_str_nil(caller_id_number)));
+		profile->network_addr = switch_clean_string(switch_core_strdup(pool, switch_str_nil(network_addr)));
+		profile->ani = switch_clean_string(switch_core_strdup(pool, switch_str_nil(ani)));
+		profile->aniii = switch_clean_string(switch_core_strdup(pool, switch_str_nil(aniii)));
+		profile->rdnis = switch_clean_string(switch_core_strdup(pool, switch_str_nil(rdnis)));
+		profile->source = switch_clean_string(switch_core_strdup(pool, switch_str_nil(source)));
+		profile->context = switch_clean_string(switch_core_strdup(pool, switch_str_nil(context)));
+		profile->destination_number = switch_clean_string(switch_core_strdup(pool, switch_str_nil(destination_number)));
 		switch_set_flag(profile, SWITCH_CPF_SCREEN);
 	}
 

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Tue Jun  5 12:50:51 2007
@@ -389,7 +389,7 @@
 		switch_mutex_lock(channel->profile_mutex);
 		switch_core_hash_delete(channel->variables, varname);
 		if (!switch_strlen_zero(value)) {
-			switch_core_hash_insert_dup(channel->variables, varname, switch_core_session_strdup(channel->session, value));
+			switch_core_hash_insert_dup(channel->variables, varname, switch_clean_string(switch_core_session_strdup(channel->session, value)));
 		} else {
 			switch_core_hash_delete(channel->variables, varname);
 		}



More information about the Freeswitch-svn mailing list