[asterisk-users] Macro to Dial a Channel Group using Round-robin

2011-07-20 Thread Antonio Modesto
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/1SIP/2SIP/3SIP/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

Re: [asterisk-users] Macro to Dial a Channel Group using Round-robin

2011-07-20 Thread Adolphe Cher-Aime
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@group-callLocal/phone2@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 mode...@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/1SIP/2SIP/3SIP/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*
--
_
-- 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

Re: [asterisk-users] Macro to Dial a Channel Group using Round-robin

2011-07-20 Thread A J Stiles
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/1SIP/2SIP/3SIP/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


Re: [asterisk-users] Macro to Dial a Channel Group using Round-robin

2011-07-20 Thread Antonio Modesto
Oh man, so easy, thank you very much!
--
_
-- 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