[mod_sofia] On MIME multipart messages, pass on the Content-ID, this is vital i.e. for routing RFC6442 Geolocation information

This commit is contained in:
leecher1337 2025-01-13 12:26:06 +01:00
parent e343b47c49
commit 52617a0a3b
1 changed files with 3 additions and 1 deletions

View File

@ -11171,7 +11171,9 @@ 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) { 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) { if (mp->mp_payload && mp->mp_payload->pl_data && mp->mp_content_type && mp->mp_content_type->c_type) {
char *val = switch_core_session_sprintf(session, "%s:%s", mp->mp_content_type->c_type, mp->mp_payload->pl_data); char *val;
if (mp->mp_content_id) val = switch_core_session_sprintf(session, "%s:~Content-ID: %s\r\n\r\n%s", mp->mp_content_type->c_type, mp->mp_content_id->g_string, mp->mp_payload->pl_data);
else val = switch_core_session_sprintf(session, "%s:%s", mp->mp_content_type->c_type, mp->mp_payload->pl_data);
switch_channel_add_variable_var_check(channel, "sip_multipart", val, SWITCH_FALSE, SWITCH_STACK_PUSH); switch_channel_add_variable_var_check(channel, "sip_multipart", val, SWITCH_FALSE, SWITCH_STACK_PUSH);
} }
} }