From 1550673ff62ab331ea0de86551248aae8db0081c Mon Sep 17 00:00:00 2001 From: Hellmuth Michaelis Date: Wed, 10 Jan 2001 12:41:55 +0000 Subject: [PATCH] Update: allow a list of numbers to be ignored and display the line on which the call was received. --- etc/isdn/unknown_incoming | 50 +++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/etc/isdn/unknown_incoming b/etc/isdn/unknown_incoming index 13dfa2863e88..9e26a648609d 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,