Asterisk least cost routing using broadvoice

Least cost routing using broadvoice

I've setup a broadvoice Unlimited World + account so I can accept calls from BV customers without
either of us being billed for the call. I also setup least cost routing for the FREE international calls
using the BV account. I've included the excerpt from extensions.conf in hopes someone else will
save a large amount of money and will want to share their savings with me (:biggrin:)! shows 35 countries can be called
at no cost. Basically this says, if BV has this country listed, check for an available channel via SIP
to BV, then make the call. It falls back on my PRI trunk (designated by ${T}) and uses that trunk
by default if BV doesn't allow free calls to that country.

I record all outbound international calls also...

include => record-international ; had to do this so the lesser specific route (LSR) matches after the MSR
include => international-default
;-------------------------------------------------------- if its a BV capable country send to BV
exten => _90113[0-4].,4,goto(broadvoice,${EXTEN:1},1)
exten => _901135[1-3].,4,goto(broadvoice,${EXTEN:1},1)
exten => _9011378.,4,goto(broadvoice,${EXTEN:1},1)
exten => _901139.,4,goto(broadvoice,${EXTEN:1},1)
exten => _901141.,4,goto(broadvoice,${EXTEN:1},1)
exten => _9011420.,4,goto(broadvoice,${EXTEN:1},1)
exten => _90114[3-8].,4,goto(broadvoice,${EXTEN:1},1)
exten => _90115[4-6].,4,goto(broadvoice,${EXTEN:1},1)
exten => _90116[0-1].,4,goto(broadvoice,${EXTEN:1},1)
exten => _90116[4-5].,4,goto(broadvoice,${EXTEN:1},1)
exten => _90118[1-2].,4,goto(broadvoice,${EXTEN:1},1)
exten => _9011852.,4,goto(broadvoice,${EXTEN:1},1)
exten => _901186.,4,goto(broadvoice,${EXTEN:1},1)
exten => _9011886.,4,goto(broadvoice,${EXTEN:1},1)
exten => _9011972.,4,goto(broadvoice,${EXTEN:1},1)
exten => _901149[2-9].,4,goto(broadvoice,${EXTEN:1},1)
;-------------------- everything else uses the main trunk from international-default included above

exten => _9011.,1,answer
exten => _9011.,2,SetVar(CALLFILENAME=intl-${TIMESTAMP}-${CALLERID}-${EXTEN:1}) ;monitor intl calls
exten => _9011.,3,Monitor(wav,${CALLFILENAME},m)
exten => _9011.,4,noop('Executing International Call DEFAULT at internation-outbound-9011-1 for ${EXTEN}')

exten => _9011.,5,Dial(${T}/${EXTEN},,r)

;check for an available channel at BV, fallback to trunk if not
exten => _.,1,ChanIsAvail(SIP/${EXTEN}@sipBroadvoice1)
exten => _.,2,noop('Executing International Call on broadvoice at broadvoice-.-1 for ${EXTEN}')
exten => _.,3,dial(SIP/${EXTEN}@sipBroadvoice1,,r)
exten => _.,103,noop('Executing International Call on ${T} at broadvoice-011-1 for ${EXTEN}')
exten => _.,104,dial(${T}/9${EXTEN},,r)

Obviously it wouldn't be hard to tie in other providers. If you cut
and paste this config, the only variables you should define is "T" and
the sip.conf context to call BV. Mine is set by: "T => Zap/g1". Also
note that I remove the 9 before I throw it at broadvoice, but include
it if it goes out my ${T} trunk which is a PRI tie line to my
Avaya/Lucent Definity G3 rev 11.
I'm working on rate comparisons between the difference providers.
I'll try to provide dialplan configs when available.

Good luck, and let me know if you have any questions. I'll try to help out as much as I can.

tim ( is somewhere near ) tims net ( place a period here) com

BroadVoice/Asterisk configuration help is also available at the BroadVoice Support Forum.
Created by: tc0nn, Last modification: Tue 27 of Feb, 2007 (20:25 UTC) by echamberlain
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+