Kermit FAQ - How Do I Call up a Dialback Service?

(Home) (Prev) (Next)

31 How Do I Call up a Dialback Service?

A dialback service is one which you dial up to, provide some kind of identification and/or authentication, such as a name and/or password, and then it looks up your phone number in a database and calls you back. It is a type of security, based on having the phone numbers of all authorized callers, and opening sessions for them only when they are calling from those numbers.

Suppose you were using a Hayes modem to make a call to a dialback service. You would do the following:

ATD7654321      (Dial the number)
CONNECT 14400   (Read the response)

Here you would have the identification / authentication dialog. Now the dialback service hangs up on you, and you must put the modem in answer mode:

NO CARRIER      (The connection is closed)
ATS0=1          (Tell the modem to answer the next call)

When the call comes in, the modem answers and you're on line.

But now you want to automate the process. This is easily accomplished in Kermit. Let's use C-Kermit 6.0 to illustrate, since it has a new ANSWER command. Here is a simple script to do the job:

set modem type usr  ; or whatever
set port /dev/cua   ; or whatever
set speed 38400     ; or whatever
dial 7654321        ; dial the number
if fail stop

At this point, you would use INPUT and OUTPUT commands to accomplish the identification / authentication dialog. For example, if the dialback server prompts you with USERNAME: and PASSWORD:, and your script had previously stored these values in the variables \%u and \%p, respectively:

input 10 USERNAME:
if fail stop 1 No username prompt
output \%u\13
input 10 PASSWORD:
if fail stop 1 No password prompt
output \%p\13

Now you will need to hang up your end of the connection, and then wait for the phone to ring:

answer 120
if fail stop 1 No callback
The ANSWER command conditions the modem for answering (ATS0=1 for Hayes and compatible modems) and then waits the given number of seconds (120 in this case) for the call to come in. At this point, if the script is still executing, you've got a connection. You can give a CONNECT command, or execute a login script, or whatever else you want to do.

Kermit FAQ / Columbia University /