2 #---------------------------------------------------------------------------
4 # isdn telephone answering
5 # -------------------------
9 # last edit-date: [Thu May 20 11:45:04 1999]
11 #---------------------------------------------------------------------------
12 #FreeBSD < 3.1, NetBSD, OpenBSD, BSD/OS
13 #LIBDIR=/usr/local/lib/isdn
15 LIBDIR=/usr/share/isdn
21 MESSAGE=${LIBDIR}/msg.al
22 BEEP=${LIBDIR}/beep.al
30 # src and dst telephone numbers
37 # check if directory exists
38 if [ ! -d "${VARDIR}" ]
44 if ! set -- `/usr/bin/getopt D:d:s: $*`; then
45 echo "usage2: play -D device -d <dest-telno> -s <src-telno>"
53 DEVICE=$2; shift; shift;
67 # this is a __MUST__ in order to use the fullscreen inteface !!!
69 FILEDATE=`date \+%y%m%d%H%M%S`
71 # echo message to phone
72 if [ -r "${MESSAGE}" ]; then
73 /bin/dd of=${DEVICE} if=${MESSAGE} bs=2k >/dev/null 2>&1
77 if [ -r "${BEEP}" ]; then
78 /bin/dd of=${DEVICE} if=${BEEP} bs=2k >/dev/null 2>&1
84 # get message from caller
85 /bin/dd if=${DEVICE} of=${VARDIR}/${FILEDATE}-${dst}-${src} skip=${SKIP} bs=2k count=${MAXMSIZ} >/dev/null 2>&1
91 TIME=`expr ${END} - ${START}`
93 # save recorded message
94 if [ -r "${VARDIR}/${FILEDATE}-${dst}-${src}" ]; then
95 mv ${VARDIR}/${FILEDATE}-${dst}-${src} ${VARDIR}/${FILEDATE}-${dst}-${src}-${TIME}