[Asterisk-Users] Automatic Follow-Me Forwarding Based on Cell GPS

Alexander Lopez alex.lopez at opsys.com
Wed Apr 27 19:11:06 MST 2005


OK a simple AGI can do this, I know you didn't want one, but its only
three lines!!!!


Cat findzone.agi

#!/bin/sh
zone=`cat $1.dat`
echo "SET VARIABLE zone $zone \"\"\n"


Put the above script in your agi-bin (usually /var/lib/asterisk/agi-bin)
chmod 755 findzone.agi


Then in your dialplan do this:

Exten => (exten),(priority),AGI(findzone.agi|${NUMBERTOLOOKUP})
Exten => (exten),(priority),Goto($ZONE)

BTW what service do you have that does GPS, Nextel?? How is it??Does it
work indoors??




-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Joseph
Gutowski
Sent: Wednesday, April 27, 2005 8:43 PM
To: Asterisk-Users at lists.digium.com
Subject: [Asterisk-Users] Automatic Follow-Me Forwarding Based on Cell
GPS

Hello-

Before you all get bent out of shape, let me give you the background
on what I have -- what I need help with should be rather easy, but I
can't seem to find it on the Wiki.

All of my business cell phones are subscribed to a "tracking" feature
which uses GPS and/or tower location to send automatic alert emails
that include the telephone number and the pre-defined "zone" that
person is currently in. I already have the appropriate scripts to
parse these emails, find the telephone number and zone, and save it to
a file called agentsnumber.dat with just one word in it -- the current
zone.

What I need is a dirty and simple way to make it so when Asterisk gets
a call for exten X, the dial plan has something similar to DBGet which
will read this file and set $agentzone to whatever is in that file.
Then I can use simple gotoif statements to direct where I need the
calls to go. I'm trying to get around writing an AGI because first I
suck, and second I want it  to be obvious to anyone how to edit the
dialplan to update things -- I was hoping there was a simple way to do
this if what I want the variable to equal is the only thing in that
file.

I realize it's not perfect due to the nature of the technology, but
what I'm trying to accomplish is when a person is outside of all zones
-- calls just go to their cell phone. If they're in the "office" zone,
it will ring the cell phone and office phone. If they're in the "home"
zone, it will ring the cell phone and the home phone. Simple enough to
do, once I manage to get an Asterisk variable set to the zone name.

I've already spent a lot of time narrowing down the "zones" for our
users, and they're pretty darn good considering the majority of the
time the phone doesn't have a GPS fix (inside). I'm leaving calls to
the cell phone at all times, so calls aren't lost if someone is just
around the zone but not actually in the office.

Thank you for any suggestions.
_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list