Summary:ASTERISK-20724: Fix natdetected flag being set when VIA doesn't include port in address
Reporter:Michael L. Young (elguero)Labels:
Date Opened:2012-11-25 22:27:30.000-0600Date Closed:2012-11-29 15:51:45.000-0600
Versions:11.0.1 Frequency of
Environment:Attachments:( 0) asterisk-20724-set-port-v2.diff
Description:While troubleshooting another issue, came across this message in the debug log:

[2012-11-25 19:07:25] DEBUG[13375][C-00000007]: chan_sip.c:17910 check_via: NAT detected for /
Sending to (NAT)

Upon looking at the code in check_via, I discovered that if the port is not set on the address in the VIA header, the default SIP port is not being set on the tmp ast_sockaddr used to check if the requesting UA might be behind NAT.
Comments:By: Michael L. Young (elguero) 2012-11-25 22:29:29.480-0600

Attached patch sets the port to the standard SIP port if a port is not specified in the VIA header.