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.
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.
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.
@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.