Setting up an Inbound (DID/DDI) number in FreePBX can be tricky. We have to do 2 things to get it to work. First we need to tell FreePBX/Asterisk that the incoming call is allowed, the second is to say what to do with that incoming call.
Lets look at allowing the call first. One of the easiest ways to do this is allow Anonymous SIP Calls in FreePBX. I recommend you do not do this though as you don’t really want Asterisk/FreePBX trying to process any call fired at it.
So if we’re not going to allow anonymous SIP calls we need to tell Asterisk what IPs to allow calls from, and we do this by setting up a trunk. When a call comes to our server we will receive a SIP INVITE from the remote server, asking us to accept the call, so let’s have a look at the SIP INVITE messages coming in …
First we’ll install ‘tcpdump’ if it’s not already on the system. In CentOS we do –
Next we run the following command to list all the INVITE messages coming in. You will need to change the network adapter name if you’re not on a VPS, probably from venet0 to eth0 –