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.
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.
You probably need to register (there is not enough information here). Have you done that?
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.
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.