set export park acknowledge_call drop Application event

This commit is contained in:
qiwei 2024-10-08 19:23:01 +08:00
parent 77959d2389
commit 7f932db494

View File

@ -2964,15 +2964,24 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
application_interface->application_function(session, expanded); application_interface->application_function(session, expanded);
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE) == SWITCH_STATUS_SUCCESS) { if (strcmp(application_interface->interface_name, "set") == 0
const char *resp = switch_channel_get_variable(session->channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE); || strcmp(application_interface->interface_name, "export") == 0
switch_channel_event_set_data(session->channel, event); || strcmp(application_interface->interface_name, "park") == 0
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name); || strcmp(application_interface->interface_name, "acknowledge_call") == 0) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Response", resp ? resp : "_none_"); "%s drop Application event\n", application_interface->interface_name);
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); else{
switch_event_fire(&event); 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; msg.message_id = SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE;