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!

Procomm script for adding NPA to a Nortel PBX

Status
Not open for further replies.

kprintz

Programmer
Oct 17, 2004
141
0
0
US
I need to add an additional NPA to all of my Nortel PBXs (54 of them). I want to route this new NPA the same way as an existing NPA. Does anyone have a script or can assist in creating a script that will;
1. Print an existing NPA.
2. Add the new NPA using the RLI printed in step 1.

The script would need to be able to read the RLI value printed from the existing NPA and add it at the RLI prompt for the NPA I am adding.

Thanks
Kevin
 
it's doable but how many rlb's are you using for npa's? i use a wud file to pull the new npa's from the txt format but have always sent virtuley all my npa's to just the rlb that picks the ld route as primary.. you may get a script over in the nortel meridian forum, 4 or 5 of us post scripts from time to time

john poole
bellsouth business
columbia,sc
 
BARS_NPA
this is a fairly clean script that puldd data from an excel, not using the get target command, but a workable script. not my work, i usually use simpler scripts when they do the job.


Code:
proc main

;**********************************************
;*                                            *
;*           BARS_NPA Programmer              *
;*                                            *
;*      v1.0     By Steven McMillen, TSR      *
;*                                            *
;*   This program will pull NPA info from     *
;*   an excel spreadsheet to program NPA      *
;*   RLI information for a Meridian PBX.      *
;*                                            *
;*   Excel file can be called anything but    *
;*   worksheet needs to be named 'NPA'.       *
;*   and must be open during script running   *
;*   Column A - NPA numbers 1201 - 1999       *
;*       Restricted numbers should not        *
;*       be included.                         *
;*   Column B - RLI number                    *
;*                                            *
;* Log into PBX and run from "carrot prompt"  *
;**********************************************


string npa,rli,sRowCol
integer col1,col2,row
long DDEChan
row = 2
col1 = 1
col2 = 2

thetop:

    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"

excelrip:
    
    ddeinit DDEChan "excel" "NPA"                            ;Creates link with Excel Spreadsheet
    if FAILURE                                    ;Error if cannot link
        usermsg "`a Unable to establish link `rwith Excel Spreadsheet"
        goto theend
        endif
    strfmt sRowCol "R%dC%d" Row Col1                         ;Pulling data in column A
    dderequest DDEChan sRowCol npa                            ;Assinging value to variable npa
    if stricmp npa  "end`r`n"                            ;Testing if end of data
        Transmit "^m"
        Waitfor "REQ"
        Transmit "****^m"
        usermsg "The end is here!`rThere is no more Data to input"
        goto theend
        endif
    strfmt sRowCol "R%dC%d" Row Col2                         ;Pulling data in column B
    dderequest DDEChan sRowCol rli
    strreplace npa "`n" ""                                ;Pulling line feed from string value
    strreplace rli "`n" ""                                ;Pulling line feed from string value
    row = row + 1                                    ;Increment row value
    
meridian:

    Transmit npa
    Waitfor "RLI"
    Transmit rli
    Waitfor "SDRR"
    Transmit "^m"
    Waitfor "ITEI"
    Transmit "^m"
    Waitfor "NPA"
    goto excelrip
    
theend:
    
    
endproc

******************************************************

Set up an excel document MAKE SURE THE WORKSHEET IS NAMED 'NPA'.  Have two colums, Column A is for your NPA's, Column B is for your RLI.  Be sure to have a column header as the script will start pulling from the 2nd row first. See example of Excel..

NPA     RLI
1200    2
1201    2
1202    3
1203    2

Make a template with your standard setup and remove all your Caribean codes or blocked number, modify to suit the customer.  Easy using features in excel to make the sheet quickly and once it's done, it's done.  When the script is ran it will start from the carrot prompt after login, it will enter ld 90 and program all NPA's on the excel sheet (keep sheet open during build). Sit back and watch.




BARS_NXX
*******************************************************
proc main

;**********************************************
;*                                            *
;*           BARS_NXX Programmer              *
;*                                            *
;*      v1.0     By Steven McMillen, TSR      *
;*                                            *
;*   This program will pull NXX info from     *
;*   an excel spreadsheet to program NXX      *
;*   RLI information for a Meridian PBX.      *
;*                                            *
;*   Excel file can be called anything but    *
;*   worksheet needs to be named 'NXX'.       *
;*   and must be open during script running   *
;*   Column A - NXX numbers 201 - 999         *
;*   Column B - RLI number                    *
;*                                            *
;* Log into PBX and run from "carrot prompt"  *
;**********************************************

string nxx,rli,sRowCol
integer col1,col2,row
long DDEChan
row = 2
col1 = 1
col2 = 2

thetop:

    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 "NXX^m"
    Waitfor "NXX"

excelrip:
    
    ddeinit DDEChan "excel" "NXX"                            ;Creates link with Excel Spreadsheet
    if FAILURE                                    ;Error if cannot link
        usermsg "`a Unable to establish link `rwith Excel Spreadsheet"
        goto theend
        endif
    strfmt sRowCol "R%dC%d" Row Col1                         ;Pulling data in column A
    dderequest DDEChan sRowCol nxx                            ;Assinging value to variable dn
    if stricmp nxx  "end`r`n"                            ;Testing if end of data
        Transmit "^m"
        Waitfor "REQ"
        Transmit "****^m"
        usermsg "The end is here!`rThere is no more Data to input"
        goto theend
        endif
    strfmt sRowCol "R%dC%d" Row Col2                         ;Pulling data in column B
    dderequest DDEChan sRowCol rli
    strreplace nxx "`n" ""                                ;Removing line feed from string
    strreplace nxx "`r" ""
    strreplace rli "`n" ""                                ;Removing line feed from string
    strreplace rli "`r" ""
    row = row + 1                                    ;Incrementing row counter
    
meridian:

    Transmit nxx
    mspause 50
    transmit "^m"
    Waitfor "RLI"
    Transmit rli
    mspause 50
    transmit "^m"
    Waitfor "SDRR"
    mspause 50
    Transmit "^m"
    Waitfor "ITEI"
    mspause 50
    Transmit "^m"
    Waitfor "NXX"
    goto excelrip
    
theend:
    
    
endproc
******************************************************

Set up an excel document MAKE SURE THE WORKSHEET IS NAMED 'NXX'.  Have two colums, Column A is for your NXX's, Column B is for your RLI.  Be sure to have a column header as the script will start pulling from the 2nd row first. See example of Excel..

NXX     RLI
200     2
201     2
202     3
203     2

Make a template with your standard setup, modify to suit the customer. Easy using features in excel to make the sheet quickly and once it's done, it's done. When the script is ran it will start from the carrot prompt after login, it will enter ld 90 and program all NPA's on the excel sheet (keep sheet open during build). Sit back and watch.



john poole
bellsouth business
columbia,sc
 
Here is one that I use.
You will have to edit the "info1" path to match where your capture folder is located.
I have one PC that is: "C:\Program Files\Symantec\Procomm Plus\Capture\NPA.txt"

You can delete the "1212" or edit it to use whatever NPA you wish.

*******************************************************
STRING INFO = "NPA.TXT"
STRING INFO1 = "C:\Procomm Plus\Capture\NPA.TXT"
STRING NPAPRT = "1212"
STRING NPATRN, RLI2, SDRR2, ITEI2
STRING S10, S11, S12, S13, S14, S15, S16, S17, S18

INTEGER EVENT
INTEGER POS = 0
INTEGER NITEM = 0
INTEGER LEN
integer non = 0
proc main

dialogbox 0 100 20 200 85 131 " NEW NPA DATA ENTRY"
pushbutton 9 43 44 40 13 "OK" OK
editbox 1 88 17 21 11 NPAPRT
pushbutton 10 114 44 40 13 "CANCEL" CANCEL
text 15 70 4 72 11 "NPA TO COPY FROM" left
enddialog

while 1
dlgevent 0 event
switch event
case 0
endcase
case 9
disable dlgctrl 0 1
call GET_NPA
endcase
case 10
disable dlgctrl 0 2
call end_0
endcase
default
endcase
endswitch
endwhile
endproc



PROC GET_NPA

transmit "****^M"
waitfor ">"
set capture file info
CAPTURE ON
transmit "LD 90^M"
waitfor "REQ "
transmit "PRT^M"
waitfor "CUST "
transmit "0^M"
waitfor "FEAT "
transmit "NET^M"
waitfor "TRAN "
transmit "AC1^M"
waitfor "TYPE "
transmit "NPA^M"
waitfor "NPA "
TRANSMIT NPAPRT
transmit "^M"
waitfor "REQ "
capture off
call get_file
ENDPROC

PROC GET_FILE

if fopen 0 info1 read text
call READ_FILE
else
errormsg "Couldn't open file `"%s`"." info
call end_0
endif

ENDPROC

PROC READ_FILE
fgets 0 s0
fgets 0 s1
fgets 0 s2
fgets 0 s3
fgets 0 s4
fgets 0 s5
fgets 0 s6
fgets 0 s7
fgets 0 s8
fgets 0 s9
fgets 0 s10
fgets 0 s11
fgets 0 s12
fgets 0 s13
fgets 0 s14
fgets 0 s15
LEN = 5
STRDELETE S15 POS LEN
STREXTRACT RLI2 S15 "RL" NITEM
fgets 0 s16
len = 4
strdelete s16 pos len
strextract sdrr2 s16 "sd" nitem
fgets 0 s17
len = 4
strdelete s17 pos len
strextract itei2 s17 "it" nitem
fgets 0 s18

dialogbox 0 100 20 212 105 131 " NEW NPA DATA ENTRY"
editbox 5 34 50 29 11 NPATRN
pushbutton 9 43 74 40 13 "OK" OK
editbox 6 77 50 18 11 RLI2
editbox 7 110 50 29 11 SDRR2
editbox 8 149 50 29 11 ITEI2
pushbutton 10 114 74 40 13 "CANCEL" CANCEL
editbox 1 34 17 29 11 NPAPRT
text 25 70 4 72 11 "NPA TO COPY FROM" left
text 26 44 34 117 11 "ENTER/CHANGE NEW NPA DATA" left
enddialog

while 1
dlgevent 0 event
switch event
case 0
endcase
case 9
disable dlgctrl 0 1
call NEW_NPA
endcase
case 10
disable dlgctrl 0 2
call end_1
endcase
default
endcase
endswitch
endwhile
endproc

PROC NEW_NPA

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 NPATRN
transmit "^M"
WHEN TARGET 0 "ESN072" CALL END_2
waitfor "RLI " 5
transmit RLI2
transmit "^M"
waitfor "SDRR "
STRREPLACE SDRR2 "NONE" "^M"
transmit SDRR2
waitfor "ITEI "
STRREPLACE ITEI2 "NONE" "^M"
transmit ITEI2
IF WAITFOR "NPA"
TRANSMIT "^M"
ENDIF
WAITFOR "REQ "
TRANSMIT "PRT"
TRANSMIT "^M"
waitfor "CUST "
transmit "0^M"
waitfor "FEAT "
transmit "NET^M"
waitfor "TRAN "
transmit "AC1^M"
waitfor "TYPE "
transmit "NPA^M"
waitfor "NPA "
TRANSMIT NPATRN
transmit "^M"
waitfor "REQ "
TRANSMIT "****^M"
CALL END_0
ENDPROC

proc end_0
delfile info1
exit
endproc

proc end_1
transmit "****^M"
waitfor ">" 5
delfile info1
exit
endproc

proc end_2
USERMSG "NPA` - %s - `ALREADY EXISTS" NPATRN
transmit "****^M"
waitfor ">" 5
delfile info1
exit
endproc

******************************************************
 
John do I get commission when you post my scripts :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top