[Asterisk-Users] Looping Problem With Call Forwards - Do you have comments on my solution?

Brent Torrenga lists at torrenga.com
Tue Jan 3 11:42:12 MST 2006


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 at torrenga.com

Torrenga Engineering, Inc.
907 Ridge Road
Munster, Indiana 46321-1771

219.836.8918x325 Voice
219.836.1138 Facsimile
www.torrenga.com




More information about the asterisk-users mailing list