home *** CD-ROM | disk | FTP | other *** search
- /* Infinite dialing loop example */
-
- /*
- A simple dialer example. Will redial indefinitely
- until a CONNECT is made.
- */
-
- options results
- if ~show('l', "rexxsupport.library") then
- addlib('rexxsupport.library',0,-30,0)
-
- address command "run work:telecom/backtalk"
- waitforport BT_REXX
- address BT_REXX
-
- openport("BT_msg")
-
- ONSTRING "CONNECT"
- OFFSTRING "BUSY"
-
- call delay 150
-
- number = "ATDT 555-1234"
- SEND number /* dial the number */
-
- keepgoing = TRUE
-
- do while keepgoing = TRUE
- packet = getpkt("BT_msg")
- do while packet = '00000000'x
- call waitpkt("BT_msg")
- packet = getpkt("BT_msg")
- end
-
- arg0 = getarg(packet)
- call reply(packet,0)
- select
- when arg0 = "OFF" then call doBusy
- when arg0 = "MATCH" then call doConnect
- otherwise nop
- end
- end
-
- /* after you do connect the above loop will fall out */
- /* so put the rest of your script here */
-
- RESET
- exit
-
-
- doBusy:
- ONSTRING "CONNECT"
- OFFSTRING "BUSY"
- HANGUP
- call delay 150 /* give time for HANGUP to take effect */
- SEND number
- return
-
- doConnect:
- OFFSTRING
- keepgoing = FALSE
- return
-