blob: 4b29c22084bd3eb10d9e7169cf7702011186cca1 (
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
#!/bin/sh
#---------------------------------------------------------------------------
#
# tell called and calling numbers answer script for i4b isdnd
# -----------------------------------------------------------
#
# $Id: tell,v 1.3 1998/12/18 17:17:57 hm Exp $
#
# last edit-date: [Fri Dec 18 18:05:36 1998]
#
#---------------------------------------------------------------------------
VARDIR=/var/isdn
LIBDIR=/usr/local/lib/isdn
LOGFILE=/tmp/answer.log
NCALLFILE=$VARDIR/ncall
DATE=`date +%d%H`
DF=0
dF=0
sF=0
set -- `getopt D:d:s: $*`
if test $? != 0
then
echo 'Usage: answer -D device -d destination -s source'
exit 1
fi
for i
do
case "$i"
in
-D)
DEVICE=$2
DF=1
shift
shift
;;
-d)
DEST=$2
dF=1
shift
shift
;;
-s)
SRC=$2
sF=1
shift
shift
;;
--)
shift
break
;;
esac
done
echo "" >>$LOGFILE
if [ $DF -eq 0 -o $dF -eq 0 -o $sF -eq 0 ]
then
echo 'Usage: answer -D device -d destination -s source'
exit 1
fi
echo "answer: device $DEVICE destination $DEST source $SRC " >>$LOGFILE
if [ -f $LIBDIR/beep.g711a ]
then
dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k >/dev/null 2>&1
fi
# tell the caller the number he is calling from
POS=1
LENGTH=`expr $SRC : '.*'`
while :
do
DIGIT=`echo $SRC | cut -c $POS`
/bin/dd of=$DEVICE if=$LIBDIR/$DIGIT.g711a bs=2k >/dev/null 2>&1
POS=`expr $POS + 1`
if [ $POS -gt $LENGTH ]
then
break
fi
done
if [ -f $LIBDIR/beep.g711a ]
then
dd of=$DEVICE if=$LIBDIR/beep.g711a bs=2k >/dev/null 2>&1
fi
|