this is just a standard dialer for communications but this is prob somthing
ur looking for
you can use the vo standard Serial Class and impliment the needs of you
application
i use a c++ Com class ive prototyped everything into vo classs (direct
functions ) or class methods
1. open port...
2. queary modem
3. set S-Registers (optional)
if u set a thread you can do your own timing based on responses from
modem
//redial, redial (timout) build all kind of rules
4. send dial string...
5. loop wait for response from modem (usualy 1 second) init, and talking to
modem
line info and numeric or charactar responses
METHOD Dialer( ) CLASS DvDialer
LOCAL cPhNumber AS STRING
LOCAL nStarttime AS FLOAT,;
LOCAL cString
LOCAL nexitstate AS INT
nexitstate:=0
IF ! IsComPortOpened(SELF:ocom)
RETURN(SELF)
ENDIF
///is midnite
IF (nStarttime:=Seconds())==86399
nStarttime:=0
ENDIF
cPhnumber:=Trim(SELF:odcSleNumber:Value)
DO WHILE (Seconds()-nStartTime)<=SELF:comWaitTime
GetAppObject():Exec(EXECWHILEEVENT)
IF SELF:occpbDial:modified==TRUE .and. SELF:occpbdial:Caption=="Dial"
SELF:odcFtStatus:TextValue:="Dialing......"
cPhnumber:=SELF:odcslenumber:TextValue
SELF:occpbdial:Modified:=FALSE
SELF:occpbDial:Caption:="Reset"
SELF:ocom:ComPuts("ATDT"+cPhNumber+"|")
// SELF:ocom:ComWaitfor("OK",5)
ENDIF
//dcd,rts/cts,dtr,dsr,ring
SELF:oCom:ComLineStatus(SELF:occcd,SELF:occRTS,SELF:OCCDTR,SELF:occcts,SELF:
occDsR,SELF:occri)
cString:=Space(60)
SELF:oCom:ComReads(@cString) // read the port
SELF:ocom:ComSleepMs(3) //yield
cString:=LTrim(RTrim(StrTran(cString,CHR(13),"")))
cString:=StrTran(cString,CHR(10),"")
IF ! Empty(cString)
SELF:odcftStatus:TEXTValue:=cString
ENDIF
IF "CONNECT" $ cString ///in your case pic up hand set on this or
Ring
SELF:ocom:success:=1
SELF:ocom:Result:="Success"
//good
EXIT
ELSEIF "NO CARRIER" $ cString //failed retry
SELF:ocom:Success:=-1
SELF:oCom:Result:="No Carrier"
//bad
nexitstate:=1
EXIT
ELSEIF "NO DIALTONE" $ cString //faild retry
SELF:ocom:success:=-2
SELF:ocom:Result:="No Dialtone"
nExitstate:=1
EXIT
ELSEIF "BUSY" $ cString /// failed retry
SELF:oCom:Success:=-3
SELF:ocom:Result:="HOST Line Busy! Please try Back in 5 min"
nExitState:=1
EXIT
ELSEIF "ERROR" $ cString // modem Error failed retry
SELF:oCom:Result:="Error"
SELF:oCom:Success:=-4
nExitState:=1
EXIT
ENDIF
IF SELF:occpbdial:modified==TRUE .AND. occPbDial:Caption=="Reset"
SELF:occpbdial:Modified:=FALSE
SELF:occpbdial:Disable()
SELF:occpbDial:Caption:="Dial"
SELF:odcftStatus:TextValue:=""
SELF:ocom:Comhangup(FALSE)
nExitState:=0
SELF:occpbDial:Enable()
ENDIF
IF SELF:occpbCancel:Modified==TRUE
SELF:OCCPBCANCEL:Disable()
nExitState:=1
EXIT
ENDIF
ENDDO
IF SELF:ocom:Success<0
DVMSGBOX{SELF,"OKONLY",SELF:ocom:Result+";","Dialing Error"}:Show()
ENDIF
IF nExitState==1
SELF:ocom:ComHangup(TRUE)
SELF:EndDialog()
ELSEIF nExitState==0 // on line
SELF:ocom:ComSleep(1)
SELF:odcftStatus:textvalue:="Waiting for HOST Connect Time......"
SELF:syncTimer() // sinc with other side(another computer)
SELF:EndDialog()
ENDIF
Post by Peter ArteltHi,
I'm looking for a easy way to transfer a telephon number from the PC to a
telephon set which dial the number. I don't need access to the telephone
office or to respond to incomming calls.
Regards,
from the sunny Black Forest
Peter Artelt