Hi folks,
I've only just found this forum and it seems excellent although i've looked thro it and cannot find any references to my problem. This is going to sound like an awfully dumb question. I would like to read in a file of phone numbers and 'test call' them i.e. see if they connect or are answered (cannot guarantee type of number PSTN/FAX etc). I wanted to use the Dialling Directory as its already got a nice user interface. I came up with the below code, but it doesn't seem to use the GUI and it also uses the default 'Direct Connect-Telnet' and doesn't dial. I can't find any references to 'Set Dialentry Connection'. Am I going about this the hard way?
Heres what I have so far..
'-----------------------
#include "funcproc.inc"
string sFname, sPath, sGroup
Proc Main
; GetInputs()
sPath="D:\"
sFname="in.txt"
ReadFileToGroup()
DialGroup()
DeleteGroup()
Endproc
'-----------------------
Proc GetInputs
String sFileSpec
sFileSpec="D:\"
dir sFileSpec sFname
if SUCCESS
statmsg sFname
getpathname sPath sFname
getfilename sFname sFname
else
exit
endif
Endproc
'-----------------------
Proc ReadFileToGroup
String sStat, sLine, sEntry
Integer iFnum, iGrpNm, iLen
iFnum=1
iGrpNm=1
sGroup="Test"
sStat=OpenFile(sFname, sPath, "read", iFnum)
if stricmp sStat "OK"
dialadd DATA GROUP sGroup ;Add New groupname
while not feof(iFnum)
sLine=ReadFile(iFnum)
strlen sLine iLen
if iLen > 2
strfmt sEntry "%d" iGrpNm ;Create a name for the entry
dialadd DATA sEntry
set dialentry access sEntry ;Allows access to entry
set dialentry phonenumber DATA sLine ;set the number for the entry
set dialentry calltype LOCAL ;defines connection
; set dialentry connection "Sportster 28.8-Auto-Com"
;would be noce but command doesnt exist
dialinsert DATA sGroup sEntry ;Insert new entry into group sGroup
endif
iGrpNm++
endwhile
fclose 1
dialsave ;save this new group to the existing dial directory
endif
Endproc
'-----------------------
Proc DialGroup
dial DATA GROUP sGroup CONNECTALL
Endproc
'-----------------------
Proc DeleteGroup
dialdelete DATA GROUP sGroup
dialsave
EndProc
I've only just found this forum and it seems excellent although i've looked thro it and cannot find any references to my problem. This is going to sound like an awfully dumb question. I would like to read in a file of phone numbers and 'test call' them i.e. see if they connect or are answered (cannot guarantee type of number PSTN/FAX etc). I wanted to use the Dialling Directory as its already got a nice user interface. I came up with the below code, but it doesn't seem to use the GUI and it also uses the default 'Direct Connect-Telnet' and doesn't dial. I can't find any references to 'Set Dialentry Connection'. Am I going about this the hard way?
Heres what I have so far..
'-----------------------
#include "funcproc.inc"
string sFname, sPath, sGroup
Proc Main
; GetInputs()
sPath="D:\"
sFname="in.txt"
ReadFileToGroup()
DialGroup()
DeleteGroup()
Endproc
'-----------------------
Proc GetInputs
String sFileSpec
sFileSpec="D:\"
dir sFileSpec sFname
if SUCCESS
statmsg sFname
getpathname sPath sFname
getfilename sFname sFname
else
exit
endif
Endproc
'-----------------------
Proc ReadFileToGroup
String sStat, sLine, sEntry
Integer iFnum, iGrpNm, iLen
iFnum=1
iGrpNm=1
sGroup="Test"
sStat=OpenFile(sFname, sPath, "read", iFnum)
if stricmp sStat "OK"
dialadd DATA GROUP sGroup ;Add New groupname
while not feof(iFnum)
sLine=ReadFile(iFnum)
strlen sLine iLen
if iLen > 2
strfmt sEntry "%d" iGrpNm ;Create a name for the entry
dialadd DATA sEntry
set dialentry access sEntry ;Allows access to entry
set dialentry phonenumber DATA sLine ;set the number for the entry
set dialentry calltype LOCAL ;defines connection
; set dialentry connection "Sportster 28.8-Auto-Com"
;would be noce but command doesnt exist
dialinsert DATA sGroup sEntry ;Insert new entry into group sGroup
endif
iGrpNm++
endwhile
fclose 1
dialsave ;save this new group to the existing dial directory
endif
Endproc
'-----------------------
Proc DialGroup
dial DATA GROUP sGroup CONNECTALL
Endproc
'-----------------------
Proc DeleteGroup
dialdelete DATA GROUP sGroup
dialsave
EndProc