add 10 second media timeout waiting for codec establishment MODSOFIA-22

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14586 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-08-21 16:22:16 +00:00
parent 9aa8df3dd9
commit a35dc92e9f
1 changed files with 2 additions and 1 deletions

View File

@ -678,6 +678,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
private_object_t *tech_pvt = switch_core_session_get_private(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
int payload = 0;
uint32_t sanity = 1000;
switch_assert(tech_pvt != NULL);
@ -691,7 +692,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
}
while (!(tech_pvt->read_codec.implementation && switch_rtp_ready(tech_pvt->rtp_session) && !switch_channel_test_flag(channel, CF_REQ_MEDIA))) {
if (switch_channel_ready(channel)) {
if (--sanity && switch_channel_ready(channel)) {
switch_yield(10000);
} else {
return SWITCH_STATUS_GENERR;