View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
Hi All,
 
I try to find out how to phone via my notebook with a headset with the prg. following works fine ontil the connection is made. Than, If I push the button the line is disconnected.
I like to talk via the haedset after I push the button.
Can any of you give me a Hand
 
Thank you in advance
 
Ron 
 
************************
lparameters lcfone,lcCom
LOCAL m_fone
m_fone=''
 
IF EMPTY(lcfone)
  return .f.
ELSE
  m_fone=alltr(lcfone)
ENDIF
 
 IF !( 'FOXTOOLS' $ UPPER(SET('LIBRARY')) )
    SET LIBRARY TO FOXTOOLS ADDI
 ENDIF
 LOCAL lccomport,lcdstring,lnport,lcfonelook
 
*** set the port
* lccomport='COM1'
 lccomport= lcCom
 lcdstring = "ATDT " + m_fone + CHR(13)
 opencomm  = RegFn("OpenComm", "CII", "I",'User.exe')
 writecomm = RegFn("WriteComm", "ICI", "I",'User.exe')
 closecomm = RegFn("CloseComm", "I", "I",'User.exe')
 lnport = CallFn(OpenComm,lccomport, 100, 100)
 =CallFn(WriteComm, lnport, lcdstring, len(lcdstring))
 lcfonelook=IIF(m_fone='1','1 - '+FONE(SUBS(m_fone,2)),FONE(m_fone))
 =MESSAGEBOX(dial'+ALLT(lcfonelook)+CHR(13)+CHR(13)+;
 "push the button",64)
 lcdstring=CHR(10)+CHR(13)+CHR(10)+CHR(13)
 =CallFn(WriteComm, lnport, lcdstring, len(lcdstring))
 =CallFn(CloseComm, lnport)
 PROCEDURE FONE
 * Function to return a formatted string from a passed phone number
 LPARA tcFONE
 LOCAL lcretval
 lcretval=PADL(ALLT(tcFONE),14)
 DO CASE
    CASE LEN(ALLT(tcFONE))=7
       lcretval=SPAC(6)+SUBS(tcFONE,1,3)+'-'+RIGH(tcFONE,4)
    CASE LEN(ALLT(tcFONE))=10
       lcretval='('+LEFT(tcFONE,3)+') '+SUBS(tcFONE,4,3)+'-'+RIGH(tcFONE,4)
 ENDC
 RETU lcretval
 * eop()