I’ve purchased a sip trunk with OVH and it will not register on one of my pbx.
I was able to register the account on another pbx and 2 softphones, one of which is on the same network as the problematic pbx. The softphone that registered is zoiper and when checking the logs i have the following;
@jmarc Is this a Chan_SIP trunk? By default Chan_SIP is binded to 5061 and Chan_PJSIP is on 5060. If you are trying to use a Chan_SIP trunk and you did not swap the bind ports in Asterisk SIP Settings then using 5060 isn’t going to work.
If OVH isn’t being a NAT then you need to set nat=no in the trunk settings.
Try that setting. Also, are you seeing the PBX respond to the 401 Unathorized challenge? Don’t see that in your debug details.
First - Version information is really, really important when we try to help you.
Second - If you are using FreePBX with Asterisk 13, we need to identify how you are connecting. There are two choices: PJSIP and Chan-SIP.
It is perfectly reasonable to set up the system so that Chan-SIP is on 5060 and PJSIP is on 5061, or vice versa, or some other configuration, but not having the SIP module is pointed to the right port. You’ve never even told us if you are using Chan-SIP or PJSIP, so us sending you code to blindly use is more than useless, it’s a complete waste of everyone’s time.
What version information can you share with us?
Are you using PJSIP or Chan-SIP for your trunk connections?
How are your ports configured?
Are you running behind a firewall?
Have you set up the general SIP settings?
Have you set up the Chan-SIP (or PJSIP) specific configuration to handle you NAT (assuming you are using it)?
Is your firewall set up to redirect incoming port traffic on 5060 (or whatever inbound port you are using) to your PBX server?
401 Unauthorized means many things, but the most common are misspelled passwords or usernames.
Turn off anonymous inbound, especially if you are using port 5060. Allow SIP guests should be turned off as well. These are really dangerous (as in ridiculously expensive) if left on and the a$$wipes on the Internet find them.
On the SIP Settings page, the public address should be in the public address spot and the local address should contain your local (internal net) address, which it sounds like you are doing. With NAT turned on here, you should be fine.
NAT definitively needs to be on, but that is really critical only for outbound connections (this is how the remote machine figures out how to get your traffic back to you).
In your Trunk Configuration:
I’d leave “fromdomain=siptrunk.ovh.net” out unless OVH asks you to include it. “nat=yes” is required for your firewall.
I know lots of people here like the SIP debug output, but I find that the logs tell me what I need to know most of the time. Try posting the log entries for a SIP connection and let’s see what that tells us.
When you are setting up a SIP trunk to connect to the provider, the setting nat=yes/no is related to the endpoint you are connecting too. So when you have nat=yes in your trunk settings, you are telling the system “This trunk I’m registering to is behind NAT so I need to treat their data that way.”