home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: OtherApp
/
OtherApp.zip
/
phoneb.zip
/
DIALER.VRX
next >
Wrap
Text File
|
1995-03-13
|
3KB
|
104 lines
/*:VRX Main
*/
Main:
debug = 0
phoneNumber = arg(1)
ok = VRMethod( "Application", "GetVar", "COMPort") /* COM1: or COM2: */
ok = VRMethod( "Application", "GetVar", "BaudRate") /* 300 ... 19200 */
ok = VRMethod( "Application", "GetVar", "DialString") /* ATDT usually */
ok = VRMethod( "Application", "GetVar", "HangupString") /* ATH usually */
signal on halt
if debug=1 then
do
msg.0 = 3
msg.1 = "Dialing ..."
msg.2 = phoneNumber
msg.3 = "Port:" COMPort "Baudrate:" baudRate
button.0 = 1
button.1 = "Continue"
call VRMessageStem VRWindow(), "msg.","Dialer. Dialing in progress","N","button.",1,1
end
/* Set comport using the OS/2 MODE command */
"@MODE" COMPort":"baudRate",,,,TO=OFF,XON=ON 1>NUL 2>NUL"
if RC \= 0 then
do
msg.0 = 3
msg.1 = "Dialing ..."
msg.2 = "MODE command returned code:" RC
msg.3 = ""
button.0 = 1
button.1 = "Continue"
call VRMessageStem VRWindow(), "msg.","Dialer. Dialing in progress","N","button.",1,1
end
RC = stream(COMPort,"C", "OPEN")
if RC \= "READY:" then
do
msg.0 = 3
msg.1 = "Dialing ..."
msg.2 = "Open for stream" COMPort "returned code:" RC
msg.3 = ""
button.0 = 1
button.1 = "Continue"
call VRMessageStem VRWindow(), "msg.","Dialer. Dialing in progress","N","button.",1,1
end
RC = lineout(COMPort, "ATDT"phoneNumber";")
if RC \= 0 then
do
msg.0 = 3
msg.1 = "Dialing ..."
msg.2 = "lineout("COMPort",DialString"phoneNumber";') returned code:" RC
msg.3 = ""
button.0 = 1
button.1 = "Continue"
call VRMessageStem VRWindow(), "msg.","Dialer. Dialing in progress","N","button.",1,1
end
msg.0 = 3
msg.1 = "Phone number has been dialed."
msg.2 = "Pick up the phone."
msg.3 = "Press Hangup when done."
button.0 = 1
button.1 = "Hangup"
call VRMessageStem VRWindow(), "msg.","Dialer","N","button.",1,1
/* Issue hangup command to modem */
RC = lineout(COMPort, HangupString)
if RC \= 0 then
do
msg.0 = 3
msg.1 = "Hanging up ..."
msg.2 = "lineout("COMPort",'"HangupString"') returned code:" RC
msg.3 = ""
button.0 = 1
button.1 = "Continue"
call VRMessageStem VRWindow(), "msg.","Dialer. Error","N","button.",1,1
end
RC = stream(COMPort, "C", "CLOSE")
call postSender "done"
exit
/*:VRX Halt
*/
Halt:
call postSender "halted"
exit
/*:VRX postSender
*/
postSender:
call VRMethod "Application", "PostQueue", 0,1, "call dialerDone", "status", arg(1)
return