CDR
2012-Feb-17 09:00 UTC
[asterisk-users] Is there any way to make call fail after # of rings?
My customer needs to set a forwarding based on number of rings,i.e., if the phone rings 5 times (user-selectable), then try another number. Is there a way to do such a thing with Asterisk? I could not find way to do it based on the documentation of the Dial function. The protocol is SIP only, however, I could use a different one if it provided a workaround. If this is the wrong tool for the job, what technology would do this?
Ishfaq Malik
2012-Feb-17 09:09 UTC
[asterisk-users] Is there any way to make call fail after # of rings?
On Fri, 2012-02-17 at 04:00 -0500, CDR wrote:> My customer needs to set a forwarding based on number of rings,i.e., > if the phone rings 5 times (user-selectable), then try another number. > Is there a way to do such a thing with Asterisk? I could not find way > to do it based on the documentation of the Dial function. The protocol > is SIP only, however, I could use a different one if it provided a > workaround. If this is the wrong tool for the job, what technology > would do this? >'Phone rings' are not a standard unit of measurement. Is there a problem with defining the time in seconds? If not then Dial can do this for you. Regards Ish -- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062
Alec Davis
2012-Feb-17 09:13 UTC
[asterisk-users] Is there any way to make call fail after # of rings?
Simply, without checking for BUSY, DND or TIMEOUT I'm assuming each ring period is 3 seconds. exten => 8512,1,Dial(SIP/8512,15) exten => 8512,n,Dial(DAHDI/GO/101233456,15) Or another way. Maybe the FollowMe application, allow multiple numbers to be tried, each after a configured timeout. from followme.conf [default] musicclass=>default ; The moh class that should be used for the caller while they are waiting to be connected. context=>default ; The context to dial the numbers from number=>01233456,25 ; The a follow-me number to call. The format is: ; number=> <number to call[&2nd #[&3rd #]]> [, <timeout value in seconds> [, <order in follow-m Numebr Thus followme number=>8512,15 ; try local extension for 15 seconds number=>101233456,15 ; then try outside number for 15 Alec> -----Original Message----- > From: asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of CDR > Sent: Friday, 17 February 2012 10:00 p.m. > To: asterisk-users at lists.digium.com > Subject: [asterisk-users] Is there any way to make call fail > after # of rings? > > My customer needs to set a forwarding based on number of > rings,i.e., if the phone rings 5 times (user-selectable), > then try another number. > Is there a way to do such a thing with Asterisk? I could not > find way to do it based on the documentation of the Dial > function. The protocol is SIP only, however, I could use a > different one if it provided a workaround. If this is the > wrong tool for the job, what technology would do this? > > -- > _____________________________________________________________________ > -- 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
Zohair Raza
2012-Feb-17 09:26 UTC
[asterisk-users] Is there any way to make call fail after # of rings?
Try this exten=> yournumberhere,1,Dial(SIP/peern1,60) exten=> yournumberhere,n,GotoIf($["${DIALSTATUS}" != "ANSWER"]?4) exten=> yournumberhere,n,Hangup exten=> yournumberhere,n,Dial(SIP/peer2,60) exten=> yournumberhere,n,GotoIf($["${DIALSTATUS}" != "ANSWER"]?9) exten=> yournumberhere,n,Hangup you can add more conditions in the same way Regards, Zohair Raza On Fri, Feb 17, 2012 at 1:00 PM, CDR <venefax at gmail.com> wrote:> My customer needs to set a forwarding based on number of rings,i.e., > if the phone rings 5 times (user-selectable), then try another number. > Is there a way to do such a thing with Asterisk? I could not find way > to do it based on the documentation of the Dial function. The protocol > is SIP only, however, I could use a different one if it provided a > workaround. If this is the wrong tool for the job, what technology > would do this? > > -- > _____________________________________________________________________ > -- 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120217/d1e492f0/attachment.htm>
A J Stiles
2012-Feb-17 09:28 UTC
[asterisk-users] Is there any way to make call fail after # of rings?
On Friday 17 February 2012, CDR wrote:> My customer needs to set a forwarding based on number of rings,i.e., > if the phone rings 5 times (user-selectable), then try another number. > Is there a way to do such a thing with Asterisk? I could not find way > to do it based on the documentation of the Dial function. The protocol > is SIP only, however, I could use a different one if it provided a > workaround. If this is the wrong tool for the job, what technology > would do this?You have to do it by timing, not by number of rings. Asterisk simply doesn't know how long each "ring, ring, pause" cycle takes (it's a configurable property, and only analogue phones on an FXS port can be trusted to honour it anyway). If one ringing cycle takes 3 seconds, then 5 rings would be 15 seconds. So just use something like Dial(SIP/${EXTEN},15) in your dialplan. If the call was not answered, then the step number will get an extra 100 added to it. So, if your Dial() command was at step 2, it will move on to step 3 if the call was answered and hung up; or step 103 if the line was busy or timeout occurred. Hope that makes sense. -- AJS Answers come *after* questions.