911 override

sirbones

Joined
Feb 15, 2009
Messages
27
Likes
0
Points
0
#1
Hey all

I am trying to setup a 911 override

Basically, from a phone, if someone dials 911 I want it to validate a call, if 911 already active, then don't disconnect that line, go to another line, if in use and not 911, then disconnect for 911 call.

This action is to first look for an open line and if none are open, then process this action.

Here is what I am working from

[globals]
EMERGENCY=0
EMERGENCY_TRUNK = Zap/5&Zap/4
EMERGENCY_NUM = 5555555 ; - Temp number for testing

[nineoneone]
exten => s,1,SetVar(SET_EMERG_FLAG=0)
exten => s,n(checkavail),ChanIsAvail(${EMERGENCY_TRUNK})
exten => s,n,SetGlobalVar(EMERGENCY=1)
exten => s,n,SetVar(SET_EMERG_FLAG=1)
exten => s,n(dial),Dial(${EMERGENCY_TRUNK}/${EMERGENCY_NUM})
exten => s,s+2(trunkbusy),GotoIf($[${EMERGENCY} = 1]?inprogress)
exten => s,n,SoftHangup(${EMERGENCY_TRUNK}-1)
exten => s,n,Wait(12)
exten => s,n,Goto(checkavail)
exten => s,s+2(inprogress),Congestion
exten => s,checkavail+101(notavail),Goto(trunkbusy)
exten => h,1,GotoIf($[${SET_EMERG_FLAG} = 1]?3)
exten => h,3,SetGlobalVar(EMERGENCY=0)

[from-internal-custom]
exten => 957,1,Goto(nineoneone,s,1)


I dial extension 957 and it just gives a busy


I can setup something to auto-drop a line and call my emergency number, but I need something to validate.

I've looks over and disabled line by line to locate issue and it appears to give busy if the first entry is enabled. if I disable that and set something else to from n to 1 it works but, it does not drop the channel.

Anyhow, please offer some advice on this one.. its a bit of a gotcha. I am running 1.3.2


James
 

sirbones

Joined
Feb 15, 2009
Messages
27
Likes
0
Points
0
#2
Hey all

I have changed the above to

[from-internal-custom]
exten => 955,1(checkavail),ChanIsAvail(Zap/5)
exten => 955,2,Set(GLOBAL(EMERGENCY)=1)
exten => 955,3(dial),Dial(Zap/5/555555)
exten => 955,201(trunkbusy),GoToIf($[${GLOBAL(EMERGENCY)}=1]?inprogress)
exten => 955,4,SoftHangup(Zap/5-1)
exten => 955,5,Wait(2)
exten => 955,6,Goto(checkavail)
exten => 955,202(inprogress),Congestion
exten => 955,7,Set(GLOBAL(EMERGENCY)=0)


It is now dialing out and if the line is in use, it is hanging it up and then taking the line.

Issue though, it is not looking if the EMERGENCY variable is set to 1 or not, it is just hanging up any call and then dialing the emergency number again

Any thoughts on what action I'm missing

James
 

sirbones

Joined
Feb 15, 2009
Messages
27
Likes
0
Points
0
#3
Hi All

I have changed the above alot.

I now have it working, however, once the Global Emergency variable is set to 1, it is never getting set to 0

so, the call happens, works great, when I hang up, I wanted it to fire off an event to reset the global emergency variable.

I tried

exten => h,1,Set(GLOBAL(EMERGENCY)=0)

this never works


once I get this basic process to work, I will then work on validation against all my lines..

1. Look for an open line
2. If no openlines exist find a line without an emergency call being made
3. on line found, drop it
4. if all lines tied up to emergencies, play sound on waiting for a free line
5. on free line, grab it for emergency call

I don't expect to need all of that, but just taking it all into consideration.

For now, I beat the rest of this down, just trying to figure out how to clear the global event when an outbound call is hungup

James
 

smir

Joined
May 13, 2010
Messages
1
Likes
0
Points
0
#4
Hi there,

Just wondering if you were able to fix this issue. I am stuck in the same situation. Your reply will be highly appreciated.

Thanks

Smir
 

sirbones

Joined
Feb 15, 2009
Messages
27
Likes
0
Points
0
#5
I moved to Asterisk 1.6.2 which supports keeping event variables open after Globals are destroyed.

Honestly, I moved away from Elastix and have now started my own distro.. Elastix is amazing and highly recommended and I still run it in many areas, but, some of the stuff i'm doing requires me to dictacte the sources I work with and I didn't want to have to wait for elastix to move forward for things to work for me the way I needed that is available in later versions of asterisk.

my suggestion is, use a later version of elastix that supports 1.6 or, better, wait until elastix comes out supporting the LTR of asterisk 1.8


James
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,898
Messages
130,879
Members
17,560
Latest member
manuelc
Top