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!

Avaya Scripts For Changing Stations

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
Does anyone have any sample scripts for changing Stations in an Avaya?
I have written a script change/add Coverage Remote Entries. (Thanks to knob & comtechau)
However I still need to changes the Coverage Path and change the Station.


Here is the Script I wrote to add coverage paths 1 to 1000 (or 1001 to 1100) depending on teh Number entered.

proc main
integer iVar, iLen ; Number of entries in dialing class
string sLine, sTok1, sTok2, sTok3, sTok4, sTok5, 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 sPage ="PAGE"
string sRemCmd = "change coverage remote"
clear ; start with clean screen
capture on ; Open up the capture file.

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 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
strtok sTok5 sLine "," 1 ;Page break Identifier
; usermsg "sTok1`"%s`" FOUND." sTok1
; usermsg "sTok4`"%s`" FOUND." sTok4
strcmp sTok5 sPage
if SUCCESS
strcat sTok4 "^M"
transmit sTok4
mspause 125
transmit "^[OV"
else
strcat sTok4 "^M"
transmit sTok4
mspause 125
endif
endwhile
transmit "^[OR"
clear
else
; Command aborted
transmit "^[OP"
clear
endif
waitfor "Command successfully completed"
endif
capture off ;close capture file
endproc

proc NextPage
transmit "^[OV"
endproc


Any and all suggestions will be welcome.
 
Just a comment Re: This section
[blue]
; usermsg "sTok4`"%s`" FOUND." sTok4
strcmp sTok5 sPage
if SUCCESS
strcat sTok4 "^M"
transmit sTok4
mspause 125

transmit "^[OV"
else
strcat sTok4 "^M"
transmit sTok4
mspause 125

endif
[/blue]
You repeat 3 lines of code in both IF & ELSE sections, therefore I would think a 'shorter' method is...

; usermsg "sTok4`"%s`" FOUND." sTok4
strcat sTok4 "^M"
transmit sTok4
mspause 125

strcmp sTok5 sPage
if SUCCESS
transmit "^[OV"
endif

[red] Q for MyFlight - Is this script working for you, or do you still need help with it? [/red]
 
Reply,

Thanks for catching that.
And yes Thanks the script I have does work now.

I am just trying to get a handle on these Avaya Scripts.
since the screen basically repaints. you enter data and the is no "COMMAND SUCCESFUL" or anything to queue off of.

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