]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] New chanvars for inbound multiple header identity
authorMinh <hnimminh@outlook.com>
Mon, 9 Jan 2023 13:00:49 +0000 (20:00 +0700)
committerGitHub <noreply@github.com>
Mon, 9 Jan 2023 13:00:49 +0000 (16:00 +0300)
src/mod/endpoints/mod_sofia/sofia.c

index b4eb90f21bfab4e9472193a57d303936da2fc7f4..a2af9c3849a4f82a04d5e9755ef1c75927214165 100644 (file)
@@ -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);
                }