diff options
author | Olle Johansson <oej@edvina.net> | 2006-10-31 10:29:24 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2006-10-31 10:29:24 +0000 |
commit | b136baaff47dabed527153a02b9d995a5710748e (patch) | |
tree | 3ef57edba5e13f7dbd74e099f6a0cf11b21848e6 | |
parent | 97be2ac76fd82a4a6a3656b3a4788a48857a0dd8 (diff) |
Fix rport handling.
...where did the 1.2 properties come from, really? they're back.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 6 | ||||
-rw-r--r-- | configs/sip.conf.sample | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9e752ff09..5a2332417 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5330,7 +5330,8 @@ static int copy_via_headers(struct sip_pvt *p, struct sip_request *req, const st if (rport && *(rport+6) == '=') rport = NULL; /* We already have a parameter to rport */ - if (rport && ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_ALWAYS) { + /* Check rport if NAT=yes or NAT=rfc3581 (which is the default setting) */ + if (rport && ((ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_ALWAYS) || (ast_test_flag(&p->flags[0], SIP_NAT) == SIP_NAT_RFC3581))) { /* We need to add received port - rport */ char tmp[256], *end; @@ -5347,9 +5348,6 @@ static int copy_via_headers(struct sip_pvt *p, struct sip_request *req, const st } /* Add rport to first VIA header if requested */ - /* Whoo hoo! Now we can indicate port address translation too! Just - another RFC (RFC3581). I'll leave the original comments in for - posterity. */ snprintf(new, sizeof(new), "%s;received=%s;rport=%d", tmp, ast_inet_ntoa(p->recv.sin_addr), ntohs(p->recv.sin_port)); diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample index 1d79cb303..85fec8680 100644 --- a/configs/sip.conf.sample +++ b/configs/sip.conf.sample @@ -255,7 +255,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls ; ;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) |