Skip to main content

Kari's Law and Thirdlane

Posted by mcampbell@1poi… on Fri, 02/14/2020

Hello,

I know one of the requirements of Kari's law (going in effect 2/16/20) is "...when a person dials 9-1-1 from your enterprise’s communication system, the front desk, security office, or relevant personnel must be informed..."

Is there anything in the Thirdlane system that can be set up to notify others in the same organization when a 911 call is placed? If not are there any workarounds or plans to make the feature available in a future release?

Thanks in advance,

--Matt


Submitted by volodya on Mon, 02/17/2020 Permalink

Hello Matt,

There is a special dial script for this reason. You need to configure your emergency route/-s with script called tl-dialout-1-trunk-emergency and set Execute Emergency Notification script to "Yes". Now each time someone will make such call /usr/local/sbin/emergency_call_notification.sh script will be executed. Please note that this is a blank script and all it does is just saving event to the log file. You need to adjust it according to your requirements.

Please let me know if you need some assistance or guidance.

Submitted by mcampbell@1poi… on Mon, 02/17/2020 Permalink

Hi Volodya,

Thanks for the response. I did see this in the system & thought it might be what I was looking for but it appears to be a global script. How would I apply a unique script at the tenant level (for example, call Tenant X extensions 1002 & 1003 and play a pre-recorded message when they place a 911 call?)

Best,

--Matt

Submitted by volodya on Wed, 02/19/2020 Permalink

Hello,

You can clone and customize tl-dialout-1-trunk-emergency script with following line to pass tenant name to the script as a second argument. This will be default action in upcoming release.
exten => s,n,ExecIf($["${ARG6}" = "1"]?System(/usr/local/sbin/emergency_call_notification.sh "${MYID}" "${tenant}"))

Here is the one way of implementing described behavior. Replace /usr/local/sbin/emergency_call_notification.sh script content with following lines.
#!/bin/bash
# This is a sample script which only writes to a file and does nothing else.

test_extensions_to_call="100 300"
test_recording_to_payback="sampleopen"

tenant2_extensions_to_call="1002 1003"
tenant2_recording_to_payback="sampleclosed"

call_file=emergency_`date +%s`

if [ "$2" == "" ]
then
#Single tenant
echo "$(date +"%F %r") emergency call made by $1" >> /var/log/thirdlane/emergency_calls.log
else
#Multi tenant
echo "$(date +"%F %r") emergency call from tenant $2 made by $1" >> /var/log/thirdlane/emergency_calls.log

extensions_to_call=$2_extensions_to_call
recording_to_payback=$2_recording_to_payback
for extension in ${!extensions_to_call}
do
echo "Channel: SIP/$extension-$2" > /tmp/$call_file
echo "Callerid: Emergency notifier <911>" >> /tmp/$call_file
echo "WaitTime: 60" >> /tmp/$call_file
echo "MaxRetries: 2" >> /tmp/$call_file
echo "RetryTime: 5" >> /tmp/$call_file
echo "Application: Playback" >> /tmp/$call_file
echo "Data: ogm/$2/${!recording_to_payback}" >> /tmp/$call_file
mv /tmp/$call_file /var/spool/asterisk/outgoing/
done
fi

Please note defined vatiables at the top. They use tenant name as a prefix and each tenant should have it's own set.

This script will make calls to specified numbers. It will attempt to call again two times with 5 seconds interval if there will be no answer. Each attempt will last for 60 seconds.

Submitted by mcampbell@1poi… on Thu, 02/20/2020 Permalink

Hi Volodya,

I implemented and tested the script. I know it is working b/c I see call logs in /var/log/thirdlane/emergency_calls.log; however I never see the system attempt to call the extensions I have in the script. Below is the syntax I changed in the script (I only modified the tenant name - the rest is unchanged from your last post.)

1pointcom_extensions_to_call="2333 2111"
1pointcom_recording_to_playback="sampleclosed"

Is there something I'm missing or incorrect syntax I'm using?

Thanks in advance,

--Matt

In reply to by volodya

Submitted by mcampbell@1poi… on Thu, 02/20/2020 Permalink

Oh yes - I did add this line to my test script and was certain to activate emergency notification in the route.

exten => s,n,ExecIf($["${ARG6}" = "1"]?System(/usr/local/sbin/emergency_call_notification.sh "${MYID}" "${tenant}"))

FYI there was a very similar line in the script to begin with which I overwrote (I believe it was identical to your code less the ${tenant} variable.)

--MC