Asterisk configuration for BroadVoice

Updated 2004-12-12/oej

 

If you are using Asterisk and BroadVoice:

Apply this patch to your Asterisk source code, recompile with "gmake" and then "gmake install". The patch is now included in Asterisk CVS HEAD.

Configuration in sip.conf

Your Broadvoice account is activated in /etc/asterisk/sip.conf SIP configuration file. In the [general] section, add

register => <accountid>@sip.broadvoice.com:<password>:<account id>@sip.broadvoice.com/<extension>

Replace accountid with your account, password with your password and extension with one of your accessible extensions in the dial plan.

Then add a new section with this data:

[sip.broadvoice.com]
type=peer
;Enter your closest proxy server
host=proxy.dca.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=<accountid>
secret=<password>
context=from-broadvoice
;Disable canreinvite if you are behind a NAT
canreinvite=no
;Don't try to authenticate on incoming calls
insecure=very

Incoming calls from Broadvoice will now be connected to the extension in the context [from-broadvoice] in the dialplan, extensions.conf

Choosing a proxy

BroadVoice have several proxy servers you can choose from. Try pinging all and pick the one with the shortest ping time. This is the name you enter in the host= configuration option in the [sip.broadvoice.com] section above.

# ping proxy.lax.broadvoice.com
PING proxy.lax.broadvoice.com (147.135.8.128) 56(84) bytes of data.
64 bytes from proxy.lax.broadvoice.com (147.135.8.128): icmp_seq=1 ttl=47 time=41 ms
64 bytes from proxy.lax.broadvoice.com (147.135.8.128): icmp_seq=2 ttl=47 time=31 ms
64 bytes from proxy.lax.broadvoice.com (147.135.8.128): icmp_seq=3 ttl=47 time=58 ms

Which ever proxy is closer (has a shorter ping time) is the proxy you want to use. Choose one from:

Calling out through your BroadVoice account

To call out through Broadvoice using these settings, you match outgoing phone numbers in your dial plan and decide which calls you want to send through BroadVoice.

[default]
exten=_1NXXNXXXXXX, 1, dial(SIP/${EXTEN}@sip.broadvoice.com,30) ; Dial Broadvoice for 30 seconds
exten=_1NXXNXXXXXX, 2, congestion() ; No answer, nothing
exten=_1NXXNXXXXXX, 102, busy() ; Busy

More info