I would use the ${DIALSTATUS} variable. In your dialplan dial the first trunk
you wish, then afterwards examine the ${DIALSTATUS} variable. If that is not
equal to ANSWER then dial your second trunk and so on.
For example:
exten => s,1,Dial(ZAP/1/${EXTEN})
exten => s,n,ExecIf($["${DIALSTATUS}" !=
"ANSWER"]|Dial|(SIP/out1/${EXTEN})
exten => s,n,ExecIf($["${DIALSTATUS}" !=
"ANSWER"]|Dial|(SIP/out2/${EXTEN})
That's kind of rough but it should work.
Cheers,
Darrin Henshaw | IT Administrator | MCTS: Exchange 2007 | MCSE 2003 | LPIC
Ignition Support Center | www.ignition.bm
Bermuda (441) 496-4319 | Cayman (345) 947-4357 | Halifax (902) 482-1288
Atlanta | Bermuda | Cayman | Halifax
-----Original Message-----
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces
at lists.digium.com] On Behalf Of Geoff Lane
Sent: Tuesday, January 20, 2009 13:31
To: Asterisk Users
Subject: [asterisk-users] Setting up an outgoing trunk group
Hi All,
I'm confused! My Asterisk system has a Zap trunk and three SIP trunks.
I'd like to configure the dialplan to route via the first trunk in a
list and if that's not available or it's busy, fall over to the
second, then to the third, etc.
AIUI Dial(Zap/1&SIP/out1&SIP/out2/${EXTEN}) rings all the trunks in
the list and bridges to the first to answer. Unfortunately, that's not
what I want, which is (in pseudocode):
if Zap/1 is available then
Dial(Zap/1/${EXTEN})
elseif SIP/out1 is available then
Dial(SIP/out1/${EXTEN})
else
Dial(SIP/out2/${EXTEN})
end if
Also, to make it easier to reconfigure quickly, I've got a variable
defined in [globals] thus:
MainOutbound=Zap/1&SIP/out1&SIP/out2
so the Dial statement above would be written in the dialplan thus:
Dial(${MainOutbound}/${EXTEN})
So if I can't find the syntax to get the Dial application to do what I
want I guess I'd need to use a dialplan function or AGI.
Can anyone help?
TIA,
--
Geoff
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
This email and its attachments may be confidential and are intended solely for
the use of the individual or parties' to whom it is addressed. All comments
are solely those of the author and do not necessarily represent those of
Ignition. If you are not the intended recipient of this email and its
attachments, you must take no action based upon them, nor must you copy or show
them to anyone. Please contact the sender if you believe you have received this
email in error. Thanks for considering the environmental impact before printing
this email.