From: Minh Date: Mon, 9 Jan 2023 13:00:49 +0000 (+0700) Subject: [mod_sofia] New chanvars for inbound multiple header identity X-Git-Tag: v1.10.9^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c69c399dd288ce5765aacd347bd7406d7dcc1cd4;p=thirdparty%2Ffreeswitch.git [mod_sofia] New chanvars for inbound multiple header identity --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index b4eb90f21b..a2af9c3849 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -11484,6 +11484,16 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia } } + if (sip->sip_identity) { + sip_identity_t *id; + + for (id = sip->sip_identity; id; id = id->id_next) { + if (!zstr(id->id_value)) { + switch_channel_add_variable_var_check(channel, "sip_identity", id->id_value, SWITCH_FALSE, SWITCH_STACK_PUSH); + } + } + } + if (sip->sip_identity && sip->sip_identity->id_value) { switch_channel_set_variable(channel, "sip_h_identity", sip->sip_identity->id_value); }