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

Nortel NPA entry - Ignore error message

Status
Not open for further replies.

cog4030

IS-IT--Management
Feb 18, 2004
30
0
0
US
I have a small script that adds new NPA's in approx 25 pbx's. Once in a while the NPA is already in the database and I get a ESN072 error.

transmit "LD 90^M"
waitfor "REQ "
transmit "NEW^M"
waitfor "CUST "
transmit "0^M"
waitfor "FEAT "
transmit "NET^M"
waitfor "TRAN "
transmit "AC1^M"
waitfor "TYPE "
transmit "NPA^M"
waitfor "NPA "
transmit "1971^M"
waitfor "RLI "
transmit "20^M"
waitfor "SDRR "
transmit "^M"
waitfor "ITEI "
transmit "^M"
waitfor "NPA "
transmit "1364^M"
And so on.....

From PBX:
REQ NEW
CUST 0
FEAT NET
TRAN AC1
TYPE NPA

NPA 1971

ESN072

NPA

As you can see by my crude script I am using the waitfor command. When it see's the ESN072 error it stops. How do I get it to ignore the error and enter the next NPA ??? Any pointers / directions would be appreciated !!

TIA





 
Check this tread:

Look for the
Code:
----- snip ----- 
   transmit "NPA^M"
   waitfor "NPA  "
   transmit NPATRN
   transmit "^M"
   WHEN TARGET 0 "ESN072" CALL END_2
   waitfor "RLI " 5
   transmit RLI2
   transmit "^M"
----- snip -----

proc end_2
USERMSG "NPA` -  %s  - `ALREADY EXISTS" NPATRN
transmit "****^M"
waitfor ">" 5
delfile info1
exit
endproc
This is one way to do it.

HTH
 
I tried that, It kicks me back to the REQ prompt in the PBX.

 
When it's possible for more than one string to be returned, I like using a procedure that another user here posted a long time back. You can find it find on this page:


Search for "josh" to find the discussion of the script. Basically it uses up to three when target commands to look for up to three different strings. The integer returned will tell you which string was returned first, or if none of the strings were received before the timeout value was reached.

 
How are you running your script, and what should it do
when the error ESN072 is returned?
 
I login to the PBX via Rlogin using a script, once I connect I run the NEWAC1 script.

transmit "LD 90^M"
waitfor "REQ "
transmit "NEW^M"
waitfor "CUST "
transmit "0^M"
waitfor "FEAT "
transmit "NET^M"
waitfor "TRAN "
transmit "AC1^M"
waitfor "TYPE "
transmit "NPA^M"
waitfor "NPA "
transmit "1971^M"

This is where the ESN072 response from the PBX occurs. I would like the program to jump down and transmit the next new NPA ( 1364 ). If that returns a ESN072, jump to the next.

waitfor "RLI "
transmit "20^M"
waitfor "SDRR "
transmit "^M"
waitfor "ITEI "
transmit "^M"
waitfor "NPA "
transmit "1364^M"
 
Don't think you can do that without some sort of flow control.

Basically what you want to do is make a list of new NPAs,
and then loop trough that list saying:
If ESN072 is returned, then skip to the next element in that list.

Depending on how many new NPAs you have, I think putting them
into an array, and then use a for-loop to loop through them,
would be a good choice.

That way, you can recycle your code and only change the array
values next time you want to add new NPAs.
 
Cog,

The correct way to do this would be to use a LOOP to enter each new NPA into the PBX.

The way you are doing it is LINEAR, which means that your script has to go line by line exactly as you have it written.

Without using a LOOP (most likely a WHILE loop), then you have no way of telling the script where to resume if it encounters a prompt that you are not WAITing FOR.

This seems like it could be a lot easier if you used one simple LOOP, and make it grab the NPA's to enter from a text file, since it doesn't seem like your NPA's are incrementing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top