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:
parent
b25743c4d1
commit
d89c21fda4
|
@ -1033,8 +1033,12 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
|
||||||
case IAX_EVENT_TIMEOUT:
|
case IAX_EVENT_TIMEOUT:
|
||||||
break;
|
break;
|
||||||
case IAX_EVENT_ACCEPT:
|
case IAX_EVENT_ACCEPT:
|
||||||
if (tech_pvt) {
|
if (channel && !switch_channel_test_flag(channel, CF_ANSWERED)) {
|
||||||
tech_media(tech_pvt, iaxevent);
|
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");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Call accepted.\n");
|
||||||
break;
|
break;
|
||||||
|
@ -1047,8 +1051,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
|
||||||
case IAX_EVENT_ANSWER:
|
case IAX_EVENT_ANSWER:
|
||||||
// the other side answered our call
|
// the other side answered our call
|
||||||
if (channel) {
|
if (channel) {
|
||||||
tech_media(tech_pvt, iaxevent);
|
if (tech_media(tech_pvt, iaxevent) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
|
||||||
if (switch_channel_test_flag(channel, CF_ANSWERED)) {
|
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));
|
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_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Answer %s\n", switch_channel_get_name(channel));
|
||||||
switch_channel_mark_answered(channel);
|
switch_channel_mark_answered(channel);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IAX_EVENT_CONNECT:
|
case IAX_EVENT_CONNECT:
|
||||||
|
|
Loading…
Reference in New Issue