fix proxy-media issue regression

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15181 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-10-20 17:03:03 +00:00
parent f489f91e00
commit 66866fb1ea
4 changed files with 24 additions and 11 deletions

View File

@ -868,7 +868,8 @@ CF_STOP_BROADCAST - Signal to stop broadcast
typedef enum {
CC_MEDIA_ACK = 1,
CC_BYPASS_MEDIA = 1,
CC_BYPASS_MEDIA,
CC_PROXY_MEDIA,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
CC_FLAG_MAX
} switch_channel_cap_t;
@ -914,6 +915,7 @@ typedef enum {
CF_ORIGINATOR,
CF_XFER_ZOMBIE,
CF_MEDIA_ACK,
CF_THREAD_SLEEPING,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
CF_FLAG_MAX
} switch_channel_flag_t;

View File

@ -523,6 +523,7 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
tech_pvt->channel = switch_core_session_get_channel(session);
switch_channel_set_cap(tech_pvt->channel, CC_MEDIA_ACK);
switch_channel_set_cap(tech_pvt->channel, CC_BYPASS_MEDIA);
switch_channel_set_cap(tech_pvt->channel, CC_PROXY_MEDIA);
switch_core_session_set_private(session, tech_pvt);

View File

@ -507,19 +507,25 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
if (switch_channel_test_cap(peer_channel, CC_BYPASS_MEDIA)) {
switch_channel_set_flag(peer_channel, CF_PROXY_MODE);
if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
switch_channel_set_flag(peer_channel, CF_PROXY_MEDIA);
if (switch_channel_test_flag(channel, CF_VIDEO)) {
switch_channel_set_flag(peer_channel, CF_VIDEO);
}
}
switch_channel_set_flag(peer_channel, CF_PROXY_MODE);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"%s does not support the proxy feature, disabling.\n",
switch_channel_get_name(peer_channel));
switch_channel_clear_flag(channel, CF_PROXY_MODE);
}
}
if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
if (switch_channel_test_cap(peer_channel, CC_PROXY_MEDIA)) {
switch_channel_set_flag(peer_channel, CF_PROXY_MEDIA);
if (switch_channel_test_flag(channel, CF_VIDEO)) {
switch_channel_set_flag(peer_channel, CF_VIDEO);
}
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"%s does not support the proxy feature, disabling.\n",
switch_channel_get_name(peer_channel));
switch_channel_clear_flag(channel, CF_PROXY_MEDIA);
}
}
@ -703,7 +709,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_se
status = SWITCH_STATUS_SUCCESS;
}
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE)) {
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || switch_channel_test_flag(session->channel, CF_THREAD_SLEEPING)) {
switch_core_session_wake_session_thread(session);
}
}

View File

@ -381,8 +381,10 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
switch_core_session_receive_message(session, message);
message = NULL;
}
switch_channel_set_flag(session->channel, CF_THREAD_SLEEPING);
switch_thread_cond_wait(session->cond, session->mutex);
switch_channel_clear_flag(session->channel, CF_THREAD_SLEEPING);
while (switch_core_session_dequeue_message(session, &message) == SWITCH_STATUS_SUCCESS) {
switch_core_session_receive_message(session, message);