]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5403 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 10 May 2013 14:59:02 +0000 (09:59 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 10 May 2013 14:59:19 +0000 (09:59 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index 87b34dfd3128cd9da8610934ef60aa7ecf698121..2b7aa28bbbdb71fdc6560162490c2d5ac8d52521 100644 (file)
@@ -8276,7 +8276,16 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
                
                for (mp = sip->sip_multipart; mp; mp = mp->mp_next) {
                        if (mp->mp_payload && mp->mp_payload->pl_data && mp->mp_content_type && mp->mp_content_type->c_type) {
-                               switch_channel_set_variable_name_printf(channel, mp->mp_payload->pl_data, SOFIA_MULTIPART_PREFIX "%s", mp->mp_content_type->c_type);
+                               char *name = switch_core_session_strdup(session, mp->mp_content_type->c_type);
+                               char *p;
+
+                               for (p = name; p && *p; p++) {
+                                       if (*p == '/') {
+                                               *p = '_';
+                                       }
+                               }
+                               
+                               switch_channel_set_variable_name_printf(channel, mp->mp_payload->pl_data, SOFIA_MULTIPART_PREFIX "%s", name);
                        }
                }
        }