I have the latest FreePBX distro installed on a remote server. I am trying to get the trunk and incoming calls to work, but I can’t. I have been successful with another trunk by another company but with this trunk asterisk simply does not react at all (there is no message in the asterisk cli when I call in). What am I doing wrong?
If it’s a registered SIP trunk, sip show peers from the cli and post - if it’s a PJSIP trunk, pjsip show registrations and pjsip show aors and post those - If they are just pointing traffic at your IP (no registration) then it is most certainly a Firewall issue and you need to add the IP range for the carrier to your Trusted zones under the Firewall.
Does the server have a dedicated public IPv4 address (as shown by ifconfig command)? If not, provide details about the cloud service’s firewall.
Does the Contact header of the REGISTER request sent to the trunk have the correct public IP address and port number? If not, check that in Asterisk SIP Settings, External Address and Local Networks are correctly set. If you change these, restart Asterisk.
Run sngrep and attempt an incoming call. Does the provider’s INVITE appear? If so, the FreePBX firewall is probably blocking it.
What gets logged at the provider when a call is attempted (most have a way to show failed calls in their logs)? If nothing, the DID may be failing in some way, especially if the trunking provider is not the carrier but is reselling a carrier’s service.
Many providers allow you to route calls other than to SIP, e.g. forward to a mobile number or to a voicemail box. This allows you to confirm that the DID is working, even if the PBX is not responding.
If sngrep shows no packets arriving, then no packets are being sent to your PBX, sngrep reports reveals ‘kernel level’ traffic, so something between your PBX and the VSP is not configured correctly, any routers and firewalls need to route and ‘send’ (not firewall) any traffic.
Some providers don’t have a fixed relationship between DIDs and trunks/accounts. On their portal, you must configure the DID to be sent where you want.