]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 5 Jun 2007 16:50:51 +0000 (16:50 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 5 Jun 2007 16:50:51 +0000 (16:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5267 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_utils.h
src/switch_caller.c
src/switch_channel.c

index cef526e0089eae21ad4f27dc4b8ff9c2d835703e..2e1564eaba74340b9a4d9b9a0fa3e5c5117b99a0 100644 (file)
@@ -177,11 +177,13 @@ switch_mutex_unlock(obj->flag_mutex);
 
 #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;
 }
 
 
index e1a0a6f1c930e6f95f90c48256211b1bcfebf972..318052cbae86dad91872e80940e67b4be45e928b 100644 (file)
@@ -51,17 +51,17 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor
                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);
        }
 
index 9948a735211e800f5fa975e2204e97d0f8c6479e..68a1a1b64621e7547b66bb9a7b7ac5755505d877 100644 (file)
@@ -389,7 +389,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *ch
                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);
                }