diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-11-03 22:43:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-11-03 22:43:23 +0000 |
commit | 6545c53b3a859d5a64d1fb086c518676313bdfb8 (patch) | |
tree | f61a82e27fd0fc4bc1940e11a1c0929655609cfe /pjsip | |
parent | 8105ae9870a6e6c0ef335588914d74aa4d08c9a1 (diff) |
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: http://svn.pjsip.org/repos/pjproject/trunk@1545 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_media.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index f6424353..5fa16462 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -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) { |