Change Contact Header to use Domain

some1has2

New Member
Dec 19, 2025
4
0
1
Canada
I've browsed around the documentation and forums for the solution but cannot see anything relevant to my issue besides threads like No Outbound Calling Inbound Works which do show similar symptoms like call-id: null and rejected error messages, so I'm hoping this is an easy solve and will help future people searching.

What do I set in FusionPBX to make outgoing calls use the domain in the contact instead of the IP?

My provider requires that the contact header contains the exact domain or IP set in the SIP Binding for their trunk. This means when I setup the Gateway to bind everything to my IP 1.2.3.4 it works nicely like:
`Contact: <sip:guid@1.2.3.4:5080;transport=udp;gw=guid>`
but when I change everything to use my domain instead, it still sends the above style of contact, where I need to send
`Contact: <sip:guid@mypbxdomain.com:5080;transport=udp;gw=guid>`
or it gets rejected due to forbidden 403

I tried experimenting with all sorts of values like setting ext-sip-ip to the domain but couldn't figure it out.
 
I know this doesn't help but this is really a deficiency in the carrier. The whole idea of the contact header is that you are telling the remote end that this is the address you wish to be contacted on. There will be a way, let me have a dig.
 
Thanks for looking DigitalDaz!

Yeah I figured it was silly on the carrier side because you could set that header to anything and we already have passwords and a remote binding on their side for incoming (which works) so this extra validation/verification seems pointless.

Anyway I did see other people posting with other general help issues mentioning with snippets like @domain instead of @ip so I figured this was not an uncommon setting and I just did something wrong. But I dug through source code and Freeswitch docs and didn't readily see how the final outgoing leg string is constructed.
My idea was to go into outbound routes and add a new variable in that final list like it does sip_h_accountcode that did something like sip_h_external-sip-ip=mydomain.com, but I couldn't figure it out within a day so it was time to ask for assistance.

For future reference to anyone searching into this thread, I'd also appreciate if you could explain how someone can trace the outgoing Contact/Via strings from FusionPBX or Freeswitch CLI or something ... I had to contact the carrier for the string they saw on their side for `Contact: <sip...` and would love to know/educate others on how to see that on the server side for debugging purposes.
 
Install sngrep if it is not already on your system. Then from the Linux console as user root, you can use this command to see the conversation between the PBX and the provider:
sngrep -c

Another option is to use Wireshark.
 
Well that's super neato thanks kenn10. I can see in my failed call that in the INVITE clearly the contact is:

Code:
Contact: <sip:gw+gateway-guid@pbx-ip:pbx-port;transport=udp;gw=gateway-guid>

and I need to figure out how to make that look like

Code:
Contact: <sip:gw+gateway-guid@pbx-domain:pbx-port;transport=udp;gw=gateway-guid>

note for privacy replacement that:
- gateway-guid looks like 75de016f-6675-4c26-ab7b-26cc5f6c3909
- pbx-ip looks like 1.2.3.4
- pbx-domain looks like google.com
- pbx-port looks like 5080
 
And now that I can more easily see outgoing parameters to debug, I've been trying out https://developer.signalwire.com/fr...info-application-variable-names-variable_xxxx

But things like sip_contact_host and friends don't seem to change anything when I set them in export int outgoing variables ... it does change if I set something like max_forwards so I'm setting in the right spot in outgoing to affect variables

I'll have to spend more time skimming code to see how the contact string is actually built as these variables don't seem to interfere.