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

script problem

Status
Not open for further replies.

Dougo123

Programmer
Nov 9, 2004
283
US
I edited one of John Poole's donated scripts to build I2002 phones and I'm having a couple of problems.
1. it takes around 30 seconds each to grab fields 2,3 & 4
2. it does'nt like the keys after it puts in the cpnd. It gives me sch0030's. Can anyone see what I'm doing wrong.
proc main
string sline, tn,key0,key1,cpnd

fopen 0 "PRI2002.TXT" READ ;Open our data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok tn sLine "`t" 1 ;Get the first field
strtok key0 sLine "`t" 1 ;Get the second field
strtok key1 sLine "`t" 1 ;Get the third field
strtok cpnd sLine "`t" 1 ;Get the fourth field
; strtok sTemp3 sLine "`t" 1 ;Get the FIFTH field

set txpace 30


transmit "NEW^M"
waitfor "TYPE: "
transmit "I2002^M"
waitfor "TN "
transmit tn
transmit "^M"
waitfor "DES "
transmit "PR^M"
waitfor "CUST "
transmit "0^M"
waitfor "ZONE "
transmit "3^M"
waitfor "FDN "
transmit "^M"
waitfor "TGAR "
transmit "12^M"
waitfor "LDN "
transmit "^M"
waitfor "NCOS "
transmit "4^M"
waitfor "RNPG "
transmit "200^M"
waitfor "SSU "
transmit "^M"
waitfor "SGRP "
transmit "^M"
waitfor "CLS "
transmit "CTD HTA LNA CNDA TDD ARHA IRA FTTU^M"
waitfor "HUNT "
transmit "000^M"
waitfor "LHK "
transmit "1^M"
waitfor "LNRS "
transmit "^M"
waitfor "SCI "
transmit "^M"
waitfor "LPK "
transmit "1^M"
waitfor "PLEV "
transmit "^M"
waitfor "AST "
transmit "^M"
waitfor "IAPG "
transmit "^M"
waitfor "MLWU_LANG "
transmit "^M"
waitfor "DNDR "
transmit "^M"
waitfor "key 0 "
transmit key0
transmit "^M"
waitfor "key "
transmit key1
transmit "^M"
waitfor " CPND "
transmit "NEW^M"
waitfor "name "
transmit cpnd
transmit "^M"
waitfor " XPLN "
transmit "^M"
waitfor " DISPLAY_FMT "
transmit "^M"
waitfor " VMB "
transmit "^M"
waitfor "key "
transmit "2 msb^M"
waitfor "KEY "
transmit "3 nrd^M"
waitfor "KEY "
transmit "^M"

endwhile

fclose 0

endproc

here's the text file
92 0 13 23 0 acd 6020001 0 6620096 1 scr 6120096 PR agent
92 0 13 24 0 acd 6020001 0 6620097 1 scr 6120097 PR agent
92 0 13 25 0 acd 6020001 0 6620098 1 scr 6120098 PR agent
92 0 13 26 0 acd 6020001 0 6620099 1 scr 6120099 PR agent
92 0 13 27 0 acd 6020001 0 6620100 1 scr 6120100 PR agent

after the sch0030's it does complete the phone and start building the next just key 2 and 3 are'nt programmed

this is what I get
HUNT 000
LHK 1
LNRS
SCI
LPK 1
PLEV
AST
IAPG
MLWU_LANG
DNDR
KEY
0 acd 6020001 0 6620096
KEY
AUD000
1 scr 6120096
MARP
CPND NEW
NAME PR agent
XPLN

DISPLAY_FMT
VMB
KEY
2 mSCH0030
sSCH0030
bSCH0030
 
Can you programme one with the same settings without the script?
If yes, try setting the trnsmit pacing a little bit higher (between 50 and 100)

line -> set txpace 30 set to 100
 
I'll try changing the xmit speed, the programing of the phone is an exact copy of previously programed phones so thats not an issue. I was more interested in why it had problems after the text file was done. I saw that John's script had more lines after mine and other people tried it and it was fine. This is also my first try at pulling info from another file. All my scripts that I manually enter the variables run fine.
I'm winging it basically, I know the basic editing, but everything else I'm learning by copying and seeing what happens.
 
i agree with the txt pace being a little slow, if your running at 9600.. the sch030, is from the M, might be a space there.. when you save the excel as a tab delimited, don't use that file.. do a crtl a, crtl c, then paste it into the aspect editor on a blank page.. at times, if i just drag and drop that file, i get some strange results as you've posted.. it may be excel leaving in some crtl trash for font or whatever that are background...

when i've had a simular problem with a tab delimited, i did a resave as a comma delimited.. but either way i don't run that copy, i copy the txt and paste it.. i think that aspect editor is more like the old dos edit then excel or word.. no font marks no color marks etc, that makes it better as a source file... post sch030, i'm on vacation for two weeks and don't have my switchroom laptop with the books with me..

john poole
bellsouth business
columbia,sc
 
I did do the drag and drop,I'll try it your way monday and also did try playing with the spacing. Also tried changing the key to adl, scr, etc.
The sch0030 is its looking for an alpha-numeric which of course it's getting so I'm thinking your right about my drag and drop.
I did'nt know you took vacations John, I actually thought you were a computer device built out of PBX parts that was sent by the Nortel God to help us find our way to the NTP's. Have A good Vacation and turn off your computer!!
 
Be very careful using a script to build a ACD phone. It could corrupt you database in the swith and then you are in trouble.
 
When you say it waits for about 30 seconds, that's the same as waitfor's timeout so that line is probably not finding the exact text inside the quotes. It might be because you've included spaces before and after some of the text in your waitfor lines. I'd remove those spaces in your script and see if it fixes that problem, and I'd also make sure to use uppercase - in other words, tell Procomm exactly what is should react to.

Right here where your capture shows:
KEY
2 mSCH0030
sSCH0030
bSCH0030

that indicates a carriage return was already sent after the word "KEY" was found and when the script sent "2 msb" the switch was already past that point and didn't understand what was being sent to it.

On some of my scripts Procomm was picking up the carriage return from the end of each line in the input file. In the line that opens the input file, word it like this instead:

fopen 0 "PRI2002.TXT" READ TEXT

That strips the carriage return (and also makes it so you don't need to drag and drop into the Aspect editor). Hope this helps.

Steve Harmon
Greenfield, Indiana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top