Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set port and terminal commands

Status
Not open for further replies.

MaCinTof

Programmer
Jul 21, 2004
10
FR
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 don't have a modem handy on this machine, but according to the help file, "FAILURE is set if any set port command is used to set/fetch the settings of an unopened TAPI connection." You might try checking for success or failure after each set command and see what ASPECT reports (use something like the following code):

if failure
usermsg "Set command xyz failed!"
endif

Regarding the problems you have with the set terminal keyboardfile command, it appears to be case-sensitive after a little testing.


aspect@aspectscripting.com
 
I put some if FAILURE after each statement and it appears like none of my sets are working
I can't understand why ... :/

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top