Setting up an Inbound Number with FreePBX can be tricky. There are a few different things to consider and in the past I’ve written some posts for setting up specific call providers. This post will try to describe what the different options mean, and will hopefully help you set up a DDI number with any provider.
The first thing you need to know is that all SysAdminMan templates have “Allow Anonymous Inbound SIP Calls” set to No. This means that an unknown SIP server can not pass a call to your system to be processed. This is to help prevent hackers route calls through your system. It’s strongly recommended that you leave Anonymous SIP calls set to No, unless you really know what the implications are when setting it to Yes.
So, if we don’t let any SIP servers pass calls to us then we need a way to tell FreePBX to allow calls from our DDI provider. We do this by setting up a SIP trunk.
Setting up a SIP trunk
We are going to put all of the settings under “Outgoing settings”, and leave “Incoming settings” blank. This is a little confusing to say the least! but we are not creating a user on our system for the call provider to connect to, we are just allowing their IP. So we add a new SIP trunk and see these details –
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 –
yum -y install tcpdump
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 –
Assigning an inbound number to a customer is fairly easy to achieve in A2Billing. Once assigned the customer can use the web interface to change the destination of that inbound number.
First you are going to need an inbound number from a DID/DDI provider. I’m going to use DIDX.net in this example.
We need to set the SIP URI destination for the inbound number with our DDI provider. In the DIDX control panel I’ve set the destination of a London DDI (country code 44 / city code 20) to my demo server –
Please note that if using Asterisk 1.6 or later the pipe (|) symbols below need changing to commas (,)
There are several reasons you may want to integrate FreePBX and A2Billing. Whether you’re just using FreePBX to setup trunks for your a2billing calling card system or you use FreePBX and want to route the outbound calls via a2billing to do least cost routing.
There are 2 things you need to do to integrate the two. The first is to add the following to extensions_custom.conf
One of the great things about voip is that you can make international calls at local rates. Combine that with Asterisk/FreePBX and you’ve got the ability to make cheap international phone calls using your mobile phone.
To do this we’re going to setup DISA (Direct Inward System Access). This will enable us to ring our Asterisk server, get a dial tone and then dial back out again.
Then I will show you how you can combine this with callbacks if that works out cheaper for you.
Installing the modules
First we need to install the DISA (if it’s not installed already) and Callback modules. See part 5 for more information about installing FreePBX modules.
Setting up an IVR (or auto attendant, digital receptionist) is great idea for small businesses. You can have a single external number for your customers to call but then direct the call to the right department via a simple menu.
First we need some extensions to put the calls through to, then we need to record the menu the caller will hear and finally setup the actual IVR.
Configuring the extensions
Follow the instructions in part 2 to create the extensions that you need. I have created extensions for Sales, Support and Billing
Now we can make calls to regular telephone number via our trunk we want to setup a DID (Direct Inward Dial) number so that we can receive calls from people dialing a regular phone number.
For this example I’m going to use a US number from IPKall who will provide a (free) US based telephone number. However, they are only able to do this due to a peculiarity in the law in certain states so I wouldn’t rely on the numbers being available in the future. Perfect for testing though!