~ubuntu-branches/ubuntu/trusty/uucp/trusty

« back to all changes in this revision

Viewing changes to contrib/Ringback.Hayes

  • Committer: Bazaar Package Importer
  • Author(s): Peter Palfrader
  • Date: 2004-12-30 15:30:22 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041230153022-mx4cdr9j3u9bldo3
Tags: 1.07-12
Add cs localisation for debconf templates (closes: #287305).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!xchat
 
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
 
5
#
 
6
# xchat script for using "ringback" with a vanilla Hayes modem
 
7
#
 
8
# Usage:
 
9
#       xchat Hayes.Ringback telno
 
10
#
 
11
# where telno is the telephone number, subject to pause and wait
 
12
# character modification. 
 
13
#
 
14
# Uncomment the first two lines after "start:" to get debugging
 
15
# in file "Dial.Log"
 
16
#
 
17
# Flush input, zero counter, set telephone number if supplied,
 
18
# else fail if no telephone number given.
 
19
#
 
20
start:
 
21
        ##dbgfile               Dial.Log
 
22
        ##dbgset                15 
 
23
        zero
 
24
        flush
 
25
        ifnstr  notelno         0
 
26
        telno                   0
 
27
        goto    initmodem
 
28
#
 
29
# Missing telephone number.
 
30
#
 
31
notelno:
 
32
        logerr  No telephone number given
 
33
        failed
 
34
#
 
35
# Reset the modem to nonvolatile profile. 
 
36
# Allow 3 sec. for response, as some modems are slow to reset.
 
37
#
 
38
initmodem:
 
39
        count
 
40
        ifgtr   cantinit        4
 
41
        send    ATZ\r
 
42
        timeout initmodem       3000
 
43
        expect  setupmodem      OK
 
44
#
 
45
# No response from modem
 
46
#
 
47
cantinit:
 
48
        logerr  Can't wake modem
 
49
        failed
 
50
#
 
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.
 
55
#
 
56
setupmodem:
 
57
        sleep   1000
 
58
        send    ATZ\r
 
59
        timeout setupfail       2000
 
60
        expect  setupfail       ERROR
 
61
        expect  dialnumber      OK
 
62
#
 
63
# Modem barfed or died on setup command.
 
64
#
 
65
setupfail:
 
66
        logerr  Error in modem setup string
 
67
        failed
 
68
#
 
69
# Dial the supplied number. Handle the various errors that
 
70
# can come back from the modem by logging the error.
 
71
#
 
72
dialnumber:
 
73
        sleep   1000
 
74
        send    ATDT
 
75
        dial
 
76
        send    \r
 
77
        flush
 
78
        timeout hangup  4000
 
79
        expect  errconnect      CONNECT
 
80
        expect  busy            BUSY
 
81
        expect  nocarrier       NO CARRIER
 
82
        expect  noanswer        NO ANSWER
 
83
        expect  nodialtone      NO DIALTONE
 
84
 
 
85
hangup:
 
86
        hangup
 
87
        sleep   4000
 
88
        send    +++
 
89
        sleep   4000
 
90
        send    \r
 
91
        sleep   1000
 
92
        send    ATZ\r
 
93
        timeout resetup         2000
 
94
        expect  resetup         OK
 
95
 
 
96
resetup:        
 
97
        sleep   8000
 
98
        send    ATZ\r
 
99
        expect  redial  OK
 
100
 
 
101
redial:
 
102
        sleep   1000
 
103
        send    ATDT
 
104
        dial
 
105
        send    \r
 
106
        flush
 
107
        timeout timeout         30000
 
108
        expect connected        CONNECT
 
109
        expect  busy            BUSY
 
110
        expect  nocarrier       NO CARRIER
 
111
        expect  noanswer        NO ANSWER
 
112
        expect  nodialtone      NO DIALTONE
 
113
        
 
114
#
 
115
# Success!
 
116
#
 
117
connected:
 
118
        success
 
119
#
 
120
# Handle modem dial failures
 
121
#
 
122
timeout:
 
123
        logerr  Modem or carrier timeout.
 
124
        failed
 
125
errconnect:
 
126
        logerr  Connected on first call.
 
127
        failed
 
128
busy:
 
129
        logerr  BUSY
 
130
        failed
 
131
nocarrier:
 
132
        logerr  NO CARRIER
 
133
        failed
 
134
noanswer:
 
135
        logerr  NO ANSWER
 
136
        failed
 
137
nodialtone:
 
138
        logerr  NO DIALTONE
 
139
        failed
 
140
#
 
141
# end
 
142
#