提交 fe94138a authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Brian West

FS-8320 #resolve [ZRTP broken in commit 06c56a03]

上级 393ee022
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<!-- Test each port to make sure it is not in use by some other process before allocating it to RTP --> <!-- Test each port to make sure it is not in use by some other process before allocating it to RTP -->
<!-- <param name="rtp-port-usage-robustness" value="true"/> --> <!-- <param name="rtp-port-usage-robustness" value="true"/> -->
<param name="rtp-enable-zrtp" value="false"/> <param name="rtp-enable-zrtp" value="true"/>
<!-- <param name="core-db-dsn" value="pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE'" /> --> <!-- <param name="core-db-dsn" value="pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE'" /> -->
<!-- <param name="core-db-dsn" value="dsn:username:password" /> --> <!-- <param name="core-db-dsn" value="dsn:username:password" /> -->
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
#define WARN_SRTP_ERRS 10 #define WARN_SRTP_ERRS 10
#define MAX_SRTP_ERRS 100 #define MAX_SRTP_ERRS 100
#define NTP_TIME_OFFSET 2208988800UL #define NTP_TIME_OFFSET 2208988800UL
#define ZRTP_MAGIC_COOKIE 0x5a525450
static const switch_payload_t INVALID_PT = 255; static const switch_payload_t INVALID_PT = 255;
#define DTMF_SANITY (rtp_session->one_second * 30) #define DTMF_SANITY (rtp_session->one_second * 30)
...@@ -5077,7 +5078,8 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t ...@@ -5077,7 +5078,8 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
if (*bytes) { if (*bytes) {
b = (unsigned char *) &rtp_session->recv_msg; b = (unsigned char *) &rtp_session->recv_msg;
rtp_session->has_rtp = (rtp_session->recv_msg.header.version == 2); /* version 2 probably rtp, zrtp cookie present means zrtp */
rtp_session->has_rtp = (rtp_session->recv_msg.header.version == 2 || ntohl(*(int *)(b+4)) == ZRTP_MAGIC_COOKIE);
if ((*b >= 20) && (*b <= 64)) { if ((*b >= 20) && (*b <= 64)) {
rtp_session->dtls->bytes = *bytes; rtp_session->dtls->bytes = *bytes;
...@@ -5085,7 +5087,6 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t ...@@ -5085,7 +5087,6 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
rtp_session->has_ice = 0; rtp_session->has_ice = 0;
rtp_session->has_rtp = 0; rtp_session->has_rtp = 0;
rtp_session->has_rtcp = 0; rtp_session->has_rtcp = 0;
} else if (*b == 0 || *b == 1) { } else if (*b == 0 || *b == 1) {
rtp_session->has_ice = 1; rtp_session->has_ice = 1;
rtp_session->has_rtp = 0; rtp_session->has_rtp = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论