I got a DID from buydidnumber.com. They instruct to set up either a sip or iax trunk to allow calls to the DID being forwarded to my own voip server, on a specific extension. I need a little help here, because it does not work and I don’t know what to do. I am using FreePBX 15.
They instruct to create 2 sip trunks, with the following settings:
The “very” option for “insecure” hasn’t existed for many years, so you will get the default behaviour that is to challenge the provider for a password, Providers generally will not honour such requests. However if you tried “insecure=port,invite”, that is not the problem, even though it is most likely that port just adds to the insecurity.
I hope it is obvious that context should not be from-buydid, unless you have written custom dialplan, which eventually leads to the extension for your DID in the from-pstn context. They have basically re-used their raw Asterisk configuration for FreePBX, without taking account of how FreePBX is expected to be used.
With type=peer, Asterisk will not be able to distinguish between the two trunks. There is no way that the provider will be able to work out which trunk you used for outgoing calls. If the actual distinction is made on the DID, you only need to configure one trunk. I hadn’t noticed the IP addresses differed
You probably need to register (there is not enough information here). Have you done that?They are IP matched.
In some versions of Asterisk “allow=all” completely breaks, and there is a real risk that it will result in UDP packets that are too big. Which version of Asterisk and FreePBX are you using. As of yesterday, the Asterisk version should really be at least 18. Which version of Asterisk are you using. You should disallow all and then allow just the ones you intend to use, probably just the appropriate one of ulaw and alaw for the location of the provider.
Really you should be using chan_pjsip, not chan_sip. This looks like an easy, no registration, outgoing authentication configuration, for chan_pjsip, with a match/permit setting for the two addresses being the only special consideration. It should be possible purely from the GUI.
It is unlikely that nat= needs changing from the defaults.
The above configuration assumes that your PABX is directly on the public internet; if not you need to specify its public address and which sub-networks are within the NAT boundary.
It is a very bad idea to believe provider provide configurations, they are generally out of date and sub-optimal, having been largely copied from others without going back to first principles.
Thank you for your very detailed reply, which helped solve my issue.
I am using Asterisk 16.
First off, I thought providers knew what they are talking about when referring to their own services, obviously I was wrong. Thanks for the eye opener.
This is what I have done to get the service going:
delete both chan_sip trunks originally created
create 2 chan_pjsip, each time entering the IP provided by the provider:
PJSip Settings - General - SIP Server
PJjSip Settings - Advanced - Match (Permit)
No inbound route to route incoming calls to my extension needed.