Skip to content

Commit

Permalink
TEL-6201: Move this to on_routing.
Browse files Browse the repository at this point in the history
  • Loading branch information
damirn committed Dec 5, 2024
1 parent 2f1990b commit 98ec345
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/switch_core_state_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ static void switch_core_standard_on_routing(switch_core_session_t *session)
switch_caller_extension_t *extension = NULL;
char *expanded = NULL;
char *dpstr = NULL;
const char *post_dialplan_execute = NULL;

switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Standard ROUTING\n", switch_channel_get_name(session->channel));

Expand Down Expand Up @@ -297,6 +298,14 @@ static void switch_core_standard_on_routing(switch_core_session_t *session)
}
}

post_dialplan_execute = switch_channel_get_variable(session->channel, "post_dialplan_execute");
if (!zstr(post_dialplan_execute)) {
switch_application_function_t func = switch_channel_get_post_dialplan_function(session->channel);
if (func) {
func(session, post_dialplan_execute);
}
}

if (!count) {
if (switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
if (switch_channel_test_flag(session->channel, CF_ANSWERED)) {
Expand Down Expand Up @@ -333,7 +342,6 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
const char *uuid;
const char *next_application_on_execute = NULL;
const char *next_application_data_on_execute = NULL;
const char *post_dialplan_execute = NULL;

switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Standard EXECUTE\n", switch_channel_get_name(session->channel));

Expand Down Expand Up @@ -389,15 +397,6 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)

}

post_dialplan_execute = switch_channel_get_variable(session->channel, "post_dialplan_execute");

if (!zstr(post_dialplan_execute)) {
switch_application_function_t func = switch_channel_get_post_dialplan_function(session->channel);
if (func) {
func(session, post_dialplan_execute);
}
}

if (switch_channel_ready(session->channel) && switch_channel_get_state(session->channel) == CS_EXECUTE &&
switch_channel_test_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER) &&
(uuid = switch_channel_get_variable(session->channel, "blind_transfer_uuid"))) {
Expand Down

0 comments on commit 98ec345

Please sign in to comment.