git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13472 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West 2009-05-27 22:48:16 +00:00
parent ef8ab9c1e7
commit 1900b6c362
1 changed files with 24 additions and 27 deletions

View File

@ -1923,7 +1923,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
#ifdef ENABLE_ZRTP #ifdef ENABLE_ZRTP
/* ZRTP Recv */ /* ZRTP Recv */
if (bytes && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV)) { if (bytes && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV)) {
unsigned int sbytes = (int) bytes; unsigned int sbytes = (int) bytes;
zrtp_status_t stat = 0; zrtp_status_t stat = 0;
@ -2532,7 +2531,6 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
} }
#ifdef ENABLE_ZRTP #ifdef ENABLE_ZRTP
/* ZRTP Send */ /* ZRTP Send */
if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) { if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) {
unsigned int sbytes = (int) bytes; unsigned int sbytes = (int) bytes;
zrtp_status_t stat = zrtp_status_fail; zrtp_status_t stat = zrtp_status_fail;
@ -2813,29 +2811,28 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
bytes = sbytes; bytes = sbytes;
} }
#ifdef ENABLE_ZRTP #ifdef ENABLE_ZRTP
/* ZRTP Send */ /* ZRTP Send */
if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) {
unsigned int sbytes = (int) bytes;
zrtp_status_t stat = zrtp_status_fail;
if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) { stat = zrtp_process_rtp(rtp_session->zrtp_ctx, (void*)&rtp_session->write_msg, &sbytes);
unsigned int sbytes = (int) bytes;
zrtp_status_t stat = zrtp_status_fail;
stat = zrtp_process_rtp(rtp_session->zrtp_ctx, (void*)&rtp_session->write_msg, &sbytes); switch (stat) {
case zrtp_status_ok:
switch (stat) { break;
case zrtp_status_ok: case zrtp_status_drop:
break; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat);
case zrtp_status_drop: break;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat); case zrtp_status_fail:
break; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat);
case zrtp_status_fail: break;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat); default:
break; break;
default:
break;
}
bytes = sbytes;
} }
bytes = sbytes;
}
#endif #endif
if (switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_addr, 0, (void *) &rtp_session->write_msg, &bytes) != SWITCH_STATUS_SUCCESS) { if (switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_addr, 0, (void *) &rtp_session->write_msg, &bytes) != SWITCH_STATUS_SUCCESS) {
rtp_session->seq--; rtp_session->seq--;