Getting started with FreePBX – Part 4 Setting up a DID number

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

screenshot-3_1_2009-10_54_02-am

Once you get e-mailed your account details log back into the IPKall website

screenshot-3_1_2009-10_57_44-am

Now, change the “SIP Phone Number” to match the DID you have been assigned (without the dashes)

screenshot-3_1_2009-10_58_59-am

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

screenshot-3_1_2009-11_01_31-am

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

screenshot-3_1_2009-11_02_01-am

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

screenshot-3_1_2009-11_15_24-am

As always click “Apply Configuration Changes” and give it a go. If you ring you IPKall telephone number your extension 1000 should ring!

screenshot-3_1_2009-11_15_39-am




Related posts:
  1. Getting started with FreePBX – Part 2 Setting up an extension
  2. Getting started with FreePBX – Part 1 Setting up a trunk
  3. Getting started with FreePBX – Part 5 Setting up an IVR

8 Comments

  1. elmohem:

    I did what in this tutorial but my extension ringing and when answer the call is disconnect directly.
    How to solve this problem?
    Elmohem

  2. matt:

    It could be that the voice stream is being blocked by a firewall (UDP port 5060) or that NAT is messing things up. Do you know if your Asterisk server or Extension is behind a NAT router?

  3. Av:

    I did what in this tutorial but my extension is not ringing, I couldn`t hear no sound. Please help me out here.
    Thanks

  4. matt:

    I’m afraid it’s difficult to say without any more info. Are you using a ditro or did you install Asterisk/FreePBX yourself? Could it be iptables/firewall blocking the traffic? Can you make extension to extension calls?

  5. Av:

    Hi Matt,
    Thanks for the quick reply, Now I made it work. not with ipkall, but the same number which I used in Trunk. So now I am using same number for Inbound and Outbound Call for callback. when I dial the DID number, it says “the person is busy, leave message“, when I hung up then I am getting my call back but I wanted to hear busy tone instead so I wont get charge. Is there any way to hear busy tone instead message. Sorry for my bad english :)

    Thanks again

  6. matt:

    do you have voicemail turned on for the extension the calls are going to?, and how are you doing the callback? with the FreePBX callback module?

  7. dinesh:

    I am using ipkall number in inbound and i want use it in call back system but when i call from my cell number to this it does not call back me and when i use this number to forward on extension i see the incoming number different. It does not show my cell number in incoming number. How it will show the exact incoming number? Thanks for your support in advance

  8. matt:

    The format that the caller ID is presented varies between different providers. Sometimes you need to check in the logs to see the format it is coming as. You could accept all calls initially and then check the CDR to see the format.

    You may need to manipulate the number on the outound route to get the outbound call back to work.

Leave a comment