From cb5096db71d596929ebdbbab2ffb4e685d161962 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 1 Dec 2008 16:21:27 +0000 Subject: [PATCH] FSCORE-240 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10559 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core_session.c | 1 + src/switch_ivr.c | 8 +++++++- src/switch_ivr_originate.c | 15 +++++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/switch_core_session.c b/src/switch_core_session.c index b0c6610554..6a78f737b8 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -441,6 +441,7 @@ static const char *message_names[] = { "SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ", "SWITCH_MESSAGE_INDICATE_DISPLAY", "SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY", + "SWITCH_MESSAGE_INDICATE_AUDIO_SYNC", "SWITCH_MESSAGE_INVALID" }; diff --git a/src/switch_ivr.c b/src/switch_ivr.c index d0d6c8c64b..6c5432870b 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -52,7 +52,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, cng_frame.buflen = 2; switch_set_flag((&cng_frame), SFF_CNG); - switch_channel_audio_sync(channel); + if (!switch_channel_test_flag(channel, CF_PROXY_MODE)) { + switch_channel_audio_sync(channel); + } + + if (!ms) { + return SWITCH_STATUS_SUCCESS; + } for (;;) { now = switch_timestamp_now(); diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 187f366eea..491bc9b00f 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -39,12 +39,6 @@ static switch_status_t originate_on_consume_media_transmit(switch_core_session_t { switch_channel_t *channel = switch_core_session_get_channel(session); - if (!switch_channel_test_flag(channel, CF_PROXY_MODE)) { - while (switch_channel_get_state(channel) == CS_CONSUME_MEDIA && !switch_channel_test_flag(channel, CF_TAGGED)) { - switch_ivr_sleep(session, 10, NULL); - } - } - switch_channel_clear_state_handler(channel, &originate_state_handlers); return SWITCH_STATUS_FALSE; @@ -97,6 +91,8 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void return NULL; } + switch_ivr_sleep(collect->session, 0, NULL); + if (!strcasecmp(collect->key, "exec")) { char *data; switch_application_interface_t *application_interface; @@ -1680,6 +1676,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess *bleg = NULL; } + if (*bleg) { + switch_ivr_sleep(*bleg, 0, NULL); + } + + if (session) { + switch_ivr_sleep(session, 0, NULL); + } if (var_event) { switch_event_destroy(&var_event);