In message <[EMAIL PROTECTED]>, Paul Swinton writes:
> Does anyone know if there is a way to configure
> Diald to automatically dial an alternate number
> after a failure to connect to a primary number?  If
> so I would be interested in getting the knowing the
> steps/procedure involved.

FWIW, here's my chat script.

Bob
#! /bin/bash

FIFO=/etc/diald/diald.ctl

# Norwalk     667-0050
# Long Beach  683-0050
# Anaheim     1-714-410-0050

phonelist="6670050 6830050 17144100050"

ok=0
scripterror=1
iosignal=2
timeout=3
busy=4
nocarrier=5
noanswer=6
nodialtone=7
error=8

# Pass a message on to diald and the system logs.
function message () {
[ $FIFO ] && echo "message $*" >$FIFO
        logger -p local2.info -t connect "$*"
}

for phone in $phonelist
do
        /usr/sbin/chat -r /var/log/diald.log \
                ABORT BUSY \
                ABORT "NO CARRIER" \
                ABORT "NO ANSWER" \
                ABORT "NO DIALTONE" \
                ABORT ERROR \
                REPORT CARRIER \
                "" AT\&F1S10=30M0 \
                OK ATDT$phone \
                CONNECT "" \
                ogin:--ogin: login-name \
                word: \\qyour-password

        case $? in
                0 )     message "connected to $phone"
                        break
                ;;

                1 ) message "chat failed with a script error"
                        break
                ;;

                2 ) message "chat failed with an i/o error or a signal"
                        break
                ;;

                3 ) message "chat timed out on $phone"
break
                ;;

                4 ) message "chat returned BUSY on $phone"
break
                ;;

                5 ) message "chat returned NO CARRIER on $phone"
break
                ;;

                6 ) message "chat returned NO ANSWER on $phone"
break
                ;;

                7 ) message "chat returned NO DIAL TONE on $phone"
break
                ;;

                8 ) message "chat returned MODEM ERROR on $phone"
                        break
                ;;
        esac
done

exit $retval
+---------------------------------------------------------------+
| Bob Taylor             Email: [EMAIL PROTECTED]            |
|---------------------------------------------------------------|
| Like the ad says, at 300 dpi you can tell she's wearing a     |
| swimsuit. At 600 dpi you can tell it's wet. At 1200 dpi you   |
| can tell it's painted on. I suppose at 2400 dpi you can tell  |
| if the paint is giving her a rash. (So says Joshua R. Poulson)|
+---------------------------------------------------------------+

Reply via email to