summaryrefslogtreecommitdiffstats
path: root/etc/isdn/unknown_incoming
blob: 13dfa2863e8894ae63e17e10b27440244ee6e592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
#---------------------------------------------------------------------------
#
#	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]
#
#	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.
#
#	For this to work, and entry like this:
#
#		regexpr	= "<unknown> incoming call from"
#		regprog	= unknown_incoming
#
#	is needed in the system section of /etc/isdn/isdnd.rc.
#
#---------------------------------------------------------------------------
#
# configure: who shall receive the mail
mailaddr=root
#
from=`echo $* | awk '{print $6}'`
to=`echo $* | awk '{print $8}'`
date=`date "+%b %d"`
time=`date "+%H:%M"`
mach=`hostname`

# do nothing if no number available

if [ $from = NotAvailable ]
then
	exit 0
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:

             From: $from

               To: $to

             Sincerly yours,
                   the isdnd on $mach

ENDOFDATA
 
exit 0
OpenPOWER on IntegriCloud