INVITE has wrong Sent-by Address - preventing returning RTP

Fpbx 13/Asterisk 11 with no return inbound audio. This is a ported config from my current FPBX 12 with Asterisk 1.8 (I upgraded 12-to-13). The current NAT config has been correctly working for several years and yet when I compare packet traces from the current (working) PBX with the new one, I see a problem that explains why no RTP can return. All traffic from this box gets nat’ted to a fixed outside address and vice versa on the return of course. The SIP exchanges works fine on the correct address which confirms the NAT. But for some reason the INVITE uses the incorrect address in Message Header->Via: where it shows the external address to be the external default gateway, not the external address specifically assigned to the PBX. I don’t even know where it gets that address. I looked carefully through the config - the NAT settings imported correctly. I even searched the asterisk database to see if the incorrect IP was lurking there somewhere but it’s not. So Asterisk is obtaining this external address somehow on its own. Where does it get this?

The Via headers will not affect the audio path. What IP addresses are in the SDP?

The SDP also has the wrong IP address in 2 places as follows:

Owner Address: wrong.ip.address
Connection Information ©: IN IP4 wrong.ip.address

I checked the NAT rules and ALL traffic from this internal address leaves/returns at the correct external address. All I can figure is that when I first put this box together just on the default NAT, it captured the default address somehow. Even after flushing ARP caches and rebooting router and PBX - just to be sure to clear any cached information - it still is using this. Within SIP, where does it look for the address used to populate this packet data? The config is a direct drop from the current machine which does not exhibit this behavior.

Have any router nat settings changed? Can you manually enter the IP under Asterisk SIP/Chan SIP settings in FreePBX?

@necits2015 - I think you may have given me a clue. Under NAT settings the correct external address is explicitly stated but under ChanSIP settings the external address is determined by a DDNS. While the DDNS returns the correct address now, it may have been set during the setup phase while the new box was on the default network, and been wrong when I tested last night. I would think that the ddclient settings would not permit an incorrect DDNS address for very long without updating, but it certainly looks like something to examine. Would SIP derive the packet data for host address from the ChanSIP (ddns) entry rather than the SIP (explicit) entry? If so, this must be the root of the issue. Many thanks!

Yes, that was it - and it got me again. Apparently when I placed my old working PBX on an alternate internal IP, ddclient was still running and updating the DDNS with the default. The next time I was sure to stop ddclient before changing the IP and calls are working. Now I have to figure out what fpbx did with my voicemail settings - all the users have blank voicemail settings. Thanks again.