Re: Redial on No Dialtone
On 2005-07-27, Allen <amtekdesign@gmail.com> wrote:
: It appears that by default, redialing occurs for dial failures such as
: BUSY or NO CARRIER, but the dialer aborts on the first NO DIALTONE
: error. Is it possible to configure Kermit to redial on NO DIALTONE?
:
Not to redial automatically.
: I'm using
: SET DIAL RETRIES 5
: DIAL \m(name)
: IF FAIL DIAL \m(name)
:
: which will force a second attempt on NO DIALTONE, and gives me 10
: retries on a persistent BUSY/NO CARRIER, but is there a better way?
:
: Is there a status variable I can test that tells me why the DIAL
: command failed?
:
Kermit has lots of built-in variables. You can see what they are by
giving the command SHOW VARIABLES. Among them are:
\v(dialcount) = 0
\v(dialnumber) =
\v(dialresult) =
\v(dialstatus) = -1
\v(dialsuffix) =
\v(dialtype) = -1
\v(dialstatus) is the one you're looking for. The values are shown in
Table 5-3 on page 116 of "Using C-Kermit". A value of 24 corresponds to
NO DIALTONE. You can also use the \v(dialresult) variable to retrieve the
actual message from the modem.
So if you want to treat NO DIALTONE as a recoverable error, you can do
something like this (I didn't test it):
.\%n = 5
while > \%n 0 {
set dial retries \%n
dial \m(name)
if success break
if != \v(dialresult) 24 break
decrement \%n \v(dialcount)
}
if < \v(cx_status) 1 stop 1 Call failed: \v(name)
The \v(cx_status) variable is positive if there is an active connection.
- Frank
Re: Redial on No Dialtone
Thanks Frank; that's what I needed.