git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9812 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-10-03 18:24:26 +00:00
parent f3b413edf1
commit 6758ff9835
1 changed files with 11 additions and 11 deletions

View File

@ -514,8 +514,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
switch_frame_t *enc_frame = NULL, *write_frame = frame; switch_frame_t *enc_frame = NULL, *write_frame = frame;
unsigned int flag = 0, need_codec = 0, perfect = 0, do_bugs = 0, do_write = 0, do_resample = 0, ptime_mismatch = 0; unsigned int flag = 0, need_codec = 0, perfect = 0, do_bugs = 0, do_write = 0, do_resample = 0, ptime_mismatch = 0, pass_cng = 0;
switch_assert(session != NULL); switch_assert(session != NULL);
switch_assert(frame != NULL); switch_assert(frame != NULL);
@ -523,7 +523,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
if (!(session->write_codec && session->write_codec->implementation)) { if (switch_test_flag(frame, SFF_CNG)) {
if (switch_channel_test_flag(session->channel, CF_ACCEPT_CNG)) {
pass_cng = 1;
}
return SWITCH_STATUS_SUCCESS;
}
if (!(session->write_codec && session->write_codec->implementation) && !pass_cng) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s has no write codec.\n", switch_channel_get_name(session->channel)); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s has no write codec.\n", switch_channel_get_name(session->channel));
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
@ -532,18 +539,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
if (switch_test_flag(frame, SFF_PROXY_PACKET)) { if (switch_test_flag(frame, SFF_PROXY_PACKET) || pass_cng) {
/* Fast PASS! */ /* Fast PASS! */
return perform_write(session, frame, flag, stream_id); return perform_write(session, frame, flag, stream_id);
} }
if (switch_test_flag(frame, SFF_CNG)) {
if (switch_channel_test_flag(session->channel, CF_ACCEPT_CNG)) {
return perform_write(session, frame, flag, stream_id);
}
return SWITCH_STATUS_SUCCESS;
}
switch_assert(frame->codec != NULL); switch_assert(frame->codec != NULL);
if ((session->write_codec && frame->codec && session->write_codec->implementation != frame->codec->implementation)) { if ((session->write_codec && frame->codec && session->write_codec->implementation != frame->codec->implementation)) {