Today we are going to approach an issue that every business with more than 50 people has encountered at least once.
Here is the problem:
Let’s say you have to dial 9 to get an outside line, or even if you don’t, you could have a rep trying to dial an area code that’s like 910.
In either case, the agent will almost always start with 9-1, then it only takes a slip of the finger or a mental misfire to accidentally call 911 without intent.
Now for most people, the instant reaction once they realize what they’ve done, is to hang up.
Wrong! This is the worst thing to do, NEVER HANG UP ON 911!
So here most people thing: “How can I stop people from calling 911?” Well, you shouldn’t.
If your agents are calling 911 accidentally, then you will need to stop them, but without preventing emergency services in a true emergency. Sure you could try to track them down and yell at them, but months later when the fire department is at your door for the 3rd+ time, they are going to be pissed. At the business owner, who is going to get pissed at the telecom operator.
So this is for business owner and telecom operators alike.
Obviously you could disable 911, but that’s usually illegal, and not necessary.
Solution? (Note, this article is for FreePBX based solutions, including Trixbox and Elastix, however it could easily be applied to pure asterisk)
What we’re going to do here, is confirm they actually meant to dial 911, by playing a message asking, “Are you sure you want to dial 911?” and requiring them to press 1 [or stay on the line more than 15 seconds]. This scenario should work just about every time.
Important Note: When testing, if you accidentally ring through to 911, DON’T HANGUP. When the operator gets on the line, simply say “Testing Operator, thank you.” Afterwards they should respond appropriately and/or simply hangup.
Now let’s get to the code! First you need to record the confirmation message. Use the FreePBX tools to do this yourself [Admin->System Recordings], or have a voice-over person make the recording.
With the recording in hand, name it rec-911-verify.wav [gsm, ulaw, etc], and copy it to /var/lib/asterisk/sounds/custom/
[Replace /var/lib/asterisk with the astvarlibdir path in asterisk.conf if you are using a non-standard install]
Make sure custom includes are enabled. Click here to find how to make FreePBX include custom contexts.
Last step of preparation: Be sure that you already have 911 added to one of your Outbound Routes
With all that in place, we are ready to go!
In your extensions_custom.conf file, add this code:
;if this context already exists in your dialplan just add to it
exten => 911,1,Goto(confirm-911,s,1)
;be sure to remove the file extension from Background application
; as asterisk automatically adds the xtn.
exten => s,1,Answer(500)
same => n,Background(custom/rec-911-verify) ;loads confirm-911.wav in our example
same => WaitExten(15) ;this is the # of seconds to wait before automatically dialing 911
;1 was pressed, call emergency!
exten => 1,1,Goto(outbound-allroutes,911,1)
;T+t are both timeouts, and should go to 911
exten => T,1,Goto(outbound-allroutes,911,1)
exten => t,1,Goto(outbound-allroutes,911,1)
;i is invalid, meaning the user pressed 5 or something, you can decide what to do here.
exten => i,1,Hangup
;hangup should hangup
exten => h,1,Hangup
Please note, that this depends on having 911 already programmed in an outbound route. Adding it to from-internal gives it a higher precedence and we can overwrite the standard behavior, while still utilizing FreePBX to designate the appropriate trunk for emergency dialing.
Hopefully you all found this article useful, you should have learned how to deal with employees accidentally dialing 911.