1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-02 12:20:51 +00:00

Update: allow a list of numbers to be ignored and display the line on

which the call was received.
This commit is contained in:
Hellmuth Michaelis 2001-01-10 12:41:55 +00:00
parent 0ec58b35cb
commit 1550673ff6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=70878

View File

@ -4,16 +4,14 @@
# unknown_incoming - script for isdnd
# -----------------------------------
#
# $Id: unknown_incoming,v 1.2 1999/12/13 21:25:24 hm Exp $
#
# $FreeBSD$
#
# last edit-date: [Mon Dec 13 21:41:51 1999]
# last edit-date: [Wed Jan 10 13:40:36 2001]
#
# This script is called by isdnd when an unknown incoming call
# is received. In case the destination telephone number is
# available, it sends mail with the time, source and destination
# numbers to a configurable address.
# This script may be configured to be called by isdnd when an
# unknown incoming call is received. In case the destination
# telephone number is available, it sends mail with the time,
# source and destination numbers to a configurable address.
#
# For this to work, and entry like this:
#
@ -22,6 +20,9 @@
#
# is needed in the system section of /etc/isdn/isdnd.rc.
#
# This script has to be configured to the sites needs, look
# for the comment lines start with "configure:"
#
#---------------------------------------------------------------------------
#
# configure: who shall receive the mail
@ -29,26 +30,45 @@ mailaddr=root
#
from=`echo $* | awk '{print $6}'`
to=`echo $* | awk '{print $8}'`
test=`echo $* | awk '{print $9}'`
ctrl=`echo $* | awk '{print $10}'`
date=`date "+%b %d"`
time=`date "+%H:%M"`
mach=`hostname`
# do nothing if no number available
# configure: list of destination numbers to ignore
case "$from" in
"NotAvailable" ) exit 0 ;;
"00401234567"* ) exit 0 ;;
"00407654321" ) exit 0 ;;
esac
if [ $from = NotAvailable ]
# configure: how to name the line on which this was received
if [ $test = "ctrl" ]
then
exit 0
case "$ctrl" in
"1")
line="PBX 1"
;;
"2")
line="PBX 2"
;;
*)
line="controller is $ctrl"
;;
esac
else
line="test is $test, controller is $ctrl"
fi
# send mail
cat << ENDOFDATA | mail -s "isdnd: unknown incoming telephone call" $mailaddr
On $date at $time a telephone call from a destination
unknown to the isdn daemon came in:
Unknown incoming telephone call recognized:
Date: $date
Time: $time
Line: $line
From: $from
To: $to
Sincerly yours,