Brent Torrenga
2006-Jan-03 11:42 UTC
[Asterisk-Users] Looping Problem With Call Forwards - Do you have comments on my solution?
I use IP Kall to forward my missed cell phone calls to. This way, if my phone is off, or out of a service area, calls will go to my * box. Concurrently, all incoming calls to my * box cause it to dial my local extensions at home, my extension at work, and my cell phone via NuFone. Problem: A loop can be created if my cell phone is not on. Say a call comes into my * box, it uses NuFone to call my cell, my cell forwards the call to IP Kall, IP Kall to my * box...... You see. My solution, and I post this here because I am looking for comments/improvements to it: When a call comes into my * box, and my * box dials my cell via NuFone, I will SetGlobalVar ZAPCALLEDTIME to the ${EPOCH}. Then, whenever a call comes into my * box from IP Kall (aka, any call forwarded from my cell to my IP Kall), I will take the difference between the current ${EPOCH} and ${ZAPCALLEDTIME}, compare it to the value 10 (thinking that if it takes less than 10 seconds from the time I forward a call to my cell, and a forwarded cell call comes into my * box, then it must be the beginnings of a loop), and if less than 10 to send the call on to be hungup, or else process it normally. Thus, I submit the beginning of my [inbound-ipkall] context from my extensions.conf: [inbound-ipkall] Exten => _X.,1,GotoIf($[${ZAPCALLEDTIME} = ""]?3) ; This is to see check that ZAPCALLEDTIME exists at all - I am not sure I do it correctly here. Exten => _X.,2,GotoIf($[${EPOCH} - ${ZAPCALLEDTIME} < 10]?1000) ; This determines whether a loop is starting or not. . . . Exten => _X.,1000,Hangup() ; Would it be better to do a softhangup of my outgoing NuFone call? Not sure how to do that... Sincerely, Brent A. Torrenga brent.torrenga@torrenga.com Torrenga Engineering, Inc. 907 Ridge Road Munster, Indiana 46321-1771 219.836.8918x325 Voice 219.836.1138 Facsimile www.torrenga.com
Adam Goryachev
2006-Jan-04 04:22 UTC
[Asterisk-Users] Looping Problem With Call Forwards - Do you have comments on my solution?
On Tue, 2006-01-03 at 12:42 -0600, Brent Torrenga wrote:> I use IP Kall to forward my missed cell phone calls to. This way, if my > phone is off, or out of a service area, calls will go to my * box. > Concurrently, all incoming calls to my * box cause it to dial my local > extensions at home, my extension at work, and my cell phone via NuFone. > > Problem: A loop can be created if my cell phone is not on. Say a call comes > into my * box, it uses NuFone to call my cell, my cell forwards the call to > IP Kall, IP Kall to my * box...... You see. >Why not simply something like this: exten => 123,n,Set(GROUP()=Mobile) ; Set group to the mobile exten => 123,n,GotoIf($[ ${GROUP_COUNT(${mychan})} > 1 ]?next) exten => 123,n(next),Goto(context,exten,priority) ; Skip over calling your mobile since there is already another call in progress, ie, send to VM, or retry your home/office/etc... exten => 123,n,Dial(IAX2/provider/mobilenum) On the next line, you could also just play some MoH and wait for 10 seconds, then loop around and try again, etc... but then you are probably better off using the queue system with agents ... Hope this helps somewhat... Regards, Adam
Peter Bowyer
2006-Jan-04 04:26 UTC
[Asterisk-Users] Looping Problem With Call Forwards - Do you have comments on my solution?
On 03/01/06, Brent Torrenga <lists@torrenga.com> wrote:> I use IP Kall to forward my missed cell phone calls to. This way, if my > phone is off, or out of a service area, calls will go to my * box. > Concurrently, all incoming calls to my * box cause it to dial my local > extensions at home, my extension at work, and my cell phone via NuFone. > > Problem: A loop can be created if my cell phone is not on. Say a call comes > into my * box, it uses NuFone to call my cell, my cell forwards the call to > IP Kall, IP Kall to my * box...... You see. > > My solution, and I post this here because I am looking for > comments/improvements to it: When a call comes into my * box, and my * box > dials my cell via NuFone, I will SetGlobalVar ZAPCALLEDTIME to the ${EPOCH}. > Then, whenever a call comes into my * box from IP Kall (aka, any call > forwarded from my cell to my IP Kall), I will take the difference between > the current ${EPOCH} and ${ZAPCALLEDTIME}, compare it to the value 10 > (thinking that if it takes less than 10 seconds from the time I forward a > call to my cell, and a forwarded cell call comes into my * box, then it must > be the beginnings of a loop), and if less than 10 to send the call on to be > hungup, or else process it normally.A simpler solution would be to have the IPKall number forward to a different extension on your Asterisk server which doesn't include a call out to the cellphone - and if you use the IPKall number for other purposes, register yourself another one which you only use for the cellphone forward. Peter -- Peter Bowyer Email: peter@bowyer.org Tel: +44 1296 768003 VoIP: sip:peter@bowyer.org VoIP: *5048707000@sipbroker.com FWD: **275*5048707000 VoipTalk: **473*5048707000