AsteriskNOW: Setting up a trunk and outbound calls with Sipgate

This is part 2 of getting started with AsteriskNOW. The first part showed how to create and test an extension and can be found here – http://sysadminman.net/blog/2012/asterisknow-setting-up-an-extension-4235

Now we’re going to set up outbound calling using Sipgate. Sipgate is a Pay As You Go call provider that provide a free geographic number in the UK.

First we need to set up a trunk. A trunk is a connection to an external system, in this case Sipgate, but it could be any call provider that supports SIP. On it’s own the trunk doesn’t do anything, just tells Asterisk about the external system. We will then create Inbound and Outbound routes to tell Asterisk what calls will go via this trunk.

First click Connectivity / Trunks from the main menu –

add trunk

Next click Add SIP Trunk –

add sip trunk

Give the trunk a name –

trunk add 1

Now under Outgoing Settings this is where we enter our connection details to Sipgate. The settings that need to go in here will vary depending on the call provider you are using. Most call providers will give an example of how to configure Asterisk for use with their systems –

trunk add 2

and finally we are going to register with Sipgate. Some providers will require you to register, some will not. Talk to your call provider if it’s not clear –

trunk add 3

So now we have our trunk configured but it is not going to be used until we tell Asterisk to use it. For outbound calling we do this by creating an Outbound Route.

Click on connectivity and Outbound Routes –

add outbound route

Give the route a name. I’m going to call mine default as all the calls will go out via Sipgate –

add outbound route 1

Next we need to tell Asterisk what calls to send out via this trunk (we could have lots of trunks!). In the ‘match pattern’ box type ‘X.’ (capital X followed by a dot). The X matches any number and the . matches all digits. This tells Asterisk to dial any numbers that are not extension or special numbers via the Sipgate trunk. Dial rules can be complex to set up, but ‘X.’ is always a good place to start, and all you will probably need if you just plan on having a single trunk –

add outbound route 2


Then apply the changes –

apply config

And that should be it! I can now make an outbound call, just dialling the number I want to call. Please note that the number you call must be in the format the call provider is expecting it. Sipgate UK accepts UK calls dialled in the local format –

test call

2 thoughts on “AsteriskNOW: Setting up a trunk and outbound calls with Sipgate

  1. Pingback: Raspberry Pi PBX | i am ian wright

Comments are closed.