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

Trouble with a Procomm Script 1

Status
Not open for further replies.

tfp2006

Programmer
Apr 28, 2006
51
US
I am having trouble with a procomm script. I think my tab deliminated file has an issue. Here is what I get when I run the script. It also changed the fields when I saved from excel to tab deliminated. thank you.

>****
OVL000
>ld 11
SL1000
MEM AVAIL: (U/P): 97479530 USED U P: 6667392 105491 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 632 USED: 128 TOT: 760
IP USERS AVAIL: 696 USED: 0 TOT: 696
BASIC IP USERS AVAIL: 0 USED: 0 TOT: 0
TEMPORARY IP USERS AVAIL: 0 USED: 0 TOT: 0
ACD AGENTS AVAIL: 32 USED: 0 TOT: 32
MOBILE EXTENSIONS AVAIL: 0 USED: 0 TOT: 0
TELEPHONY SERVICES AVAIL: 25 USED: 0 TOT: 25
NORTEL SIP LINES AVAIL: 0 USED: 0 TOT: 0
THIRD PARTY SIP LINES AVAIL: 0 USED: 0 TOT: 0
PCA AVAIL: 0 USED: 0 TOT: 0
AST AVAIL: 26 USED: 0 TOT: 26
SIP CONVERGED DESKTOPS AVAIL: 0 USED: 0 TOT: 0
SIP CTI TR87 AVAIL: 25 USED: 0 TOT: 25
TNS AVAIL: 31936 USED: 824 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ: new
TYPE: 3902
TN tSCH0030
TN nSCH0030
TN
SCH0120


Here is my script and txt file.

proc main

string sline, tn,ncos,rnpg,key0,cpnd

fopen 0 "3902.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 ncos sLine "`t" 1 ;Get the second field
strtok rnpg sLine "`t" 1 ;Get the third field
strtok key0 sLine "`t" 1 ;Get the fourth field
strtok cpnd sLine "`t" 1 ;Get the fifth field

set txpace 30
transmit "****^M"
waitfor ">"
transmit "ld 11^M"
waitfor "req:"
transmit "new^M"
waitfor "type"
transmit "3902^M"
waitfor "tn "
transmit tn
transmit "^M"
waitfor "des"
transmit "3902^M"
waitfor "CUST"
transmit "0^M"
waitfor "erl"
transmit "^M"
waitfor "fdn"
transmit "^M"
waitfor "tgar"
transmit "1^M"
waitfor "ldn"
transmit "^M"
waitfor "ncos"
transmit ncos
transmit "^M"
waitfor "rnpg"
transmit rnpg
transmit "^M"
waitfor "ssu"
transmit "^M"
waitfor "sgrp"
transmit "^M"
waitfor "cls"
transmit "CTD PUA HTA TDD HFA MWA LNA CNDA^M"
waitfor "hunt"
transmit "000^M"
waitfor "lhk"
transmit "0^M"
waitfor "lnrs"
transmit "^M"
waitfor "sci"
transmit "^M"
waitfor "plev"
transmit "^M"
waitfor “dani”


transmit “^M”
waitfor "ast"
transmit "^M"
waitfor "iapg"
transmit "^M"
waitfor "mlwu_lang"
transmit "^M"
waitfor "mlng"
transmit "^M"
waitfor "dndr"
transmit "^M"
waitfor "key "
transmit key0
transmit "^M"
waitfor "marp"
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 "1 rnp^M"
waitfor "key"
transmit "2 cfw 4^M"
waitfor "key"
transmit "3 ao6^M"
waitfor "key"
transmit "4 trn^M"
waitfor "key"
transmit "5 mwk 4900^M"


endwhile

fclose 0


endproc


tn ncos rnpg key0 cpnd
12 1 7 10 4 1 2089 peter parker


 
I don't use it, but it looks like it is too fast, can you put a wait 1 after entering 3902 at the type prompt?

Mato' Was'aka
 
I can see the prob I think

REQ: new
TYPE: 3902
TN [red]t[/red]SCH0030
TN [red]n[/red]SCH0030
TN
SCH0120

It looks to me like your script is trying to type "[red]tn[/red]" when the system is waiting for the numeric TN


[©] GHTROUT.com [⇔] A Variety of Free Resources for Nortel Meridian/CS1000 System Administrators
 
Your text file should have data on the first line, not column headers.
 
Maybe it's the first line of the data file? The heading?

[©] GHTROUT.com [⇔] A Variety of Free Resources for Nortel Meridian/CS1000 System Administrators
 
ya :)

[©] GHTROUT.com [⇔] A Variety of Free Resources for Nortel Meridian/CS1000 System Administrators
 
I edited the text file and have the same result. Do I need to edit the script to read the tn?

12 1 7 10 4 1 2089 peter parker

>****
OVL000
>ld 11
SL1000
MEM AVAIL: (U/P): 97479496 USED U P: 6667392 105525 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 632 USED: 128 TOT: 760
IP USERS AVAIL: 696 USED: 0 TOT: 696
BASIC IP USERS AVAIL: 0 USED: 0 TOT: 0
TEMPORARY IP USERS AVAIL: 0 USED: 0 TOT: 0
ACD AGENTS AVAIL: 32 USED: 0 TOT: 32
MOBILE EXTENSIONS AVAIL: 0 USED: 0 TOT: 0
TELEPHONY SERVICES AVAIL: 25 USED: 0 TOT: 25
NORTEL SIP LINES AVAIL: 0 USED: 0 TOT: 0
THIRD PARTY SIP LINES AVAIL: 0 USED: 0 TOT: 0
PCA AVAIL: 0 USED: 0 TOT: 0
AST AVAIL: 26 USED: 0 TOT: 26
SIP CONVERGED DESKTOPS AVAIL: 0 USED: 0 TOT: 0
SIP CTI TR87 AVAIL: 25 USED: 0 TOT: 25
TNS AVAIL: 31936 USED: 824 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ: new
TYPE: 3902
TN tSCH0030
TN nSCH0030
TN
SCH0120
TN
 
for some reason, your script is transmitting 't', followed by 'n' at the TN prompt, and not the value that should be in the tn variable.

Have you tested your script to make sure the variables are loading correctly from the file?
 
I cleaned up my script and its almost working. It seems to finish after key 0.


>ld 11
SL1000
MEM AVAIL: (U/P): 97479496 USED U P: 6667392 105525 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 632 USED: 128 TOT: 760
IP USERS AVAIL: 696 USED: 0 TOT: 696
BASIC IP USERS AVAIL: 0 USED: 0 TOT: 0
TEMPORARY IP USERS AVAIL: 0 USED: 0 TOT: 0
ACD AGENTS AVAIL: 32 USED: 0 TOT: 32
MOBILE EXTENSIONS AVAIL: 0 USED: 0 TOT: 0
TELEPHONY SERVICES AVAIL: 25 USED: 0 TOT: 25
NORTEL SIP LINES AVAIL: 0 USED: 0 TOT: 0
THIRD PARTY SIP LINES AVAIL: 0 USED: 0 TOT: 0
PCA AVAIL: 0 USED: 0 TOT: 0
AST AVAIL: 26 USED: 0 TOT: 26
SIP CONVERGED DESKTOPS AVAIL: 0 USED: 0 TOT: 0
SIP CTI TR87 AVAIL: 25 USED: 0 TOT: 25
TNS AVAIL: 31936 USED: 824 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ: new
TYPE: 3902
TN 12 1 7 10
DES 3902
CUST 0
ERL
FDN
TGAR 1
LDN
NCOS 4
RNPG 1
SSU
SGRP
CLS CTD PUA HTA TDD HFA MWA LNA CNDA
RCO
HUNT 000
LHK 0
LNRS
SCI
PLEV
DANI
AST
IAPG
MLWU_LANG
MLNG
DNDR
KEY 0 scr 2089
MARP
CPND new
NAME peter parker
XPLN

DISPLAY_FMT
VMB
KEY

MGMT001 TNB NEW TYPE:3902 TN:12 1 7 10

MEM AVAIL: (U/P): 97479292 USED U P: 6667474 105647 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 631 USED: 129 TOT: 760
IP USERS AVAIL: 696 USED: 0 TOT: 696
BASIC IP USERS AVAIL: 0 USED: 0 TOT: 0
TEMPORARY IP USERS AVAIL: 0 USED: 0 TOT: 0
ACD AGENTS AVAIL: 32 USED: 0 TOT: 32
MOBILE EXTENSIONS AVAIL: 0 USED: 0 TOT: 0
TELEPHONY SERVICES AVAIL: 25 USED: 0 TOT: 25
NORTEL SIP LINES AVAIL: 0 USED: 0 TOT: 0
THIRD PARTY SIP LINES AVAIL: 0 USED: 0 TOT: 0
PCA AVAIL: 0 USED: 0 TOT: 0
AST AVAIL: 26 USED: 0 TOT: 26
SIP CONVERGED DESKTOPS AVAIL: 0 USED: 0 TOT: 0
SIP CTI TR87 AVAIL: 25 USED: 0 TOT: 25
TNS AVAIL: 31935 USED: 825 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ:
REQ NEW
TYPE: 1 rnp
SCH0099 1? : 1110 1120 1130...
 
The first time you are waiting for "key ", the other times you are waiting for "key".
 
one problem with your original script.. every waitfor line is lower case.. waitfor "req:" should read waitfor "REQ: "..


best bet is to do a script record, then the waitfor matches the switch.. if a script waits for req, the switch sends REQ:.. the script does not match..


john poole
bellsouth business
columbia,sc
 
John,

I updated the script but it still fails at the same place.

proc main

string sline, tn,ncos,rnpg,key0,cpnd

fopen 0 "3902.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 ncos sLine "`t" 1 ;Get the second field
strtok rnpg sLine "`t" 1 ;Get the third field
strtok key0 sLine "`t" 1 ;Get the fourth field
strtok cpnd sLine "`t" 1 ;Get the fifth field

set txpace 30
transmit "ld 11^M"
waitfor "REQ:"
transmit "new^M"
waitfor "TYPE"
transmit "3902^M"
waitfor "TN "
transmit tn
transmit "^M"
waitfor "DES"
transmit "3902^M"
waitfor "CUST"
transmit "0^M"
waitfor "ERL"
transmit "^M"
waitfor "FDN"
transmit "^M"
waitfor "TGAR"
transmit "1^M"
waitfor "LDN"
transmit "^M"
waitfor "NCOS"
transmit ncos
transmit "^M"
waitfor "RNPG"
transmit rnpg
transmit "^M"
waitfor "SSU"
transmit "^M"
waitfor "SGRP"
transmit "^M"
waitfor "CLS"
transmit "CTD PUA HTA TDD HFA MWA LNA CNDA^M"
waitfor “RCO”
transmit “^M”
waitfor "HUNT"
transmit "000^M"
waitfor "LHK"
transmit "0^M"
waitfor "LNRS"
transmit "^M"
waitfor "SCI"
transmit "^M"
waitfor "PLEV"
transmit "^M"
waitfor “DANI”
transmit “^M”
waitfor "AST"
transmit "^M"
waitfor "IAPG"
transmit "^M"
waitfor "MLWU_LANG"
transmit "^M"
waitfor "MLNG"
transmit "^M"
waitfor "DNDR"
transmit "^M"
waitfor "KEY"
transmit key0
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 "1 rnp^M"
waitfor "KEY"
transmit "2 cfw 4^M"
waitfor "KEY"
transmit "3 ao6^M"
waitfor "KEY"
transmit "4 trn^M"
waitfor "KEY"
transmit "5 mwk 4900^M"


endwhile

fclose 0


endproc



>ld 11
SL1000
MEM AVAIL: (U/P): 97479462 USED U P: 6667392 105559 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 632 USED: 128 TOT: 760
IP USERS AVAIL: 696 USED: 0 TOT: 696
BASIC IP USERS AVAIL: 0 USED: 0 TOT: 0
TEMPORARY IP USERS AVAIL: 0 USED: 0 TOT: 0
ACD AGENTS AVAIL: 32 USED: 0 TOT: 32
MOBILE EXTENSIONS AVAIL: 0 USED: 0 TOT: 0
TELEPHONY SERVICES AVAIL: 25 USED: 0 TOT: 25
NORTEL SIP LINES AVAIL: 0 USED: 0 TOT: 0
THIRD PARTY SIP LINES AVAIL: 0 USED: 0 TOT: 0
PCA AVAIL: 0 USED: 0 TOT: 0
AST AVAIL: 26 USED: 0 TOT: 26
SIP CONVERGED DESKTOPS AVAIL: 0 USED: 0 TOT: 0
SIP CTI TR87 AVAIL: 25 USED: 0 TOT: 25
TNS AVAIL: 31936 USED: 824 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ: new
TYPE: 3902
TN 12 1 7 10
DES 3902
CUST 0
ERL
FDN
TGAR 1
LDN
NCOS 4
RNPG 1
SSU
SGRP
CLS CTD PUA HTA TDD HFA MWA LNA CNDA
RCO
HUNT 000
LHK 0
LNRS
SCI
PLEV
DANI
AST
IAPG
MLWU_LANG
MLNG
DNDR
KEY 0 scr 2089
MARP
CPND new
NAME peter parker
XPLN

DISPLAY_FMT
VMB
KEY

MGMT001 TNB NEW TYPE:3902 TN:12 1 7 10

MEM AVAIL: (U/P): 97479258 USED U P: 6667474 105681 TOT: 104252413
DISK SPACE NEEDED: 161 KBYTES
DIGITAL TELEPHONES AVAIL: 631 USED: 129 TOT: 760
IP USERS AVAIL: 696 USED: 0 TOT: 696
BASIC IP USERS AVAIL: 0 USED: 0 TOT: 0
TEMPORARY IP USERS AVAIL: 0 USED: 0 TOT: 0
ACD AGENTS AVAIL: 32 USED: 0 TOT: 32
MOBILE EXTENSIONS AVAIL: 0 USED: 0 TOT: 0
TELEPHONY SERVICES AVAIL: 25 USED: 0 TOT: 25
NORTEL SIP LINES AVAIL: 0 USED: 0 TOT: 0
THIRD PARTY SIP LINES AVAIL: 0 USED: 0 TOT: 0
PCA AVAIL: 0 USED: 0 TOT: 0
AST AVAIL: 26 USED: 0 TOT: 26
SIP CONVERGED DESKTOPS AVAIL: 0 USED: 0 TOT: 0
SIP CTI TR87 AVAIL: 25 USED: 0 TOT: 25
TNS AVAIL: 31935 USED: 825 TOT: 32760
DATA PORTS AVAIL: 32760 USED: 0 TOT: 32760

REQ:
REQ NEW
TYPE: 1 rnp
 
As bigindian65 wrote, "transmit speed". It might be worth adjusting your Procomm "Transmit Pacing"

set txpace 80 maybe

[©] GHTROUT.com [⇔] A Variety of Free Resources for Nortel Meridian/CS1000 System Administrators
 
let me see your tab delimited, just the 1st 2 or 3 lines

john poole
bellsouth business
columbia,sc
 
text pace can be a problem IF the script is outpacing the term.. here's it is seeing rnp as col 1.. the columns do have to be in the same order that they are used.. i build my delimited in excel and save as a comma delimited.. then change each of these lines " strtok tn sLine "`t" 1" to strtok tn sLine "`," 1,.. then open your comma delimited. copy and paste that data into ascept editor and do a save as txt.wud... most of the time my script wants to hand if i use a txt or rich txt format.. it gives me extra ^M..

john poole
bellsouth business
columbia,sc
 
Is the script stopping as though it completed or is it giving you an error?
 
i never saw a script i couldn't fix or a switch i couldn't break,,

john poole
bellsouth business
columbia,sc
 
I only have one phone built in the script so far. Here it is.

12 1 7 10 4 1 0 scr 2089 peter parker
 
the script seems to complete and then try to add the key 1 etc.
 
try building it in excel.. and save as comma delimited.. the 1st line can not be blank.. because it's a txt file, not tab or comma delimited, the script can not distinguish the columns


john poole
bellsouth business
columbia,sc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top