Technical Updates

Howto: Asterisk and SIP Call Delivery

Sadly I do not have the time to write a comprehensive walk-through for newbies to Asterisk, but hopefully, this information is helpful for those with at least half a clue. To receive calls and direct them to your Asterisk PBX,…

Sadly I do not have the time to write a comprehensive walk-through for newbies to Asterisk, but hopefully, this information is helpful for those with at least half a clue.

To receive calls and direct them to your Asterisk PBX, first dive into your ‘sip.conf’ file. Hopefully, this should already be set up with SIP users for whoever is using the system, and you should already have a ‘[general]’ context. In this [general] context, if your Asterisk system is set up already, you should have some parameters set up. The one you want to concentrate on is the ‘context’ parameter; this should point to a name such as ‘publicsip’, ‘incoming’ or something appropriate, but whatever the case, it should be a context that deals with public incoming calls over SIP, or from both SIP and whatever other channels you have configured for incoming calls, ideally.

This destination context should then exist in ‘extensions.conf’. Inside this, you should ideally have a parameter that accepts the dialled number over SIP, such as ‘exten => phone,1,Answer’ then ‘exten => phone,n,WhateverCommand’ to route the call (probably to your IVR).

For those experienced enough, here’s the code

sip.conf:

Code: Select all
[general] context=incoming
bindaddr=0.0.0.0 (this binds to all addresses available, you can also specify an exact WAN IP, don’t use internal IPs, or numbergroup won’t be able to connect and deliver the call)
insecure=invite
allow=all
srvlookup=yes
language=en_GB
… and any other stuff you feel necessary

extensions.conf:

Code: Select all
[incoming] exten => phone,1,Answer
exten => phone,n,Goto(menu,1)

[menu] your standard menu dialplan

Then all you need to give numbergroup is your address:

Code: Select all
sip:phone@yourasterisk.server.com

Though ensure your realm and domain etc, are set up properly in sip.conf, too, otherwise SIP calls may get rejected. ‘phone’ can also be replaced with anything at all; you can make it your 0800 number, you can make it ‘freecalls’ – whatever you like, just so long as you change it everywhere it is referenced.

If the SIP calls are getting rejected, start Asterisk in verbose mode with this on command line: ‘asterisk -rv’ – and if you don’t see anything relevant, just add additional ‘v’s to increase the verbosity of Asterisk’s output like so ‘asterisk -rvvv’ (verbosity level 3) and ‘asterisk -rvvvvv’ (verbosity level 5) and so on…

I hope that helps the fellow geeks using numbergroup out there.

Best regards,
Ricky Burgin
Exoware.net

Related reads