diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-09-26 22:06:11 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-09-26 22:06:11 +0000 |
commit | 2fd2c0b8c1027b1b718e876b1cfbdc5340d3017c (patch) | |
tree | f60d8915675019334eb8e09e773fd823136ce202 /pjsip/src/pjsua-lib | |
parent | 19d283967cbc931e9a10c8e401884fecb71dc186 (diff) |
More ticket #643: added setting to disable this ticket (by setting allow_contact_rewrite to 2)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2325 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_acc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c index 9014d162..46a6dd1c 100644 --- a/pjsip/src/pjsua-lib/pjsua_acc.c +++ b/pjsip/src/pjsua-lib/pjsua_acc.c @@ -643,9 +643,13 @@ static pj_bool_t acc_check_nat_addr(pjsua_acc *acc, /* Do not switch if both Contact and server's IP address are * public but response contains private IP. A NAT in the middle * might have messed up with the SIP packets. + * + * This exception can be disabled by setting allow_contact_rewrite + * to 2. In this case, the switch will always be done whenever there + * is difference in the IP address in the response. */ - if (!is_private_ip(&uri->host) && !is_private_ip(&srv_ip) && - is_private_ip(via_addr)) + if (acc->cfg.allow_contact_rewrite != 2 && !is_private_ip(&uri->host) && + !is_private_ip(&srv_ip) && is_private_ip(via_addr)) { /* Don't switch */ pj_pool_release(pool); |