]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] Adding custom header to refer
authorsurendrasignalwire <56929670+surendrasignalwire@users.noreply.github.com>
Tue, 28 Apr 2020 16:09:19 +0000 (21:39 +0530)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 18:59:55 +0000 (21:59 +0300)
src/mod/endpoints/mod_sofia/sofia.c

index 293199f07aa6bde0b534d10f2457669db5ab0e4b..3682bc454aadeef8cf434bc7ea94ba42b15b0684 100644 (file)
@@ -8871,7 +8871,7 @@ nua_handle_t *sofia_global_nua_handle_by_replaces(sip_replaces_t *replaces)
 
 }
 
-static switch_status_t sofia_process_proxy_refer(switch_core_session_t *session, const char *refer_to)
+static switch_status_t sofia_process_proxy_refer(switch_core_session_t *session, const char *refer_to, sip_t const *sip)
 {
        switch_core_session_t *other_session;
        private_object_t *tech_pvt = switch_core_session_get_private(session);
@@ -8880,6 +8880,7 @@ static switch_status_t sofia_process_proxy_refer(switch_core_session_t *session,
                switch_core_session_message_t *msg;
 
                tech_pvt->proxy_refer_uuid = switch_core_session_strdup(session, switch_core_session_get_uuid(other_session));
+               sofia_glue_set_extra_headers(other_session, sip, SOFIA_SIP_HEADER_PREFIX);
                msg = switch_core_session_alloc(other_session, sizeof(*msg));
                MESSAGE_STAMP_FFL(msg);
                msg->message_id = SWITCH_MESSAGE_INDICATE_DEFLECT;
@@ -8931,7 +8932,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
        }
 
        if (full_ref_to && sofia_test_pflag(profile, PFLAG_PROXY_REFER)) {
-               if (sofia_process_proxy_refer(session, full_ref_to) == SWITCH_STATUS_SUCCESS) {
+               if (sofia_process_proxy_refer(session, full_ref_to, sip) == SWITCH_STATUS_SUCCESS) {
                        if (tech_pvt->proxy_refer_msg) {
                                msg_ref_destroy(tech_pvt->proxy_refer_msg);
                                tech_pvt->proxy_refer_msg = NULL;