Configuring Asterisk to work with Broadvoice SIP
We recently dumped our land line in favor of and end-to-end VOIP solution. For some reason voice networks haven’t received the fully automated treatment IP networks have enjoyed, so it was something os an involved process. The process was not helped by Broadvoice’s “bring your own device” instructions, which are wrong.
The system is very simple: enable a set of SIP IP phones to make and receive calls through our own IP PBX. This was done through a PRI, which we replaced with a VOIP trunk (running SIP) with an external phone company (Broadvoice).

Here’s what we did (after some trial and error).
Set up and configure the Ubuntu 9.04 server with Asterisk:
Very easy: Just install Asterisk.
% sudo apt-get install asterisk
Make a back up of config files. In /etc/asterisk:
% sudo mkdir -p Defaults
% sudo cp * Defaults/
Configure Cisco 7960 IP Phones and Asterisk
There are two ways to configure the Cisco IP phones: via TFTP or from the key pad. Either way, you’ll want to set up the following:
1) On Asterisk server, edit /etc/asterisk/sip.conf
Add the following at the very bottom of the file:
[username] ; this is the phone’s log in username (use something cute like phone1)
secret=password ; this is the phone’s log in password
username=KeyBridge ; this is the displayed outbound caller id
type=friend
user=phone
context=default
qualify=200
nat=no
host=dynamic
canreinvite=noNote: Do NOT use your Broadvoice phone number for the Cisco username. It will confuse Asterisk. Instead, use something cute like ‘line1′ or ‘frontdesk’.
2) On the Cisco IP phone
First unlock the phone: hit [settings], then [9] Unlock Config and enter your phone password
Then configure your phone:
[4] SIP Configuration
[1] Line 1 settings
[1] Name should be set to the ‘username’ you chose in the asterisk configuration above
[2] Shortname is what this ‘line’ will be called on the local display. Try ‘Line 1′
[3] Authentication Name is the same as [1]
[4] Authentication Password is the ‘secret’ you specified in sip.conf
[5] Shortname is what this ‘line’ will be called on the local display. Try ‘Line 1′ (duplicate?)
[6] Proxy Address the IP address of your Asterisk server
Hit the [Save] smart key to save the new configuration.
Getting your Broadvoice SIP password
A word of caution: The Broadvoice portal password you set during account creation is NOT your SIP password. To get the SIP password, log in to the Broadvoice portal, then click [Account] on the tab and [Show Settings] under the My Devices block. Your SIP password follows the ‘auth_password[1]‘ text.
Configure Asterisk to Broadvoice SIP Trunk
On the Asterisk Ubuntu server, edit SIP.conf.
In the [general] section, uncomment the following lines:
disallow=all ; First disallow all codecs
allow=ulaw ; Allow codecs in order of preference
allow=ilbc ; see doc/rtp-packetization for framing options
allow=gsm ; Allow codecs in order of preferenceAlso in the [general] section, add a register command using the following format. (Note – the Broadvoice instructions are wong – they tell you use use some craziness like PHONENUMBER@sip.broadvoice.com as your username – follow this template).
register => PHONENUMBER:PASSWORD:PHONENUMBER@sip.broadvoice.com/PHONENUMBER
Obviously, substitute your own phonenumber and password.
At the bottom of the file (before of after your Cisco phone – it doesn’t matter) add a Broadvoice entry as follows:
[sip.broadvoice.com]
type=peer
user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=USERNAME
secret=PASSWORD
username=USERNAME
insecure=very
authname=USERNAME
dtmfmode=inband
dtmf=inband
Edit extensions.conf
Now we’re done with sip.conf. Close it and let’s create the necessary dial plan. It’s easiest to start from scratch. Since we made a backup in ‘Defaults’, delete the file and create a new one.
% rm extensions.conf
% vi extensions.confHere is my complete file:
[general]
static=yes
writeprotect=no
clearglobalvars=no[default]
; Broadvoice Domestic Dialplan
exten => _1NXXNXXXXXX, 1, dial(SIP/${EXTEN}@sip.broadvoice.com,30)
exten => _1NXXNXXXXXX, 2, congestion()
exten => _1NXXNXXXXXX, 102, busy(); Broadvoice International Dialplan
exten=_011.,1,dial(SIP/${EXTEN}@sip.broadvoice.com,30)
exten=_011.,2,congestion() ; No answer, nothing
exten=_011.,102,busy() ; Busy; Forward inbound calls to SIP Phone
exten => USERNAME, 1 , Dial(SIP/CISCOPHONE,20,rt)Again, obviously substitute your Broadvoice phone number for ‘USERNAME’ and your Cisco phone username for ‘CISCOPHONE’
Start/restart Asterisk and you should be able to make and receive calls.
% sudo /etc/init.d/asterisk restart
A few quick confirmations just to see everything is working:
% sudo asterisk -vvvvr
> sip show peers
> sip show users
> show dialplan