Try this :

#!/bin/sh
###################################################################
#
# These parameters control the attack dialing sequence.
#
# Maximum number of attempts to reach the telephone number(s)
MAX_ATTEMPTS=10 {Use here 1 or 2 } Then it will go to the nex number !!!!!!!

# Delay between each of the attempts. This is a parameter to sleep
# so use "15s" for 15 seconds, "1m" for 1 minute, etc.
SLEEP_DELAY=15s   Not less than 10? ( 5s Not working?)

###################################################################
#
# This is a list of telephone numbers. Add new numbers if you wish
# and see the function 'callall' below for the dial process.
PHONE1=555-1212
PHONE2=411

###################################################################
#
# If you use the ppp-on script, then these are passed to this routine
# automatically. There is no need to define them here. If not, then
# you will need to set the values.
#
ACCOUNT=my_account_name
PASSWORD=my_password

###################################################################
#
# Function to initialize the modem and ensure that it is in command
# state. This may not be needed, but it doesn't hurt.
#
function initialize
{
    chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK'
    return
}

###################################################################
#
# Script to dial a telephone
#
function callnumber
{
chat -v       \
 ABORT  '\nBUSY\r'   \
 ABORT  '\nNO ANSWER\r'   \
 ABORT  '\nRINGING\r\n\r\nRINGING\r' \
 ''  ATDT$1    \
 CONNECT  ''    \
 ogin:--ogin: $ACCOUNT   \
 assword: $PASSWORD
#
# If the connection was successful then end the whole script with a
# success.
#
    if [ "$?" = "0" ]; then
       exit 0
    fi

    return
}

###################################################################
#
# Script to dial any telephone number
#
function callall
{
#   echo "dialing attempt number: $1" >/dev/console
    callnumber $PHONE1
#    callnumber $PHONE2
}

###################################################################
#
# Initialize the modem to ensure that it is in the command state
#
initialize
if [ ! "$?" = "0" ]; then
   exit 1
fi

#
# Dial telephone numbers until one answers
#
attempt=0
while : ; do
    attempt=`expr $attempt + 1`
    callall $attempt
    if [ "$attempt" = "$MAX_ATTEMPTS" ]; then
 exit 1
    fi
    sleep "$SLEEP_DELAY"
done

-----Original Message-----
From: Rick Marshall <[EMAIL PROTECTED]>
To: PPP mailing list <[EMAIL PROTECTED]>
Date: 19 ������ 1999 �. 19:13
Subject: Re: Multiple phone to the same ISP


>David D. Shochat wrote:
>
>> Yurais Fernandez Leal wrote:
>> >
>> > Hi there !
>> >
>> > My ISP has many numbers and many clients wich use all this numbers.
>> >
>> > Is there any way to use PPP with chat so when it dial into the ISP and
get
>> > BUSY, try another phone number until all hace been passed ?  or connect
?.
>> >
>> > Maybe someone has developed some script to do this..
>> >
>> > and maybe wants to share it.  :-)
>> >
>> Well, I haven't written a script to do that, but it should be easy to
>> do, since chat returns an exit status of 4 when it fails because of a
>> busy signal. The script I call chat from uses this status to print a
>> message that the line is busy, but you could just as easily use it to
>> run chat again with a different phone number (in a loop).
>> -- David
>>
>
>You could also tell the ISP about rotary lines.... 1960(?)s technology for
the
>90's.
>
>Rick
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
>the body of a message to [EMAIL PROTECTED]


-
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to [EMAIL PROTECTED]

Reply via email to