git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10556 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-11-27 04:02:57 +00:00
parent 1576530c3e
commit 7bc685dcca
3 changed files with 18 additions and 7 deletions

View File

@ -488,6 +488,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(_In_ switch_channe
#define switch_channel_media_ready(_channel) ((switch_channel_test_flag(_channel, CF_ANSWERED) || switch_channel_test_flag(_channel, CF_EARLY_MEDIA)) && !switch_channel_test_flag(_channel, CF_PROXY_MODE))
SWITCH_DECLARE(void) switch_channel_audio_sync(switch_channel_t *channel);
/** @} */
SWITCH_END_EXTERN_C

View File

@ -166,6 +166,19 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel_t *c
return channel->hangup_cause;
}
SWITCH_DECLARE(void) switch_channel_audio_sync(switch_channel_t *channel)
{
if (switch_channel_media_ready(channel)) {
switch_core_session_message_t msg;
msg.message_id = SWITCH_MESSAGE_INDICATE_AUDIO_SYNC;
msg.from = channel->name;
switch_core_session_receive_message(channel->session, &msg);
}
}
SWITCH_DECLARE(switch_call_cause_t) switch_channel_cause_q850(switch_call_cause_t cause)
{
if (cause <= SWITCH_CAUSE_INTERWORKING) {
@ -1689,13 +1702,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
switch_core_session_execute_application(channel->session, app, arg);
}
if (switch_channel_media_ready(channel)) {
switch_core_session_message_t msg;
msg.message_id = SWITCH_MESSAGE_INDICATE_AUDIO_SYNC;
msg.from = channel->name;
switch_core_session_receive_message(channel->session, &msg);
}
switch_channel_audio_sync(channel);
return SWITCH_STATUS_SUCCESS;
}

View File

@ -52,6 +52,8 @@ 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);
for (;;) {
now = switch_timestamp_now();
elapsed = (int32_t) ((now - start) / 1000);