From a53659c086d1fc5ad2a4b41bb647d31cfd74a5ea Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 8 Oct 2015 13:17:39 -0500 Subject: [PATCH] FS-7929 #resolve [ignore_early_media=true behaviour] --- src/include/switch_ivr.h | 1 + src/mod/applications/mod_dptools/mod_dptools.c | 2 ++ src/switch_ivr.c | 8 ++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h index 412cb63757..ca0c710273 100644 --- a/src/include/switch_ivr.h +++ b/src/include/switch_ivr.h @@ -122,6 +122,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_event(switch_core_session_t *session); SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_messages(switch_core_session_t *session); SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_session_t *session); +SWITCH_DECLARE(switch_status_t) switch_ivr_parse_signal_data(switch_core_session_t *session, switch_bool_t all, switch_bool_t only_session_thread); SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_signal_data(switch_core_session_t *session); SWITCH_DECLARE(switch_status_t) switch_ivr_process_indications(switch_core_session_t *session, switch_core_session_message_t *message); diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 310aa302e4..cf6fd956f5 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -3146,6 +3146,8 @@ static void *SWITCH_THREAD_FUNC camp_music_thread(switch_thread_t *thread, void } while (stake->running && switch_channel_ready(channel)) { + switch_ivr_parse_signal_data(session, SWITCH_TRUE, SWITCH_FALSE); + if (status != SWITCH_STATUS_BREAK) { if (!strcasecmp(moh, "silence")) { status = switch_ivr_collect_digits_callback(session, &args, 0, 0); diff --git a/src/switch_ivr.c b/src/switch_ivr.c index c861366960..766aa0d8ad 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -820,14 +820,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_messages(switch_core_sessio } -static switch_status_t switch_ivr_parse_signal_data(switch_core_session_t *session, switch_bool_t all) +SWITCH_DECLARE(switch_status_t) switch_ivr_parse_signal_data(switch_core_session_t *session, switch_bool_t all, switch_bool_t only_session_thread) { void *data; switch_core_session_message_t msg = { 0 }; int i = 0; switch_channel_t *channel = switch_core_session_get_channel(session); - if (!switch_core_session_in_thread(session)) { + if (only_session_thread && !switch_core_session_in_thread(session)) { return SWITCH_STATUS_FALSE; } @@ -857,11 +857,11 @@ static switch_status_t switch_ivr_parse_signal_data(switch_core_session_t *sessi } SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_session_t *session) { - return switch_ivr_parse_signal_data(session, SWITCH_TRUE); + return switch_ivr_parse_signal_data(session, SWITCH_TRUE, SWITCH_FALSE); } SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_signal_data(switch_core_session_t *session) { - return switch_ivr_parse_signal_data(session, SWITCH_FALSE); + return switch_ivr_parse_signal_data(session, SWITCH_FALSE, SWITCH_FALSE); } SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session)