diff options
author | hm <hm@FreeBSD.org> | 2001-01-10 12:41:55 +0000 |
---|---|---|
committer | hm <hm@FreeBSD.org> | 2001-01-10 12:41:55 +0000 |
commit | f9a771e2b9a6c85ebc6e41b2418e42f883e5eab4 (patch) | |
tree | 09a74b358d2344af30638bc4de4de3fc82d3f67c /etc | |
parent | 50a578741199547d83aeaf4c2fad80ddc61a26ff (diff) | |
download | FreeBSD-src-f9a771e2b9a6c85ebc6e41b2418e42f883e5eab4.zip FreeBSD-src-f9a771e2b9a6c85ebc6e41b2418e42f883e5eab4.tar.gz |
Update: allow a list of numbers to be ignored and display the line on
which the call was received.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/isdn/unknown_incoming | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/etc/isdn/unknown_incoming b/etc/isdn/unknown_incoming index 13dfa28..9e26a64 100755 --- a/etc/isdn/unknown_incoming +++ b/etc/isdn/unknown_incoming @@ -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, |