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

This commit is contained in:
Anthony Minessale 2015-10-09 12:57:36 -05:00 committed by Brian West
parent 393ee022b0
commit fe94138aa4
2 changed files with 4 additions and 3 deletions

View File

@ -150,7 +150,7 @@
<!-- 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-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="dsn:username:password" /> -->

View File

@ -71,6 +71,7 @@
#define WARN_SRTP_ERRS 10
#define MAX_SRTP_ERRS 100
#define NTP_TIME_OFFSET 2208988800UL
#define ZRTP_MAGIC_COOKIE 0x5a525450
static const switch_payload_t INVALID_PT = 255;
#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
if (*bytes) {
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)) {
rtp_session->dtls->bytes = *bytes;
@ -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_rtp = 0;
rtp_session->has_rtcp = 0;
} else if (*b == 0 || *b == 1) {
rtp_session->has_ice = 1;
rtp_session->has_rtp = 0;