Update: allow a list of numbers to be ignored and display the line on
which the call was received.
This commit is contained in:
parent
0ec58b35cb
commit
1550673ff6
@ -4,16 +4,14 @@
|
|||||||
# unknown_incoming - script for isdnd
|
# unknown_incoming - script for isdnd
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
#
|
#
|
||||||
# $Id: unknown_incoming,v 1.2 1999/12/13 21:25:24 hm Exp $
|
|
||||||
#
|
|
||||||
# $FreeBSD$
|
# $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
|
# This script may be configured to be called by isdnd when an
|
||||||
# is received. In case the destination telephone number is
|
# unknown incoming call is received. In case the destination
|
||||||
# available, it sends mail with the time, source and destination
|
# telephone number is available, it sends mail with the time,
|
||||||
# numbers to a configurable address.
|
# source and destination numbers to a configurable address.
|
||||||
#
|
#
|
||||||
# For this to work, and entry like this:
|
# For this to work, and entry like this:
|
||||||
#
|
#
|
||||||
@ -22,6 +20,9 @@
|
|||||||
#
|
#
|
||||||
# is needed in the system section of /etc/isdn/isdnd.rc.
|
# 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
|
# configure: who shall receive the mail
|
||||||
@ -29,26 +30,45 @@ mailaddr=root
|
|||||||
#
|
#
|
||||||
from=`echo $* | awk '{print $6}'`
|
from=`echo $* | awk '{print $6}'`
|
||||||
to=`echo $* | awk '{print $8}'`
|
to=`echo $* | awk '{print $8}'`
|
||||||
|
test=`echo $* | awk '{print $9}'`
|
||||||
|
ctrl=`echo $* | awk '{print $10}'`
|
||||||
date=`date "+%b %d"`
|
date=`date "+%b %d"`
|
||||||
time=`date "+%H:%M"`
|
time=`date "+%H:%M"`
|
||||||
mach=`hostname`
|
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
|
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
|
fi
|
||||||
|
|
||||||
# send mail
|
|
||||||
|
|
||||||
cat << ENDOFDATA | mail -s "isdnd: unknown incoming telephone call" $mailaddr
|
cat << ENDOFDATA | mail -s "isdnd: unknown incoming telephone call" $mailaddr
|
||||||
|
|
||||||
On $date at $time a telephone call from a destination
|
Unknown incoming telephone call recognized:
|
||||||
unknown to the isdn daemon came in:
|
|
||||||
|
|
||||||
|
Date: $date
|
||||||
|
Time: $time
|
||||||
|
Line: $line
|
||||||
From: $from
|
From: $from
|
||||||
|
|
||||||
To: $to
|
To: $to
|
||||||
|
|
||||||
Sincerly yours,
|
Sincerly yours,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user