8 posts / 0 new
Last post
khaaby@sevenfea...
khaaby@sevenfeathers.com's picture
Joined: 2016/09/22
Points: 0

I'm looking into creating a duress button for our receptionists. Essentially, I want them to be able to press a programmed button on their phone and have the system automatically page a list of phones, or call a huntlist and play a prerecorded message stating assistance is needed for their location. Does anyone know of how this can be accomplished?

Thanks for any input.

mattdarnell
mattdarnell's picture
Joined: 2007/10/25
Points: 30

Sounds like it would be possible with a custom script.

khaaby@sevenfea...
khaaby@sevenfeathers.com's picture
Joined: 2016/09/22
Points: 0

I figured it could be done with a custom script. I'm just having a hard time getting the script to work properly. Here's what I have so far:

exten => s,1,Set(CHANS=${ARG1})
exten => s,n,SIPAddHeader(Alert-Info: )
exten => s,n,Set(_SIP_URI_OPTIONS=intercom=true)
exten => s,n,SIPAddHeader(Call-Info: <>\;answer-after=0)
exten => s,n,Page(${CHANS},A(TempMohAnnouncement))

ARG1 is simply an extension that is set in the feature code.

This script works, however, it plays the announcement on the phone that dials the feature code as well. Any idea how to prevent that from happening? Thanks in advance for any input.

khaaby@sevenfea...
khaaby@sevenfeathers.com's picture
Joined: 2016/09/22
Points: 0

I've been playing around with the script a bit and got it to work a little better and removed a couple unnecessary lines. Here is where I'm at now:

exten => s,1,Set(CHANS=${ARG1})
exten => s,n,SIPAddHeader(Call-Info: <>\;answer-after=0)
exten => s,n,Page(${CHANS},inqA(sampleopen),10)

It only plays on the recipient phone now and does not beep the callers phone. The issue I have yet to overcome is how to hang up the channel. I've set the timeout to 10s as seen in line 3, but does not appear to be working. I've also tried adding the hangup() command at the end of the script as well. Anyone have any ideas how I can get the page to hang up after the audio file is played?

volodya
volodya's picture
Joined: 2017/01/05
Points: 260

Hello!

According to Page dialplan application documentation:

Places outbound calls to the given technology/resource and dumps them into a conference bridge as muted participants. The original caller is dumped into the conference as a speaker and the room is destroyed when the original caller leaves

All channels should be destroyed after caller hangs up. Do you have different behavior? If that's the case, please send Asterisk call log for such call.

Also,

timeout - Specify the length of time that the system will attempt to connect a call. After this duration, any page calls that have not been answered will be hung up by the system

This means that system will add only phone/-s that answered within 10 seconds. Asterisk will hang up on other phones which will answer after 10 seconds. Since your phones are answering automatically, all of them should be placed into a conference bridge in time.

khaaby@sevenfea...
khaaby@sevenfeathers.com's picture
Joined: 2016/09/22
Points: 0

Hi Volodya,

The channels get destroyed when the page is hung up. What I was trying to accomplish is to allow the user to press a duress button, have it page an extension with a pre-recorded duress announcement and automatically hang up on it's own without any user input. What I ended up doing was setting an absolute timeout on the channel. See the script below:

exten => s,1,Set(CHANS=${ARG1})
exten => s,n,Set(TIMEOUT(absolute)=10)
exten => s,n,SIPAddHeader(Call-Info: <>\;answer-after=0)
exten => s,n,Page(${CHANS},inqA(sampleopen))

While this does the job, it's not exactly desirable because it's not really a reusable script elsewhere. But again, it does the job I need it to do. Thanks for the responses.

volodya
volodya's picture
Joined: 2017/01/05
Points: 260

Hello,

If you really want to get rid of timeout and have press a button and forget experience, I would suggest try using Originate application https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_Originate.

1. Remove announcement from Page application in current script.
2. Creane additional dialplan script with Originate application. tech_data value should be set to Localchannel (like: Local/feature_code_to_current_script@from-inside-tenant_name). type can be your Playback(annoncement) application.
3. In case if you will have to add some delay before paying back annoncement or have more complicated things to perform, you can set type and arg1 with exten and context values. This will allow you to create channel on exten@context instead of single application.

eeman
eeman's picture
Joined: 2007/11/06
Points: 290

I have a customer that has done this. He purchased the Cyberdata Voip call button for each of his locations. However, be warned, if you call 911 and tell them its an automated duress button in the recording, SWAT will show up with a tank and automatic rifles. This happened to two of his offices.

For the paging other handsets, most phones now have Multicast paging, and they have a priority one that will page the phones and interrupt the call if needed, which for an emergency makes sense.

Erik Smith
dCAP
Thirdlane/Asterisk Support available
esmith.bgnv@gmail.com