From bb6b02f2d69e6969c7458630f5e69d159d6e289f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 10 May 2013 09:59:02 -0500 Subject: [PATCH] FS-5403 --resolve --- src/mod/endpoints/mod_sofia/sofia.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 9749469543..1e1c51c9ab 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -8340,7 +8340,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); } } }