PPP+chat: How to redial 2 or more numbers

PPP+chat: How to redial 2 or more numbers

Post by Roland Rosenfe » Mon, 16 Jan 1995 02:00:55



Hi!

I'm using ppp-2.1.2a with Linux 1.1.72.

My uplink has two modems with two different dial-numbers.
So I want to dial to the first line and if this is BUSY, I want to
call the other line. If both lines are busy this should try the two
lines again and again...

How can I do this with chat?
At the moment I start chat/pppd this way:
pppd /dev/ttyS1 38400 \
     connect "chat -f /etc/ppp/dial-gak1" \
     modem crtscts \
     lock \
     -detach \
     123.123.123.123:

and dial-gak1 is the following:
ABORT BUSY ABORT 'NO CARRIER'
'' ATZ OK AT&N0M1X7S7=70 OK ATDP1234-567890 CONNECT

But I see no way to insert the second number...
chat returns a different status-value if it fails, but pppd does not
return this value to the calling shell-script.

Thanks for any help...

        Roland

--

 
 
 

PPP+chat: How to redial 2 or more numbers

Post by Dean Edmon » Mon, 16 Jan 1995 23:17:08




>My uplink has two modems with two different dial-numbers.
>So I want to dial to the first line and if this is BUSY, I want to
>call the other line. If both lines are busy this should try the two
>lines again and again...

>How can I do this with chat?
>At the moment I start chat/pppd this way:
>pppd /dev/ttyS1 38400 \
>     connect "chat -f /etc/ppp/dial-gak1" \
>     modem crtscts \
>     lock \
>     -detach \
>     123.123.123.123:

Create a shell script which does the following:

        #!/bin/sh

        if chat -f chat-script-for-first-number; then
            exit 0
        fi

        if chat -f chat-script-for-first-number; then
            exit 0
        fi

        exit 1

then use this shell script in pppd's `connect' parameter instead of calling
`chat' directly.
--
==========================================================================
  -deane