HyperCard: Hanging Up The Phone

When you use HyperCard's dial command with a modem, HyperCard doesn't hang up the phone right away if the line is busy. This is because the dial command simply sends a string to the modem and doesn't check whether the line is busy.
You can create a button that hangs up the modem. The basic format of the dial command is:

dial phonenumber with modem modemCommands

If you specify 'with modem,' HyperCard sends the information out the modem port. The modemCommands are commands you can send to the modem, such as the Hayes command set with which Apple modems are compatible.

To tell HyperCard to dial the number

9,555-1212

you'd use the dial command

dial "9,555-1212" with modem "ATS0=0DT"

which would send the string ATS0=0DT9,555-1212 out the modem port. If your modem understands the Hayes command set, it dials the phone. Because Hypercard is not looking at the modem port, it ignores any "busy" signal sent by the modem.

To make the modem hang up, you need a button that sends a character to the modem. This button script hangs up the phone if it gets a busy signal:

on MouseUp
dial "n" with modem " "
-- n can be any number. The space in quotes is there because the
-- default for the 'with modem' command is ATS0=0DT.
end MouseUp
Published Date: Feb 18, 2012