2
# @(#) modified from dial.hayes V1.1 Tue Sep 1 13:59:58 1992 (Bob Denny)
3
# modification by prye@picu-sgh.demon.co.uk (Peter Rye)
4
# Fri May 15 18:46:06 BST 1998
6
# xchat script for using "ringback" with a vanilla Hayes modem
9
# xchat Hayes.Ringback telno
11
# where telno is the telephone number, subject to pause and wait
12
# character modification.
14
# Uncomment the first two lines after "start:" to get debugging
17
# Flush input, zero counter, set telephone number if supplied,
18
# else fail if no telephone number given.
29
# Missing telephone number.
32
logerr No telephone number given
35
# Reset the modem to nonvolatile profile.
36
# Allow 3 sec. for response, as some modems are slow to reset.
42
timeout initmodem 3000
45
# No response from modem
48
logerr Can't wake modem
51
# Send the stuff needed to initialize the modem to the modes
52
# needed for the particular modem flavor. The string below
53
# is provided as a vanilla example. Allow 2 sec. for the
54
# modem to respond to this command.
59
timeout setupfail 2000
60
expect setupfail ERROR
63
# Modem barfed or died on setup command.
66
logerr Error in modem setup string
69
# Dial the supplied number. Handle the various errors that
70
# can come back from the modem by logging the error.
79
expect errconnect CONNECT
81
expect nocarrier NO CARRIER
82
expect noanswer NO ANSWER
83
expect nodialtone NO DIALTONE
107
timeout timeout 30000
108
expect connected CONNECT
110
expect nocarrier NO CARRIER
111
expect noanswer NO ANSWER
112
expect nodialtone NO DIALTONE
120
# Handle modem dial failures
123
logerr Modem or carrier timeout.
126
logerr Connected on first call.