From 7f932db4948708b4af06711c7d49cd3cbaae01af Mon Sep 17 00:00:00 2001 From: qiwei Date: Tue, 8 Oct 2024 19:23:01 +0800 Subject: [PATCH] set export park acknowledge_call drop Application event --- src/switch_core_session.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 61aa500070..2e80cc41eb 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -2964,15 +2964,24 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t * application_interface->application_function(session, expanded); - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE) == SWITCH_STATUS_SUCCESS) { - const char *resp = switch_channel_get_variable(session->channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE); - switch_channel_event_set_data(session->channel, event); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Response", resp ? resp : "_none_"); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID", app_uuid); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID-Name", app_uuid_name); - switch_event_fire(&event); + if (strcmp(application_interface->interface_name, "set") == 0 + || strcmp(application_interface->interface_name, "export") == 0 + || strcmp(application_interface->interface_name, "park") == 0 + || strcmp(application_interface->interface_name, "acknowledge_call") == 0) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, + "%s drop Application event\n", application_interface->interface_name); + } + else{ + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE) == SWITCH_STATUS_SUCCESS) { + const char *resp = switch_channel_get_variable(session->channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE); + switch_channel_event_set_data(session->channel, event); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Response", resp ? resp : "_none_"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID", app_uuid); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID-Name", app_uuid_name); + switch_event_fire(&event); + } } msg.message_id = SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE;