]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10745 [mod_sofia] provide more context to transferor event
authorLuis Azedo <luis@2600hz.com>
Wed, 1 Nov 2017 12:19:44 +0000 (12:19 +0000)
committerLuis Azedo <luis@2600hz.com>
Mon, 1 Oct 2018 14:13:58 +0000 (15:13 +0100)
src/mod/endpoints/mod_sofia/sofia.c

index 758435d15d71046b9546007d50a529334bd99ede..fa0c54771687f6b4dea9df1db8190446e9499961 100644 (file)
@@ -8906,11 +8906,15 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
 
                                                                if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_TRANSFEROR) == SWITCH_STATUS_SUCCESS) {
                                                                        switch_channel_event_set_data(channel_a, event);
+                                                                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_original_call_id", br_a);
+                                                                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_destination_call_id", br_b);
+                                                                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_destination_peer_uuid", switch_core_session_get_uuid(b_session));
                                                                        switch_event_fire(&event);
                                                                }
 
                                                                if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_TRANSFEREE) == SWITCH_STATUS_SUCCESS) {
                                                                        switch_channel_event_set_data(a_channel, event);
+                                                                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_replaced_call_id", switch_core_session_get_uuid(b_session));
                                                                        switch_event_fire(&event);
                                                                }
                                                        }
@@ -9013,6 +9017,9 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
 
                                                        if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_TRANSFEROR) == SWITCH_STATUS_SUCCESS) {
                                                                switch_channel_event_set_data(channel_a, event);
+                                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_original_call_id", br_a);
+                                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_destination_call_id", br_b);
+                                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_destination_peer_uuid", switch_core_session_get_uuid(b_session));
                                                                switch_event_fire(&event);
                                                        }
 
@@ -9091,6 +9098,9 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                                if(sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)) {
                                                                        if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_TRANSFEROR) == SWITCH_STATUS_SUCCESS) {
                                                                                switch_channel_event_set_data(channel_a, event);
+                                                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_original_call_id", switch_core_session_get_uuid(hup_session));
+                                                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_destination_call_id", switch_core_session_get_uuid(t_session));
+                                                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_destination_peer_uuid", switch_channel_get_partner_uuid(t_channel));
                                                                                switch_event_fire(&event);
                                                                        }
 
@@ -9278,6 +9288,8 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
 
                                                if(sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)) {
                                                        if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_TRANSFEROR) == SWITCH_STATUS_SUCCESS) {
+                                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_original_call_id", br_a);
+                                                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "att_xfer_destination_call_id", br_b);
                                                                switch_channel_event_set_data(channel_a, event);
                                                                switch_event_fire(&event);
                                                        }