a few twiax for early media (part 1)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3992 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-01-19 01:36:20 +00:00
parent b25743c4d1
commit d89c21fda4
1 changed files with 15 additions and 10 deletions

View File

@ -1033,8 +1033,12 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
case IAX_EVENT_TIMEOUT:
break;
case IAX_EVENT_ACCEPT:
if (tech_pvt) {
tech_media(tech_pvt, iaxevent);
if (channel && !switch_channel_test_flag(channel, CF_ANSWERED)) {
if (tech_media(tech_pvt, iaxevent) == SWITCH_STATUS_SUCCESS) {
switch_channel_set_flag(channel, CF_EARLY_MEDIA);
} else {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Call accepted.\n");
break;
@ -1047,8 +1051,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
case IAX_EVENT_ANSWER:
// the other side answered our call
if (channel) {
tech_media(tech_pvt, iaxevent);
if (tech_media(tech_pvt, iaxevent) == SWITCH_STATUS_SUCCESS) {
if (switch_channel_test_flag(channel, CF_ANSWERED)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "WTF Mutiple Answer %s?\n", switch_channel_get_name(channel));
@ -1056,7 +1059,9 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Answer %s\n", switch_channel_get_name(channel));
switch_channel_mark_answered(channel);
}
} else {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
}
break;
case IAX_EVENT_CONNECT: