Hello,
I have a script problem. I made a script for procomm plus 4.8 i wanted it to automaticly connect some PBX's with numbers in a text file (it's working !) but procomm is not correctly configured instead of this lines in my code
set port baudrate 9600
set port databits 8
set port parity NONE
set port stopbits 1
set port softflow OFF
set port hardflow OFF
set TERMINAL KEYBOARDFILE "VT100.KBD"
I copy you the rest of my code if you see anything else wrong just tell me, i'm an ASPECT scripting beginner :/
;folder of capture
string NomFichierCapture = "D:\Capture"
;file of PBX numbers
string NomFichierNumeros = "D:\PBX_numbers.txt"
;String to read the file
string sLine
proc main
ChkFile()
ParseFichier()
Endproc
;transmit correct sequence to the PBX to have the correct
; menu appear
proc Defiler_menu
transmit "1^M"
transmit "6^M"
transmit "1^M"
Endproc
;Chek if the file of numbers is created
Proc ChkFile
if Not isfile NomFichierNumeros
Errormsg " Le fichier contenant les numeros n'est pas a sa place !"
exit
endif
Endproc
;Reading text file and dialing
proc ParseFichier
string num_bat, num_appel
integer Count
if fopen 0 NomFichierNumeros read text
while not feof 0
Count = 0
fgets 0 sLine
;usermsg "sLine : %s" sLine
while Count < 2
;the text file contains string like
;"name;number"
if Count == 0
strextract num_bat sLine ";" Count
endif
if Count == 1
strextract num_appel sLine ";" Count
endif
Count++
endwhile
;set the name file for the capture file
;and set the capture options
strcat NomFichierCapture num_bat
strcat NomFichierCapture ".cap"
SET capture recordmode RAW
set capture overwrite on
set capture query off
set capture file NomFichierCapture
;setting procomm (doesn't work ...)
set port baudrate 9600
set port databits 8
set port parity NONE
set port stopbits 1
set port softflow OFF
set port hardflow OFF
set TERMINAL KEYBOARDFILE "VT100.KBD"
if not nullstr num_appel
;calling the number
dialnumber DATA num_appel
;usermsg "numbat : %s num appel : %s" num_bat num_appel
while $DIALING
yield
endwhile
;if connected send commands and start capture
if $CARRIER
capture on
pause 2
Defiler_menu()
pause 3
transmit "T^M"
pause 3
capture off ;closing capture
endif
endif
endwhile
fclose 0 ;closing file
else
Errormsg "Erreur lors de l'ouverture du fichier %s" NomFichierCapture
exit
endif
endproc
I have a script problem. I made a script for procomm plus 4.8 i wanted it to automaticly connect some PBX's with numbers in a text file (it's working !) but procomm is not correctly configured instead of this lines in my code
set port baudrate 9600
set port databits 8
set port parity NONE
set port stopbits 1
set port softflow OFF
set port hardflow OFF
set TERMINAL KEYBOARDFILE "VT100.KBD"
I copy you the rest of my code if you see anything else wrong just tell me, i'm an ASPECT scripting beginner :/
;folder of capture
string NomFichierCapture = "D:\Capture"
;file of PBX numbers
string NomFichierNumeros = "D:\PBX_numbers.txt"
;String to read the file
string sLine
proc main
ChkFile()
ParseFichier()
Endproc
;transmit correct sequence to the PBX to have the correct
; menu appear
proc Defiler_menu
transmit "1^M"
transmit "6^M"
transmit "1^M"
Endproc
;Chek if the file of numbers is created
Proc ChkFile
if Not isfile NomFichierNumeros
Errormsg " Le fichier contenant les numeros n'est pas a sa place !"
exit
endif
Endproc
;Reading text file and dialing
proc ParseFichier
string num_bat, num_appel
integer Count
if fopen 0 NomFichierNumeros read text
while not feof 0
Count = 0
fgets 0 sLine
;usermsg "sLine : %s" sLine
while Count < 2
;the text file contains string like
;"name;number"
if Count == 0
strextract num_bat sLine ";" Count
endif
if Count == 1
strextract num_appel sLine ";" Count
endif
Count++
endwhile
;set the name file for the capture file
;and set the capture options
strcat NomFichierCapture num_bat
strcat NomFichierCapture ".cap"
SET capture recordmode RAW
set capture overwrite on
set capture query off
set capture file NomFichierCapture
;setting procomm (doesn't work ...)
set port baudrate 9600
set port databits 8
set port parity NONE
set port stopbits 1
set port softflow OFF
set port hardflow OFF
set TERMINAL KEYBOARDFILE "VT100.KBD"
if not nullstr num_appel
;calling the number
dialnumber DATA num_appel
;usermsg "numbat : %s num appel : %s" num_bat num_appel
while $DIALING
yield
endwhile
;if connected send commands and start capture
if $CARRIER
capture on
pause 2
Defiler_menu()
pause 3
transmit "T^M"
pause 3
capture off ;closing capture
endif
endif
endwhile
fclose 0 ;closing file
else
Errormsg "Erreur lors de l'ouverture du fichier %s" NomFichierCapture
exit
endif
endproc