SIP TCP source port Asterisk 1.8.10


I have an issue with setting the source port when using SIP-over-TCP. Server is behind NAT which preserves port numbers.
Modifying various configuration settings I can set the fixed TCP port (26060 for example) in Contact: and Via:, but the actual source address of the IP packet is still random (now it’s 58908). As a result the same random port (58908) is used on the WAN side (again, NAT preserves port numbers), but as soon as I’m registered with port 26060 no incoming calls will be possible as there is no mapping for this port on NAT.
So far I see the only one quick fix - configure port forwarding for 26060/TCP from WAN port to internal Asterisk address, but this is what I want to avoid.
Ideally it will be great to implement something like this:

  • TCP source port should be configurable (the same way as TCP listen port) OR
  • Asterisk should take rport=58908 from the proxy response and put this port number in Contact:

Any help or comment will be appreciated!