Antonio Modesto
2011-Jul-20 12:16 UTC
[asterisk-users] Macro to Dial a Channel Group using Round-robin
Good morning,
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?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20110720/6a61fe26/attachment.htm>
Adolphe Cher-Aime
2011-Jul-20 12:29 UTC
[asterisk-users] Macro to Dial a Channel Group using Round-robin
Try using local channel to accomplish that.
by example :
you have 2 phones in the group and want to dial those phones in
the following fashion. Dial phone 1 first after 15 sec if phone1 does
not pickup dial phone2 :
[group-call]
exten => group1,Dial(Local/phone1 at group-call&Local/phone2 at
group-call, 30)
exten => phone1,1,Dial(SIP/100,15)
same => n,Hangup()
exten => phone2,1,Wait(15)
same => n,Dial(SIP/101)
same => n,Hangup()
Hope that will help.
"asterisk the definitive guide"
2011/7/20 Antonio Modesto <modesto at isimples.com.br>
> **
> Good morning,
>
> 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?
>
>
> Thanks.
>
> --
> _____________________________________________________________________
> -- 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
>
--
*Adolphe CHER-AIME
Network / VoIP Engineer
CCNA, CCNA VOICE, Global VSAT Forum Certified
(509) 3449-4280*
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20110720/59acf232/attachment.htm>
A J Stiles
2011-Jul-20 12:34 UTC
[asterisk-users] Macro to Dial a Channel Group using Round-robin
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.
Antonio Modesto
2011-Jul-20 12:41 UTC
[asterisk-users] Macro to Dial a Channel Group using Round-robin
Oh man, so easy, thank you very much! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110720/226d94b1/attachment.htm>