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!
Singing up with IPKall
First thing you need to do is sign up for a number by visiting their web site – http://www.ipkall.com
Fill out the details as below –
Sip Phone Number – I’m going to use ‘1111’ for now but I will change this once I know what DID number I’ve been assigned
SIP Proxy – This should be the ip address or DNS name of your Asterisk/FreePBX server
Once you get e-mailed your account details log back into the IPKall website
Now, change the “SIP Phone Number” to match the DID you have been assigned (without the dashes)
Setup inbound route in FreePBX
Click on Inbound Routes on the left hand main menu
I used “IPKall” for the description
Enter your IPKall DID number in the “DID Number” box
Scroll down to the bottom of the page and set the destination of the call to the extension you setup in part 2
Now click Submit
Because our Asterisk box is not “Registered” with IPKall Asterisk will treat calls coming from it as “Anonymous”. To allow for this we have to turn on “Allow Anonymous Inbound SIP Calls”
To do this click on General in the main menu and scroll down to the bottom of the page. Here you can set “Allow Anonymous Inbound SIP Calls” to “yes” and click “Submit Changes”
Setting “Allow Anonymous Inbound SIP Calls” to Yes is potentially unsafe. It gives attacks a chance to connect to your server via SIP in an attempt to compromise it. Please see here for more information – http://sysadminman.net/blog/2011/sip-scanning-attacks-freepbx-allow-anonymous-3276
As always click “Apply Configuration Changes” and give it a go. If you ring you IPKall telephone number your extension 1000 should ring!