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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

StrTok Value is not being Transmed 2

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
Help I wrote this script to update about 900 Coverage Remote Numbers in an AVAYA. The numbers are not being sent.


proc main
integer iVar, iLen ; Number of entries in dialing class
string sLine, sTok1, sTok2, sTok3, sTok4,sRemote
string sAvayaFile = "Avaya ChaSta.csv"
string sImportPath = "C:\Temp Data Files\Raw Data\"
string sNewPath = "Temp Data Files\Reconfigured Data\"
string sCapPath = "C:\Program Files\Symantec\ProComm Plus\Capture\"
string sSpace = " "
string sRemCmd = "change coverage remote"

chdir sImportPath
isfile sAvayaFile ivar ; Verifies that File does Exist.
if SUCCESS
fopen 1 sAvayaFile READWRITE TEXT ; Opens Text File
pause 2
usermsg "This Script uses a File Called Avaya ChaSta.csv with 4 Colums"
usermsg "The columns are Extension, Cov Path, Cov Rem Num, Rem Entry Num"
usermsg "The Coverage Remote start at entry Number 100"
chdir sNewPath
sdlginput "Remote Path" "Remote:" sRemote
set modem connection current
pause 2
strcat sRemCmd sSpace
strcat sRemCmd sRemote
transmit sRemCmd
mspause 250
transmit "^M"
waitfor "01:" FOREVER
if SUCCESS
transmit "^[OV"
waitfor "46:" FOREVER
if SUCCESS
transmit "^[OV"
waitfor "91:"
if SUCCESS
transmit "^[[B"
waitfor "^[[4m" FOREVER
transmit "^[[B"
waitfor "^[[4m" FOREVER
transmit "^[[B"
waitfor "^[[4m" FOREVER
transmit "^[[B"
waitfor "^[[4m" FOREVER
transmit "^[[B"
waitfor "^[[4m" FOREVER
transmit "^[[B"
waitfor "^[[4m" FOREVER
transmit "^[[B"
waitfor "^[[4m" FOREVER
transmit "^[[B"
waitfor "^[[4m" FOREVER
transmit "^[[B"
waitfor "100:" 15
if SUCCESS
while not feof 1

; First Column has a 4-Digit Number
; Second Column has a 3-Digit Number
; Third Colum has a 3-Digit Number
; Fourth Column has a 7-Digit Number witha Dash after the Third Digit
fgets 1 sLine
strlen sLine iLen
strtok sTok1 sLine "," 1 ;Extension Number
strtok sTok2 sLine "," 1 ;Coverage Path
strtok sTok3 sLine "," 1 ;Coverage Remote Entry Number
strtok sTok4 sLine "," 1 ;Remote Number
usermsg "sTok1`"%s`" FOUND." sTok1
usermsg "sTok4`"%s`" FOUND." sTok4
transmit sTok4
mspause 125
transmit "^M"

; The NUmber in Column 4 is not being sent to the system
; Examples of the numbers are: 731-5597, 731-5598, 731-5378

endwhile
transmit "^[OR"
else
; Command aborted
transmit "^[OP"
endif
waitfor "Command successfully completed"
else
; Command aborted
transmit "^[OP"
endif
else
; Command aborted
transmit "^[OP"
endif
else
; Command aborted
transmit "^[OP"
endif
endif
endproc


Any Idea's?
Your suggestions will be most welcome
 
Hi, just some thoughts... Re: This section of your script.
strtok sTok1 sLine "," 1 ;Extension Number
strtok sTok2 sLine "," 1 ;Coverage Path
strtok sTok3 sLine "," 1 ;Coverage Remote Entry Number
strtok sTok4 sLine "," 1 ;Remote Number
usermsg "sTok1`"%s`" FOUND." sTok1
usermsg "sTok4`"%s`" FOUND." sTok4
transmit sTok4
mspause 125
transmit "^M"

Does your USERMSG reflect that the values you want are captured OKAY?
Assuming they do, I think the problem is with the last 3 lines...You might need to transmit your string and "Enter" as one. Try and replace the last 3 lines with...

strcat sTok4 "^M"
mspause 125
transmit sTok4

Let us know how that goes.



 
Could you post a sample line from your data file?

My suspicion is that sTok4 will be null and sLine would have the data you want, possibly with an extra comma.

 
Knob & Comtechau,

THis is just a CSV file I was using to test the script file. The actual file will look like this one.

2600 100 100 7315362
2601 101 101 7315601
2602 102 102 7315584
2603 103 103 7315595
2604 104 104 731-5596
2605 105 105 731-5597
2606 106 106 731-5598
2607 107 107 731-5378


Any other ideas?
 
Does your USERMSG reflect that the values you want are extracted OKAY ??

Side issue - STREXTRACT can also extract from CSV files. So if you get stuck, have a stab with that and see how it goes.
 
one further question. Since this is an Avaya system and terminal type is ATT4410, I have to use page down (F7) to get to the nex page. There are 45 entries per table. Any suggestion on how to break this up. I tried a WHEN TARGET, but it does the Pagedown ("^[OV") immediatley. below is my current script.

proc main
integer iVar, iLen ; Number of entries in dialing class
string sLine, sTok1, sTok2, sTok3, sTok4,sRemote
string sAvayaFile = "Avaya ChaSta.csv"
string sImportPath = "C:\Temp Data Files\Raw Data\"
string sNewPath = "Temp Data Files\Reconfigured Data\"
string sCapPath = "C:\Program Files\Symantec\ProComm Plus\Capture\"
string sSpace = " "
string sRemCmd = "change coverage remote"

chdir sImportPath
isfile sAvayaFile ivar ; Verifies that File does Exist.
if SUCCESS
fopen 1 sAvayaFile READWRITE TEXT ; Opens Text File
pause 2
; usermsg "This Script uses a File Called Avaya ChaSta.csv with 4 Colums"
; usermsg "The columns are Extension, Cov Path, Cov Rem Num, Rem Entry Num"
When Target 0 "45:" Call NextPage
When Target 1 "90:" Call NextPage
When Target 2 "135:" Call NextPage
When Target 3 "180:" Call NextPage
When Target 4 "225:" Call NextPage
When Target 5 "270:" Call NextPage
When Target 6 "315:" Call NextPage
When Target 7 "360:" Call NextPage
When Target 8 "405:" Call NextPage
When Target 9 "450:" Call NextPage
When Target 10 "495:" Call NextPage
When Target 11 "540:" Call NextPage
When Target 12 "585:" Call NextPage
When Target 13 "630:" Call NextPage
When Target 14 "675:" Call NextPage
When Target 15 "720:" Call NextPage
When Target 16 "765:" Call NextPage
When Target 17 "810:" Call NextPage
When Target 18 "855:" Call NextPage
When Target 19 "900:" Call NextPage
When Target 20 "945:" Call NextPage
When Target 21 "990:" Call NextPage
When Target 22 "1000:" Call NextPage

usermsg "The Coverage Remote start at entry Number 001"
chdir sNewPath
sdlginput "Remote Path" "Remote:" sRemote
set modem connection current
pause 2
strcat sRemCmd sSpace
strcat sRemCmd sRemote

transmit sRemCmd
mspause 250
transmit "^M"
waitfor "01:" FOREVER
if SUCCESS
while not feof 1
; First Column has a 4-Digit Number
; Second Column has a 3-Digit Number
; Third Colum has a 3-Digit Number
; Fourth Column has a 7-Digit Number
fgets 1 sLine
strlen sLine iLen
strtok sTok1 sLine "," 1 ;Extension Number
strtok sTok2 sLine "," 1 ;Coverage Path
strtok sTok3 sLine "," 1 ;Coverage Remote Entry Number
strtok sTok4 sLine "," 1 ;Remote Number
; usermsg "sTok1`"%s`" FOUND." sTok1
; usermsg "sTok4`"%s`" FOUND." sTok4
strcat sTok4 "^M"
transmit sTok4
mspause 125
endwhile
transmit "^[OR"
else
; Command aborted
transmit "^[OP"
endif
waitfor "Command successfully completed"
endif
endproc

proc NextPage
transmit "^[OV"
endproc


Any suggestions?
 
G'day Myflight - re "I tried a WHEN TARGET, but it does the Pagedown ("^[OV") immediatley. "

Do you mean that the script rolls on before the system has displayed the entire page?

To resolve this portion of your problem, try

proc NextPage
WHENQUIET
transmit "^[OV"
endproc


I'm at home (away from Aspect command reference), but there is also a way of ensuring WHEN TARGETS finish before another WHEN TARGET can activate. That may also help to ensure that things flow in order.
 
Yes Thanks to both KNOB and COMTECHAU the script I have does work now.

I will look into the When Target and Whenquiet commands this afternoon.

I am just trying to get a handle on these Avaya Scripts.
since the screen basically repaints. When you transmit data to the AVAY C switch there is no "COMMAND SUCCESFUL" or anything to verify the canges were made correctly.

I was hoping that someone may have some AVAYA script already written.

I guess I'll have to dig in and write them. I appreciate all the help.

I will post the completed scripts on the forum as soon as i finish. Assuming I don't run into anymore problems.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top