On Wednesday 20 Jul 2011, Antonio Modesto wrote:
>     I am writing a Asterisk dialplan from scratch (for learning and
> testing purposes), but i'm having trouble with a algorithm to dial a SIP
> group using round-robin. I want that asterisk dial the member of the
> group in a circular way, until the call be answered. For example, i have
> the group TEST="SIP/1&SIP/2&SIP/3&SIP/4", asterisk would dial SIP/1, if
> it doesn't answer in a period of time then asterisk would dial SIP/2 and
> so on. Can somebody help me?

Start with this and experiment!  You may want to set a variable initially to 
0, increment it each time around the loop and use a GotoIf() to jump out 
after too many cycles.

[macro-round-robin]
exten => s, 1, Dial(SIP/1, 30)  ;  dial SIP/1 for 30"
exten => s, n, Dial(SIP/2, 30)  ;  dial SIP/2 for 30"
exten => s, n, Dial(SIP/3, 30)  ;  dial SIP/3 for 30"
exten => s, n, Dial(SIP/4, 30)  ;  dial SIP/4 for 30"
exten => s, n, Goto(1)  ; start again

-- 
AJS

Answers come *after* questions.

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to