zrtp tweak for sas relay

This commit is contained in:
Brian West 2011-01-11 15:31:33 -06:00
parent 316963c594
commit cf253c35bc

View File

@ -3261,6 +3261,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp
switch_rtp_t *other_rtp_session = switch_channel_get_private(other_channel, "__zrtp_audio_rtp_session"); switch_rtp_t *other_rtp_session = switch_channel_get_private(other_channel, "__zrtp_audio_rtp_session");
if (other_rtp_session) { if (other_rtp_session) {
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) {
switch_mutex_lock(other_rtp_session->read_mutex);
if (zrtp_status_ok == zrtp_session_get(other_rtp_session->zrtp_session, &zrtp_session_info)) { if (zrtp_status_ok == zrtp_session_get(other_rtp_session->zrtp_session, &zrtp_session_info)) {
if (rtp_session->zrtp_mitm_tries > ZRTP_MITM_TRIES) { if (rtp_session->zrtp_mitm_tries > ZRTP_MITM_TRIES) {
switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV);
@ -3277,6 +3279,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp
rtp_session->zrtp_mitm_tries++; rtp_session->zrtp_mitm_tries++;
} }
} }
switch_mutex_unlock(other_rtp_session->read_mutex);
}
} }
switch_core_session_rwunlock(other_session); switch_core_session_rwunlock(other_session);