SIP Trunk Register String Not Using Outboundproxy Value

I have an issue with a sip trunk configuration. I have to use an outbound proxy and the registration string also needs to go to the proxy and not main domain. However the user name needs to be formatted like the main domain. Here is my issue.

Registration string needs to look like this: XXXXXXXXXX:[email protected]
But the registration string needs to be sent to Proxy.Domain.com

My PEER Details have the following values, the outbound calls are trying to go to the proxy defined. However, the registration attempts are going to Domain.com and not Proxy.Domain.com.

username=XXXXXXXXXX
type=friend
trustrpid=yes
sendrpid=no
secret=PASSWORD
qualify=yes
outboundproxy=Proxy.Domain.com
port=5060
nat=yes
keepalive=45
insecure=port,invite
host=Domain.com
fromuser=XXXXXXXXXX
fromdomain=Domain.com
dtmfmode=rfc2833
disallow=all
directmedia=no
context=from-pstn-toheader
allow=ulaw

This is a limitation of chan_sip that AFAIK will not be fixed.

There is a workaround: Look up the IP address corresponding to Proxy.Domain.com (for example by pinging it). Add a line to /etc/hosts to map Domain.com to that address. For example, if Proxy.Domain.com resolves to 1.2.3.4, then your added line should be
1.2.3.4 Domain.com

A disadvantage of this method is that if the provider has multiple servers at different IP addresses (for failover, load balancing, etc.), your system will use only one.

The proper fix is to set up a pjsip trunk.

register => [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry]

Those are the full options for your register string. Yours is formatted wrong for what you need.

user@domain:secret@proxy_host:port/extension

That’s pretty much it.

@BlazeStudios, thanks for the help. Your answer seems to have been the fix I wanted. I didn’t try messing with the hosts file as I would probably forget that this was done at a later time.

@BlazeStudios is correct; you should not fudge the hosts file for this situation. It was needed when the provider required @domain as part of the username and authuser text strings (in addition to outbound proxy) and I failed to notice that your trunk does not have such a requirement. My apology.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.