Michael Graves
2004-Dec-01 15:07 UTC
IAX long distance... Re: [Asterisk-Users] Asterisk for home office
On Wed, 1 Dec 2004 12:37:13 -0800 (PST), Ben Kirkpatrick wrote:> Do you find it difficult to manage four LD providers? > Can you show me part of your LD Macro and how it's used? > > I'm toying with two LD providers now, but don't have failover setup. >Just using each one for what they are best at (least cost). > >Thanks, >--Ben Kirkpatrick > >Not really difficult, perhaps its a bit excessive. Although there have been a few (very few) times when I've notcied a brief pause after dialing and found that it had in fact dialed out on the last possible option. The macro is as follows: [macro-multidial] ; ;try sixtel first exten => s,1,ChanIsAvail(${IAXTRUNK5}) exten => s,2,Dial(${IAXTRUNK5}/${ARG1}) exten => s,3,Hangup ; ;try voipjet next exten => s,102,ChanIsAvail(${IAXTRUNK1}) exten => s,103,Dial(${IAXTRUNK1}/${ARG1}) exten => s,104,Hangup ; ;try NuFone next exten => s,203,ChanIsAvail(${IAXTRUNK2}) exten => s,204,Dial(${IAXTRUNK2}/${ARG1}) exten => s,205,Hangup ; ;try VPC-01 next exten => s,304,ChanIsAvail(${IAXTRUNK3}) exten => s,305,Dial(${IAXTRUNK3}/${ARG1}@VPWS) exten => s,306,Hangup ; ;try VPC-02 last exten => s,405,ChanIsAvail(${IAXTRUNK4}) exten => s,406,Dial(${IAXTRUNK4}/${ARG1}@VPWS) exten => s,407,Hangup exten => s,408,Congestion ; I declare the params for IAXTRUNK1-4 and the login details as global variables. My callout routine looks like the following; [outbound-ip-local] exten => _713XXXXXXX,1,Macro(multidial,1${EXTEN}) exten => _713XXXXXXX,2,Macro(fastbusy) exten => _281XXXXXXX,1,Macro(multidial,1${EXTEN}) exten => _281XXXXXXX,2,Macro(fastbusy) exten => _832XXXXXXX,1,Macro(multidial,1${EXTEN}) exten => _832XXXXXXX,2,Macro(fastbusy) [outbound-ip-domestic] exten => _1NXXNXXXXXX,1,Macro(multidial,${EXTEN}) exten => _1NXXNXXXXXX,2,Playback(invalid) exten => _1NXXNXXXXXX,3,Hangup() Might not be too elegant but it does work for me thus far. Michael -- Michael Graves mgraves@pixelpower.com Sr. Product Specialist www.pixelpower.com Pixel Power Inc. mgraves@mstvp.com o713-861-4005 o800-905-6412 c713-201-1262
Hermann Wecke
2004-Dec-02 03:25 UTC
IAX long distance... Re: [Asterisk-Users] Asterisk for home office
Michael Graves wrote:> [...] Although there have > been a few (very few) times when I've notcied a brief pause after > dialing and found that it had in fact dialed out on the last possible > option.[...] The problem of your approach is that if you are out of credit with the first provider, your call will be dropped, not trying the next one, right? After all, I believe that ChanIsAvail (http://www.voip-info.org/wiki-Asterisk+cmd+ChanIsAvail) will only check if you can connect to that provider (ip route), not for available funding... I'm using now something like this: exten => _91NXXNXXXXXX,1,Dial(IAX2/username@provider1/${EXTEN:1},45) exten => _91NXXNXXXXXX,2,PlayBack(beep) exten => _91NXXNXXXXXX,3,Dial(IAX2/username@provider2/${EXTEN:1},45) exten => _91NXXNXXXXXX,4,PlayBack(beep) exten => _91NXXNXXXXXX,5,Dial(IAX2/username@provider3/${EXTEN:1},45) exten => _91NXXNXXXXXX,6,PlayBack(beep) exten => _91NXXNXXXXXX,7,Dial(IAX2/username@provider4/${EXTEN:1},45) exten => _91NXXNXXXXXX,8,Playtones(congestion) exten => _91NXXNXXXXXX,9,Wait(3) exten => _91NXXNXXXXXX,10,Hangup I know after every "beep" that I changed the provider (out of credit? dialing error? no connection?), and if the call is ringing after 45 seconds and I hear a beep, I will hangup. Not the best, but I believe is the best failover solution (for a small company/home office at least).