2 #---------------------------------------------------------------------------
4 # tell called and calling numbers answer script for i4b isdnd
5 # -----------------------------------------------------------
9 # last edit-date: [Tue Oct 31 10:59:49 2000]
11 #---------------------------------------------------------------------------
14 #FreeBSD < 3.1, NetBSD, OpenBSD, BSD/OS
15 #LIBDIR=/usr/local/lib/isdn
17 LIBDIR=/usr/share/isdn
19 LOGFILE=/tmp/answer.log
20 NCALLFILE=${VARDIR}/ncall
26 if ! set -- `getopt D:d:s: $*`; then
27 echo 'Usage: answer -D device -d destination -s source'
60 if [ "${DF}" -eq 0 -o "${dF}" -eq 0 -o "${sF}" -eq 0 ]; then
61 echo 'Usage: answer -D device -d destination -s source'
65 echo "answer: device ${DEVICE} destination ${DEST} source ${SRC} " >>${LOGFILE}
67 if [ -r "${LIBDIR}/beep.al" ]; then
68 dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k >/dev/null 2>&1
71 # tell the caller the number he is calling from
74 LENGTH=`expr ${SRC} : '.*'`
77 DIGIT=`echo ${SRC} | cut -c ${POS}`
78 /bin/dd of=${DEVICE} if=${LIBDIR}/${DIGIT}.al bs=2k >/dev/null 2>&1
80 if [ "${POS}" -gt "${LENGTH}" ]; then
85 if [ -r "${LIBDIR}/beep.al" ]; then
86 dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k >/dev/null 2>&1
89 dd if=${DEVICE} of=${VARDIR}/recorded.msg bs=2k >/dev/null 2>&1