if (rport && *(rport+6) == '=')
rport = NULL; /* We already have a parameter to rport */
- if (rport && (ast_test_flag(p, SIP_NAT) == SIP_NAT_ALWAYS)) {
+ if (rport && ((ast_test_flag(p, SIP_NAT) == SIP_NAT_ALWAYS) || (ast_test_flag(p, SIP_NAT) == SIP_NAT_RFC3581))) {
/* We need to add received port - rport */
ast_copy_string(tmp, oh, sizeof(tmp));
build_contact(p);
peer = find_peer(name, NULL, 1);
if (!(peer && ast_apply_ha(peer->ha, sin))) {
+ /* Peer fails ACL check */
if (peer)
ASTOBJ_UNREF(peer,sip_destroy_peer);
+ peer = NULL;
}
if (peer) {
if (!ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC)) {
;
;nat=no ; Global NAT settings (Affects all peers and users)
; yes = Always ignore info and assume NAT
- ; no = Use NAT mode only according to RFC3581
+ ; no = Use NAT mode only according to RFC3581 (;rport)
; never = Never attempt NAT mode or RFC3581 support
; route = Assume NAT, don't send rport
; (work around more UNIDEN bugs)