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