Getting started with FreePBX – Part 3 Making external calls

This article assumes you have completed part 1 and part 2

So we have configured our trunk and our extension and now we need to tell FreePBX to use that trunk when someone dials a number. This is done by creating an Outbound Route.

The configuration below also takes in to consideration the fact that I am in the UK and that callcentric is a US company. Your setup may differ.

Creating an outbound route

First we need to click on “Outbound Routes” in the main menu on the left hand side of the screen

screenshot-2_28_2009-2_14_24-pm

Now we need to create the route. Give it a name – I’ve called mine “external”

Now we need to enter a “Dial Pattern”. This is what decides if this route is used or not.¬† You can hover your mouse over “Dial Patterns” to get a description.

I have entered “0.” as my dial pattern. This means that if an extension/user dials any number beginning with 0 (zero) it will use the trunk selected.

Now select “SIP/callwithus” to be your destination trunk and click “Submit Changes”

screenshot-2_28_2009-2_18_29-pm

Now, because I’m in the UK I’m going to create a “Dial Rule” on my trunk. So click on “Trunks” on the left hand menu and select our trunk “SIP/callwithus” on the right hand menu.

I’ve created 1 rule and this is what it does –

0044+0|Z.¬† – if someone dials a number that starts with 0 followed by another number that’s not a 0 then remove the first zero and adds 0044 to the front of the number. Basically this turns a local UK number into the international equivalent. So “0800 123 4567” becomes “0044 800 123 4567”.¬† I need this because callwithus is a US based provider and needs to be told to dial a UK number as an “International” number.

screenshot-2_28_2009-2_56_27-pm

Scroll down to the bottom and click “Submit Changes”

screenshot-2_28_2009-2_25_53-pm

Now you should be able to go to your extension and dial an external number. Either a national UK one or an international  number, by using 00 as the international prefix

screenshot-2_28_2009-2_38_03-pm

18 thoughts on “Getting started with FreePBX – Part 3 Making external calls

  1. sana

    Hi,

    I have a quick question. According the configuration my asterisk server running on 192.168.1.102. I can successfully communicate internal calls via X-lite. However, I cannot make any outbound call or inbound call from ipkall. Do I need to do anything about my home router to call make outside? For ipcall configuration, I gave my IP address to SIP proxy but cannot revived call. Server is connected through lynksis WRTSL54GS router. Thank for your help.

  2. matt Post author

    There are a couple of things you probably need to do. The first is to tell the outside world what your external IP is. You can do that with the externip command, see here for details – http://www.voip-info.org/wiki/view/Asterisk+SIP+externip The second is to forward some ports in your firewall. You will probably need ports for SIP and RTP forwarded to your Asterisk server. You should be able to figure out the ports you need here – http://www.voip-info.org/wiki/view/Asterisk+firewall+rules.

    Running an Asterisk server behind a NAT firewall can definitely be a pain!

  3. sana

    Hi Matt:

    Thanks for your help. I have successfully configured NAT and firewall, then, I can call from IPKALL number(inbound). However, I cannot call from my x-lite to outbound. I have did same config. as u did for callwithus. Gave me – Call fail: 503 service unavailable. Do you have any idea? . My balance is 0 in callwitus account. Thanks for your all support.

  4. matt Post author

    Did you try adding some funds to you callwithus account. I’m not sure what numbers you can call with a zero balance?

  5. jordan diment

    Dear All.

    I am using free PBX and want to block mobile calls so only allow 01, 02 to be made on the system.
    can anyone please advise the best way to do this?

    Cheers

    Jordan

  6. matt Post author

    Hi Jordan,

    You can easily do this on your Outbound Routes in FreePBX. Check out the help for ‘Dial Patterns’ as these are what decides which calls are completed using that route.

  7. matt Post author

    Not to run the voice part of the call over no. You would need either an FXO card for your server, or an FXO gateway.

    If you mean to run the voip part of the call over (instead of broadband) then you could but the latency would probably be too high.

  8. Haitham

    Thank you for your reply
    What I need is to make calls from sip phones “X-lite” to analog phones and receive calls from analog phones to either sip phones or analog phones.
    I checked many pages but I got confused. Is the ordinary computer modem is capable to perform this function, even with weak performance? I just want to test this to take decision whether I will use the freepbx or not.
    Thanks a lot

  9. matt Post author

    No, I’m afraid that will not work. You need an fxo card/gateway.

    Or you could look at a SIP service such as voip.ms. FreePBX connects to an ITSP like this and will pass and receive calls to the PSTN, normal telephone network.

  10. Hammad

    Hi Matt,

    Hope you are well. I’ve installed and setup a FreePBX with two NIC. One for external access and one for Internal access.

    I setup a trunk and a user extension. The FreePBX system status shows the trunk as registered and online aswell as the user extension. when I place a call via x-lite the active calls and external call shows green at the system status screen. but x-lite says failed to establish call. Any idea what I’m doing wrong?

    Any help will be appriciated.

    Regards

    Hammad

  11. matt Post author

    My guess would be your Outbound Route is not correct or your trunk is not setup correctly. The only was to tell unfortunately is to turn on some Asterisk debugging and see what happens to the call.

  12. Ahmed

    Hi All,
    Many thanks for your posts for replyes, it’s really helpfull all of your answers, Basically, I’m getting some problems, to making external calls thers is no RBT or Dial tone and also not geting B party voices. When I do extention to extention calls then everthing fine in both side voice.
    My asterisk is running public IP and we are using extention in different ISP and behind NAT.

    Could you please help ! what is issue !

  13. Matt Post author

    Normally problems with audio like that are caused by NAT issues. You should google for “Asteirsk SIP ALG” for an explanation as to the issue.

    SIP ALGs can often be turned off.

  14. levani

    Hi, i have some problem with outbound call,
    i have three trunk and three outbound route (with tree phone number) and from this 3 trunk I want that only one trunk be able to call mobile.
    can onyone help me?

  15. Matt Post author

    Hi there. You can do this with the outbound routes. You can create a route for mobiles numbers to use the specific trunk – and put it above the other trunks in the list.

  16. Matt Post author

    I’m not totally sure what you are trying to do but users will only by able to make calls to numbers that match the pattern in the outbound route. So if you are trying to disallow users from calling certain numbers make sure that number is not matched by the outbound route.

    Check out the help for the “Match Pattern” box. There you can create quite complex rules to only match certain numbers.

Comments are closed.