提交 d29cd789 authored 作者: Anthony Minessale's avatar Anthony Minessale

slowly unbreak things broken since the 'break everything' commit

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@742 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 983403ad
......@@ -575,7 +575,11 @@ SWITCH_DECLARE(switch_status) switch_channel_pre_answer(switch_channel *channel)
msg.message_id = SWITCH_MESSAGE_INDICATE_PROGRESS;
msg.from = channel->name;
status = switch_core_session_message_send(uuid, &msg);
switch_channel_set_flag(channel, CF_EARLY_MEDIA);
if (status == SWITCH_STATUS_SUCCESS) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Pre-Answer %s!\n", channel->name);
switch_channel_set_flag(channel, CF_EARLY_MEDIA);
}
return status;
}
......
......@@ -857,9 +857,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_se
}
}
}
} else {
status = SWITCH_STATUS_SUCCESS;
}
}
return status;
}
......
......@@ -862,7 +862,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
int stream_id = 0;
switch_frame *read_frame;
caller_channel = switch_core_session_get_channel(session);
assert(caller_channel != NULL);
......@@ -896,6 +896,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
switch_channel_add_state_handler(peer_channel, &audio_bridge_peer_state_handlers);
switch_core_session_thread_launch(peer_session);
for (;;) {
int state = switch_channel_get_state(peer_channel);
if (state > CS_RING) {
......@@ -904,16 +905,23 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
switch_yield(1000);
}
switch_channel_pre_answer(caller_channel);
time(&start);
while (switch_channel_ready(caller_channel) &&
switch_channel_ready(peer_channel) &&
!switch_channel_test_flag(peer_channel, CF_ANSWERED) &&
!switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA) &&
((time(NULL) - start) < timelimit)) {
if (switch_core_session_read_frame(session, &read_frame, 1000, 0) != SWITCH_STATUS_SUCCESS) {
break;
/* read from the channel while we wait if the audio is up on it */
if (switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
if (switch_core_session_read_frame(session, &read_frame, 1000, 0) != SWITCH_STATUS_SUCCESS) {
break;
}
} else {
switch_yield(1000);
}
switch_yield(1000);
}
if (switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论