diff options
author | hm <hm@FreeBSD.org> | 1999-01-10 14:30:53 +0000 |
---|---|---|
committer | hm <hm@FreeBSD.org> | 1999-01-10 14:30:53 +0000 |
commit | 7694f216801b3a5fc116cc0959125be152f955a9 (patch) | |
tree | cad15090903cd7853ccb87800ced41e9b59a6c87 /etc/isdn/tell | |
parent | 6f74dc01b4fb3d0b3688762c7347a90d768ac105 (diff) | |
download | FreeBSD-src-7694f216801b3a5fc116cc0959125be152f955a9.zip FreeBSD-src-7694f216801b3a5fc116cc0959125be152f955a9.tar.gz |
add directory /etc/isdn and populate it
Diffstat (limited to 'etc/isdn/tell')
-rwxr-xr-x | etc/isdn/tell | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/etc/isdn/tell b/etc/isdn/tell new file mode 100755 index 0000000..4b29c22 --- /dev/null +++ b/etc/isdn/tell @@ -0,0 +1,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 |