Removed pjsua requirement to have consecutive RTCP mapped ports, and instead just print log message if mapped RTCP port is not adjacent to mapped RTP port

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1545 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2007-11-03 22:43:23 +00:00
parent 91be4aad89
commit 80eee89556
1 changed files with 20 additions and 1 deletions

View File

@ -22,7 +22,12 @@
#define THIS_FILE "pjsua_media.c"
#define DEFAULT_RTP_PORT 4000
#define DEFAULT_RTP_PORT 4000
#ifndef PJSUA_REQUIRE_CONSECUTIVE_RTCP_PORT
# define PJSUA_REQUIRE_CONSECUTIVE_RTCP_PORT 0
#endif
/* Next RTP port to be used */
static pj_uint16_t next_rtp_port;
@ -299,6 +304,7 @@ static pj_status_t create_rtp_rtcp_sock(const pjsua_transport_config *cfg,
goto on_error;
}
#if PJSUA_REQUIRE_CONSECUTIVE_RTCP_PORT
if (pj_ntohs(mapped_addr[1].sin_port) ==
pj_ntohs(mapped_addr[0].sin_port)+1)
{
@ -311,6 +317,19 @@ static pj_status_t create_rtp_rtcp_sock(const pjsua_transport_config *cfg,
pj_sock_close(sock[1]);
sock[1] = PJ_INVALID_SOCKET;
#else
if (pj_ntohs(mapped_addr[1].sin_port) !=
pj_ntohs(mapped_addr[0].sin_port)+1)
{
PJ_LOG(4,(THIS_FILE,
"Note: STUN mapped RTCP port %d is not adjacent"
" to RTP port %d",
pj_ntohs(mapped_addr[1].sin_port),
pj_ntohs(mapped_addr[0].sin_port)));
}
/* Success! */
break;
#endif
} else if (cfg->public_addr.slen) {