2 #---------------------------------------------------------------------------
4 # isdn telephone answering
5 # -------------------------
7 # $FreeBSD: src/etc/isdn/isdntel.sh,v 1.4 1999/09/13 15:44:20 sheldonh Exp $
8 # $DragonFly: src/etc/isdn/isdntel.sh,v 1.2 2003/06/17 04:24:47 dillon Exp $
10 # last edit-date: [Thu May 20 11:45:04 1999]
12 #---------------------------------------------------------------------------
13 #FreeBSD < 3.1, NetBSD, OpenBSD, BSD/OS
14 #LIBDIR=/usr/local/lib/isdn
16 LIBDIR
=/usr
/share
/isdn
22 MESSAGE
=${LIBDIR}/msg.al
23 BEEP
=${LIBDIR}/beep.al
31 # src and dst telephone numbers
38 # check if directory exists
39 if [ ! -d "${VARDIR}" ]
45 if ! set -- `/usr/bin/getopt D:d:s: $*`; then
46 echo "usage2: play -D device -d <dest-telno> -s <src-telno>"
54 DEVICE
=$2; shift; shift;
68 # this is a __MUST__ in order to use the fullscreen inteface !!!
70 FILEDATE
=`date \+%y%m%d%H%M%S`
72 # echo message to phone
73 if [ -r "${MESSAGE}" ]; then
74 /bin
/dd of
=${DEVICE} if=${MESSAGE} bs
=2k
>/dev
/null
2>&1
78 if [ -r "${BEEP}" ]; then
79 /bin
/dd of
=${DEVICE} if=${BEEP} bs
=2k
>/dev
/null
2>&1
85 # get message from caller
86 /bin
/dd if=${DEVICE} of=${VARDIR}/${FILEDATE}-${dst}-${src} skip=${SKIP} bs=2k count=${MAXMSIZ} >/dev
/null
2>&1
92 TIME
=`expr ${END} - ${START}`
94 # save recorded message
95 if [ -r "${VARDIR}/${FILEDATE}-${dst}-${src}" ]; then
96 mv ${VARDIR}/${FILEDATE}-${dst}-${src} ${VARDIR}/${FILEDATE}-${dst}-${src}-${TIME}