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

Meridian Script 4

Status
Not open for further replies.

janaya

IS-IT--Management
May 7, 2002
2,292
US
I am looking for a simplified script that will build analog phones. I have a script and can post if you want to take a look, but it's very complicated.

I want to take a spreadsheet that will have all the information for new phones. A bunch of them.

Anyone have any ideas or any scripts already written?

Any help would be appreciated.

John
 
a script for building analog phones should be very simple, post yours and i'll see if i can improve it. pepedog.com has a macro that will let you print a tnb and turn it into an excel that has one station per line. very useful.

john poole
bellsouth business
columbia,sc
 
This is one that I had on a project, but, yes, I wanted to build the phones from a spreadsheet like the one at pepedog. I have just never used a script. I can type pretty fast and usually set keys on my procomm for faster entry of info, but I have a LOT to build.



#include "Parse.h" ; Includes a smarter line parser, called "ParseCSV"
#include "ACDcomm.h" ; Includes smarter ACD communication functions
#include "EasyFile.h" ; Includes a function for writing a log file

;DES TN TYPE DN DN2 NAME XLST NCOS FDN HUNT TGAR ZONE CLID
;313012 148 0 4 0 i2002 16151 9316151 "Othertest,Justin" 1 7 85300 85300 1 0 1

string LogFile="AA_Load.txt"

integer MWK_testing=0 ; production
string MWK_phone="35500" ; production
;integer MWK_testing=1
;string MWK_phone="35300" ;testing

string xdes, xtn, xtype, xdn ; variables to be extracted from
string xdn2, xname, xxlst, xncos ; inut string from file.
string xfdn, xhunt, xtgar, xzone, xclid, xcube

string xacd, xpos

integer iTimeout=30

proc main


string FName ; Declaration of File name to be opened.
string SkipValue
string LineBuffer ; Declaration of variable LineBuffer for Line to be read from file.
string FmtStatMsg
integer nItem = 0 ; nItem - next comma delimited field in LineBuffer
integer iResult


statmsg "Enter the name of the source file that has DESC, TN, TYPE, DN, and NAME defined."
sdlginput "Source File for phone Sets" "Enter File Name :" FName

; Handle skipping records
SkipValue=""
sdlgmsgbox "Skip records" "Do you want to skip any phone records?" QUESTION YESNOCANCEL iResult
if iResult == 6 ; YES pressed
sdlginput "Tell me where to start" "Enter unique value in first record to process:" SkipValue
elseif iResult == 7 ; NO pressed
SkipValue=""
elseif iResult == 2 ; CANCEL pressed
statclear
; strfmt FmtStatMsg "Unknown PHONE type : %s" xtype
sdlgmsgbox "Program Stopping" "User pressed <Cancel>" STOP OK iResult
exit
endif

if isfile FName ; Make sure file exists.
fopen 0 FName READ TEXT ; Open file for read.
while not feof 0
strfmt FmtStatMsg "Processing input file: %s" FName
LineOut(LogFile, FmtStatMsg)

fgets 0 LineBuffer
If not strcmp SkipValue ""
If strfind LineBuffer SkipValue
SkipValue = "" ; Stop skipping records and start processing
else
strfmt FmtStatMsg "Skipping: %s" LineBuffer
fgets 0 linebuffer
loopwhile
Endif
endif

WaitForSend(LogFile, iTimeOut, "", "ld 20^M") ; Initiate programming mode
LineOut(LogFile, LineBuffer)
while not feof 0 ; Loop while not end of file.
strfmt FmtStatMsg "Processing line:%s" LineBuffer
statmsg FmtStatMsg

; Read all the fields from each line
nItem = 0
xdes = ParseCSV(LineBuffer, nItem++) ; extract DESC
xtn = ParseCSV(LineBuffer, nItem++) ; extract TN
xtype = ParseCSV(LineBuffer, nItem++) ; extract TYPE
xdn = ParseCSV(LineBuffer, nItem++) ; extract DN
xdn2 = ParseCSV(LineBuffer, nItem++) ; extract DN2
xname = ParseCSV(LineBuffer, nItem++) ; extract NAME
xxlst = ParseCSV(LineBuffer, nItem++) ; extract XLST
xncos = ParseCSV(LineBuffer, nItem++) ; extract NCOS
xfdn = ParseCSV(LineBuffer, nItem++) ; extract FDN
xhunt = ParseCSV(LineBuffer, nItem++) ; extract HUNT
xtgar = ParseCSV(LineBuffer, nItem++) ; extract TGAR
xzone = ParseCSV(LineBuffer, nItem++) ; extract ZONE
xclid = ParseCSV(LineBuffer, nItem++) ; extract CLID
xcube = ParseCSV(LineBuffer, nItem++) ; extract cube_loc

; The DES will be the cube_loc value now
xdes = xcube

; Program a phone - this script should handle all types!

switch xtype
case "500"
Program_500() ; Analog USER/FAX/MODEM
endcase

; case "500F"
; Program_500F() ; Analog FAX
; endcase

; case "500M"
; Program_500M() ; Analog MODEM
; endcase

case "3903"
Program_3903() ; 3903
endcase

case "3904"
Program_3904() ; 3904
endcase

case "3905"
Program_3905() ; 3905
endcase

case "i2002"
Program_i2002()
endcase

case "i2004"
Program_i2004()
endcase

default
strfmt FmtStatMsg "Unknown PHONE type : %s" xtype
sdlgmsgbox "Program Stopping" FmtStatMsg STOP OK iResult
exit
endcase
endswitch


; read next line
fgets 0 linebuffer

endwhile
endwhile

WaitForSend(LogFile, iTimeOut, "REQ:", "****^M")
fclose 0 ; Close file opened for read.
statclear

else
errormsg "Couldn't open file `"%s`"." FName
statclear
endif


endproc

;=================================================
; Program a 500 type USER phone
;=================================================
Func Program_500 : integer

WaitForSend(LogFile, iTimeOut, "REQ:", "new^M")

WaitForSend(LogFile, iTimeOut, "TYPE: ", "500^M")

WaitForSend(LogFile, iTimeOut, "TN ", xtn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CDEN ", "^M")

WaitForSend(LogFile, iTimeOut, "DES", xdes)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CUST", "0^M")

WaitForSend(LogFile, 1, "WRLS", "^M")

WaitForSend(LogFile, iTimeOut, "DIG ", "^M")

WaitForSend(LogFile, iTimeOut, "DN ", xdn)
WaitForSend(LogFile, iTimeOut, "", " ")
WaitForSend(LogFile, iTimeOut, "", xclid)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CPND ", "new^M")

WaitForSend(LogFile, iTimeOut, "NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN", "^M")

WaitForSend(LogFile, iTimeOut, "DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, "VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "AST ", "^M")

WaitForSend(LogFile, iTimeOut, "IAPG ", "^M")

WaitForSend(LogFile, iTimeOut, "HUNT ", "^M")

WaitForSend(LogFile, iTimeOut, "TGAR ", xtgar)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LDN ", "^M")

WaitForSend(LogFile, iTimeOut, "NCOS ", xncos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "RNPG ", "^M")

WaitForSend(LogFile, iTimeOut, "XLST ", "1^M")

; WaitForSend(LogFile, iTimeOut, "SCPW ", "^M")

WaitForSend(LogFile, iTimeOut, "SGRP ", "^M")

WaitForSend(LogFile, iTimeOut, "CLS ", "ctd dtn xfa xra^M")

WaitForSend(LogFile, iTimeOut, "SCI ", "^M")

WaitForSend(LogFile, iTimeOut, "MLWU_LANG ", "^M")

WaitForSend(LogFile, iTimeOut, "PLEV ", "^M")

WaitForSend(LogFile, iTimeOut, "FTR ", "cfw 5^M")

WaitForSend(LogFile, iTimeOut, "FTR ", "^M")
return 0
Endfunc


;=================================================
; Program a 500 type FAX phone
;=================================================
Func Program_500F : integer

WaitForSend(LogFile, iTimeOut, "REQ:", "new^M")

WaitForSend(LogFile, iTimeOut, "TYPE: ", "500^M")

WaitForSend(LogFile, iTimeOut, "TN ", xtn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CDEN ", "^M")

WaitForSend(LogFile, iTimeOut, "DES ", xdes)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CUST ", "0^M")

WaitForSend(LogFile, iTimeOut, "DIG ", "^M")

WaitForSend(LogFile, iTimeOut, "DN ", xdn)
WaitForSend(LogFile, iTimeOut, "", xclid)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, " CPND ", "new^M")

WaitForSend(LogFile, iTimeOut, " NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, " DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, " VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "AST ", "^M")

WaitForSend(LogFile, iTimeOut, "IAPG ", "^M")

WaitForSend(LogFile, iTimeOut, "HUNT ", xhunt)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TGAR ", xtgar)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LDN ", "^M")

WaitForSend(LogFile, iTimeOut, "NCOS ", xncos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "RNPG ", "^M")

WaitForSend(LogFile, iTimeOut, "SCPW ", "^M")

WaitForSend(LogFile, iTimeOut, "SGRP ", "^M")

WaitForSend(LogFile, iTimeOut, "CLS ", "ctd dtn^M")

WaitForSend(LogFile, iTimeOut, "SCI ", "^M")

WaitForSend(LogFile, iTimeOut, "MLWU_LANG ", "^M")

WaitForSend(LogFile, iTimeOut, "PLEV ", "^M")

WaitForSend(LogFile, iTimeOut, "FTR ", "cfw 5^M")

WaitForSend(LogFile, iTimeOut, "FTR ", "^M")
return 0
Endfunc


;=================================================
; Program a 500 type MODEM phone
;=================================================
Func Program_500M : integer


WaitForSend(LogFile, iTimeOut, "REQ:", "new^M")

WaitForSend(LogFile, iTimeOut, "TYPE: ", "500^M")

WaitForSend(LogFile, iTimeOut, "TN ", xtn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CDEN ", "^M")

WaitForSend(LogFile, iTimeOut, "DES ", xdes)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CUST ", "0^M")

WaitForSend(LogFile, iTimeOut, "DIG ", "^M")

WaitForSend(LogFile, iTimeOut, "DN ", xdn)
WaitForSend(LogFile, iTimeOut, "", xclid)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, " CPND ", "new^M")

WaitForSend(LogFile, iTimeOut, " NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, " DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, " VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "AST ", "^M")

WaitForSend(LogFile, iTimeOut, "IAPG ", "^M")

WaitForSend(LogFile, iTimeOut, "HUNT ", xhunt)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TGAR ", xtgar)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LDN ", "^M")

WaitForSend(LogFile, iTimeOut, "NCOS ", xncos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "RNPG ", "^M")

WaitForSend(LogFile, iTimeOut, "SCPW ", "^M")

WaitForSend(LogFile, iTimeOut, "SGRP ", "^M")

WaitForSend(LogFile, iTimeOut, "CLS ", "ctd dtn^M")

WaitForSend(LogFile, iTimeOut, "SCI ", "^M")

WaitForSend(LogFile, iTimeOut, "MLWU_LANG ", "^M")

WaitForSend(LogFile, iTimeOut, "PLEV ", "^M")

WaitForSend(LogFile, iTimeOut, "FTR ", "cfw 5^M")

WaitForSend(LogFile, iTimeOut, "FTR ", "^M")
return 0
Endfunc


;=================================================
; Program a 3903 type phone
;=================================================

Func Program_3903 : integer

string xLast5

WaitForSend(LogFile, iTimeOut, "REQ:", "new^M")

WaitForSend(LogFile, iTimeOut, "TYPE: ", xtype)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TN ", xtn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "DES ", xdes)
WaitForSend(LogFile, iTimeOut, "", "^M")

; strright LChar xtn 2 ; Get right 2 chars from TN
; if not strcmp LChar " 0" ; If not first Unit (Loop Card Shelf Unit)
; WaitForSend(LogFile, iTimeOut, "CTYP ", "XDLC^M")
; endif

; WaitForSend(LogFile, iTimeOut, "CTYP ", "^M")

WaitForSend(LogFile, iTimeOut, "CUST ", "0^M")

strright xlast5 xfdn 5
WaitForSend(LogFile, iTimeOut, "FDN ", xlast5)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TGAR ", xtgar)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LDN ", "^M")

WaitForSend(LogFile, iTimeOut, "NCOS ", xncos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "RNPG ", "^M")

WaitForSend(LogFile, iTimeOut, "SSU ", "^M")

WaitForSend(LogFile, iTimeOut, "XLST ", "1^M")

WaitForSend(LogFile, iTimeOut, "SGRP ", "^M")

WaitForSend(LogFile, iTimeOut, "CLS ", "fna hta hfa mwa ira nia ola lna cdca cnda dnda mcta tdd^M")

WaitForSend(LogFile, iTimeOut, "RCO ", "^M")

strright xlast5 xhunt 5
WaitForSend(LogFile, iTimeOut, "HUNT ", xlast5)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LHK ", "1^M")

WaitForSend(LogFile, iTimeOut, "LNRS ", "^M")

WaitForSend(LogFile, iTimeOut, "SCI ", "^M")

WaitForSend(LogFile, iTimeOut, "LPK ", "1^M")

WaitForSend(LogFile, iTimeOut, "PLEV ", "^M")

WaitForSend(LogFile, iTimeOut, "AST ", "^M")

WaitForSend(LogFile, iTimeOut, "IAPG ", "^M")

WaitForSend(LogFile, iTimeOut, "MLWU_LANG ", "^M")

WaitForSend(LogFile, iTimeOut, "MLNG ", "^M")

WaitForSend(LogFile, iTimeOut, "DNDR ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "0 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn)
WaitForSend(LogFile, iTimeOut, "", " ")
WaitForSend(LogFile, iTimeOut, "", xclid)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CPND ", "new^M")

WaitForSend(LogFile, iTimeOut, "NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN", "^M")

WaitForSend(LogFile, iTimeOut, "DISPLAY_FMT ", "^M")


WaitForSend(LogFile, iTimeOut, " VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "1 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn2)
WaitForSend(LogFile, iTimeOut, "", " D^M")

WaitForSend(LogFile, iTimeOut, " CPND ", "new^M")

WaitForSend(LogFile, iTimeOut, " NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN ", "^M")

WaitForSend(LogFile, iTimeOut, "DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, " VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "2 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "3 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "16 mwk ")
If MWK_testing
WaitForSend(LogFile, iTimeOut, "", MWK_phone)
else
WaitForSend(LogFile, iTimeOut, "", xfdn)
endif
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "19 cfw 5^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "20 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "21 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "22 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "23 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "24 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "25 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "26 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "27 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "28 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "^M")

return 0
Endfunc

;=================================================
; Program a 3904 type phone
;=================================================

Func Program_3904 : integer

string xlast5

WaitForSend(LogFile, iTimeOut, "REQ:", "new^M")

WaitForSend(LogFile, iTimeOut, "TYPE: ", xtype)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TN ", xtn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "DES ", xdes)
WaitForSend(LogFile, iTimeOut, "", "^M")

; strright LChar xtn 2 ; Get right 2 chars from TN
; if not strcmp LChar " 0" ; If not first Unit (Loop Card Shelf Unit)
; WaitForSend(LogFile, iTimeOut, "CTYP ", "XDLC^M")
; endif

; WaitForSend(LogFile, 1, "CTYP ", "^M")

WaitForSend(LogFile, iTimeOut, "CUST ", "0^M")

WaitForSend(LogFile, iTimeOut, "KBA ", "^M")

WaitForSend(LogFile, iTimeOut, "DBA ", "^M")

strright xlast5 xfdn 5
WaitForSend(LogFile, iTimeOut, "FDN ", xlast5)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TGAR ", xtgar)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LDN ", "^M")

WaitForSend(LogFile, iTimeOut, "NCOS ", xncos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "RNPG ", "^M")

WaitForSend(LogFile, iTimeOut, "SSU ", "^M")

WaitForSend(LogFile, iTimeOut, "XLST ", "1^M")

WaitForSend(LogFile, iTimeOut, "SGRP ", "^M")

WaitForSend(LogFile, iTimeOut, "CLS ", "fna hta hfa mwa ira nia ola lna cnda cdca mcta dnda tdd^M")

WaitForSend(LogFile, iTimeOut, "RCO ", "^M")

strright xlast5 xhunt 5
WaitForSend(LogFile, iTimeOut, "HUNT ", xlast5)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LHK ", "1^M")

WaitForSend(LogFile, iTimeOut, "LNRS ", "^M")

WaitForSend(LogFile, iTimeOut, "SCI ", "^M")

WaitForSend(LogFile, iTimeOut, "LPK ", "1^M")

WaitForSend(LogFile, iTimeOut, "PLEV ", "^M")

WaitForSend(LogFile, iTimeOut, "AST ", "^M")

WaitForSend(LogFile, iTimeOut, "IAPG ", "^M")

WaitForSend(LogFile, iTimeOut, "MLWU_LANG ", "^M")

WaitForSend(LogFile, iTimeOut, "MLNG ", "^M")

WaitForSend(LogFile, iTimeOut, "DNDR ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "0 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn)
WaitForSend(LogFile, iTimeOut, "", " ")
WaitForSend(LogFile, iTimeOut, "", xclid)
WaitForSend(LogFile, iTimeOut, "", "^M")

; This line is sent by switch, but switch doesn't wait for ENTER to be pressed
; WaitForSend(LogFile, iTimeOut, "MARP", "^M")

WaitForSend(LogFile, iTimeOut, "CPND", "new^M")

WaitForSend(LogFile, iTimeOut, "NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN", "^M")

WaitForSend(LogFile, iTimeOut, "DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, "VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "1 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn2)
WaitForSend(LogFile, iTimeOut, "", " D")
WaitForSend(LogFile, iTimeOut, "", "^M")

; WaitForSend(LogFile, iTimeOut, "MARP", "^M")

WaitForSend(LogFile, iTimeOut, "CPND", "new^M")

WaitForSend(LogFile, iTimeOut, "NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN", "^M")

WaitForSend(LogFile, iTimeOut, "DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, "VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "2 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "3 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "4 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "5 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "6 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "7 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "8 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "9 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "10 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "11 adl 16^M")

; WaitForSend(LogFile, iTimeOut, "KEY ", "16 mwk 35500 ")
WaitForSend(LogFile, iTimeOut, "KEY ", "16 mwk ")
WaitForSend(LogFile, iTimeOut, "", MWK_phone)
;WaitForSend(LogFile, iTimeOut, "", xfdn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "18 ao6 ^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "17 trn ^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "19 cfw 5^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "20 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "21 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "22 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "23 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "24 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "25 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "26 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "27 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "28 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "^M")

return 0
Endfunc

;=================================================
; Program a 3905 type phone
;=================================================

Func Program_3905 : integer

string LChar

WaitForSend(LogFile, iTimeOut, "REQ:", "new^M")

WaitForSend(LogFile, iTimeOut, "TYPE: ", xtype)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TN ", xtn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "DES ", xdes)
WaitForSend(LogFile, iTimeOut, "", "^M")

strright LChar xtn 2 ; Get right 2 chars from TN
if not strcmp LChar " 0" ; If not first Unit (Loop Card Shelf Unit)
WaitForSend(LogFile, iTimeOut, "CTYP ", "XDLC^M")
endif

WaitForSend(LogFile, iTimeOut, "CUST ", "0^M")

WaitForSend(LogFile, iTimeOut, "KBA ", "^M")

WaitForSend(LogFile, iTimeOut, "DBA ", "^M")

WaitForSend(LogFile, iTimeOut, "FDN ", xfdn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TGAR ", xtgar)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LDN ", "^M")

WaitForSend(LogFile, iTimeOut, "NCOS ", xncos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "RNPG ", "^M")

WaitForSend(LogFile, iTimeOut, "SSU ", "0000^M")

WaitForSend(LogFile, iTimeOut, "XLST ", xxlst)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "SGRP ", "^M")

WaitForSend(LogFile, iTimeOut, "CLS ", "AGN LNA CNDA MCTA^M")

WaitForSend(LogFile, iTimeOut, "HUNT ", xhunt)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LHK ", xhunt)
WaitForSend(LogFile, iTimeOut, "", "1^M")

WaitForSend(LogFile, iTimeOut, "LNRS ", xhunt)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "SCI ", "^M")

WaitForSend(LogFile, iTimeOut, "PLEV ", "^M")

WaitForSend(LogFile, iTimeOut, "SPID ", "^M")

WaitForSend(LogFile, iTimeOut, "AST ", "00 01^M")

WaitForSend(LogFile, iTimeOut, "IAPG ", "1^M")

WaitForSend(LogFile, iTimeOut, "ITNA ", "^M")

WaitForSend(LogFile, iTimeOut, "PRI ", "^M")

WaitForSend(LogFile, iTimeOut, "DNDR ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "0 acd ")
WaitForSend(LogFile, iTimeOut, "", xacd)
WaitForSend(LogFile, iTimeOut, "", " 0 ")
WaitForSend(LogFile, iTimeOut, "", xpos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "1 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CPND", "^M")

waitfor "VMB" 3

WaitForSend(LogFile, iTimeOut, "KEY ", "3 trc^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "8 nrd^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "9 msb^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "10 dwc ")
WaitForSend(LogFile, iTimeOut, "", xacd)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "19 NUL^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "20 NUL^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "21 NUL^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "22 NUL^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "23 SSU 0000^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "24 NUL^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "25 NUL^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "26 NUL^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "^M")

return 0
Endfunc


;=================================================
; Program a i2002 type phone
;=================================================

Func Program_i2002 : integer

; string LChar

WaitForSend(LogFile, iTimeOut, "REQ: ", "new^M")

WaitForSend(LogFile, iTimeOut, "TYPE: ", xtype)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TN ", xtn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "DES ", xdes)
WaitForSend(LogFile, iTimeOut, "", "^M")

; strright LChar xtn 2 ; Get right 2 chars from TN
; if not strcmp LChar " 0" ; If not first Unit (Loop Card Shelf Unit)
; WaitForSend(LogFile, iTimeOut, "CTYP ", "XDLC^M")
; endif

WaitForSend(LogFile, iTimeOut, "CUST ", "0^M")

WaitForSend(LogFile, iTimeOut, "ZONE ", xzone)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "FDN ", xfdn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TGAR ", xtgar)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LDN ", "^M")

WaitForSend(LogFile, iTimeOut, "NCOS ", xncos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "RNPG ", "^M")

WaitForSend(LogFile, iTimeOut, "SSU ", "^M")

WaitForSend(LogFile, iTimeOut, "XLST ", "1^M")

WaitForSend(LogFile, iTimeOut, "SGRP ", "^M")

WaitForSend(LogFile, iTimeOut, "CLS ", "fna hta hfa mwa ira nia ola lna cdca cnda dnda mcta tdd^M")

WaitForSend(LogFile, iTimeOut, "RCO ", "^M")

WaitForSend(LogFile, iTimeOut, "HUNT ", xhunt)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LHK ", "1^M")

WaitForSend(LogFile, iTimeOut, "LNRS ", "^M")

WaitForSend(LogFile, iTimeOut, "SCI ", "^M")

WaitForSend(LogFile, iTimeOut, "LPK ", "1^M")

WaitForSend(LogFile, iTimeOut, "PLEV ", "^M")

WaitForSend(LogFile, iTimeOut, "AST ", "^M")

WaitForSend(LogFile, iTimeOut, "IAPG ", "^M")

WaitForSend(LogFile, iTimeOut, "MLWU_LANG ", "^M")

WaitForSend(LogFile, iTimeOut, "DNDR ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "0 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn)
WaitForSend(LogFile, iTimeOut, "", " ")
WaitForSend(LogFile, iTimeOut, "", xclid)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "CPND", "new^M")

WaitForSend(LogFile, iTimeOut, "NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN ", "^M")

WaitForSend(LogFile, iTimeOut, "DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, "VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "1 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn2)
WaitForSend(LogFile, iTimeOut, "", " D^M")

WaitForSend(LogFile, iTimeOut, "CPND", "new^M")

WaitForSend(LogFile, iTimeOut, "NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN ", "^M")

WaitForSend(LogFile, iTimeOut, " DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, " VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "2 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "16 mwk ")
If MWK_testing
WaitForSend(LogFile, iTimeOut, "", MWK_phone)
else
WaitForSend(LogFile, iTimeOut, "", xfdn)
endif

WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "19 cfw 5^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "20 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "21 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "22 nul^M")

; WaitForSend(LogFile, iTimeOut, "KEY ", "23 scc 750^M")
; WaitForSend(LogFile, iTimeOut, "KEY ", "23 scc 755^M")
WaitForSend(LogFile, iTimeOut, "KEY ", "23 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "24 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "25 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "26 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "^M")


return 0
Endfunc


;=================================================
; Program a i2004 type phone
;=================================================

Func Program_i2004 : integer

; string LChar

WaitForSend(LogFile, iTimeOut, "REQ: ", "new^M")

WaitForSend(LogFile, iTimeOut, "TYPE: ", xtype)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TN ", xtn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "DES ", xdes)
WaitForSend(LogFile, iTimeOut, "", "^M")

; strright LChar xtn 2 ; Get right 2 chars from TN
; if not strcmp LChar " 0" ; If not first Unit (Loop Card Shelf Unit)
; WaitForSend(LogFile, iTimeOut, "CTYP ", "XDLC^M")
; endif

WaitForSend(LogFile, iTimeOut, "CUST ", "0^M")

WaitForSend(LogFile, iTimeOut, "ZONE ", xzone)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "FDN ", xfdn)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "TGAR ", xtgar)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LDN ", "^M")
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "NCOS ", xncos)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "RNPG ", "^M")

WaitForSend(LogFile, iTimeOut, "SSU ", "^M")

WaitForSend(LogFile, iTimeOut, "XLST ", "1^M")

WaitForSend(LogFile, iTimeOut, "SGRP ", "^M")

WaitForSend(LogFile, iTimeOut, "CLS ", "fna hta hfa mwa ira nia ola lna cnda cdca mcta dnda tdd^M")

WaitForSend(LogFile, iTimeOut, "RCO ", "^M")

WaitForSend(LogFile, iTimeOut, "HUNT ", xhunt)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "LHK ", "1^M")

WaitForSend(LogFile, iTimeOut, "LNRS ", "^M")

WaitForSend(LogFile, iTimeOut, "SCI ", "^M")

WaitForSend(LogFile, iTimeOut, "LPK ", "1^M")

WaitForSend(LogFile, iTimeOut, "PLEV ", "^M")

WaitForSend(LogFile, iTimeOut, "AST ", "^M")

WaitForSend(LogFile, iTimeOut, "IAPG ", "^M")

WaitForSend(LogFile, iTimeOut, "MLWU_LANG ", "^M")

WaitForSend(LogFile, iTimeOut, "DNDR ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "0 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn)
WaitForSend(LogFile, iTimeOut, "", " ")
WaitForSend(LogFile, iTimeOut, "", xclid)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, " CPND ", "new^M")

WaitForSend(LogFile, iTimeOut, " NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN ", "^M")

WaitForSend(LogFile, iTimeOut, " DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, " VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "1 scr ")
WaitForSend(LogFile, iTimeOut, "", xdn2)
WaitForSend(LogFile, iTimeOut, "", " D^M")

WaitForSend(LogFile, iTimeOut, "CPND", "new^M")

WaitForSend(LogFile, iTimeOut, " NAME ", xname)
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "XPLN ", "^M")


WaitForSend(LogFile, iTimeOut, " DISPLAY_FMT ", "^M")

WaitForSend(LogFile, iTimeOut, " VMB ", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "2 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "3 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "4 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "5 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "6 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "7 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "8 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "9 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "10 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "11 adl 16^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "16 mwk ")
If MWK_testing
WaitForSend(LogFile, iTimeOut, "", MWK_phone)
else
WaitForSend(LogFile, iTimeOut, "", xfdn)
endif
WaitForSend(LogFile, iTimeOut, "", "^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "19 cfw 5^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "20 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "21 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "22 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "23 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "24 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "25 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "26 nul^M")

WaitForSend(LogFile, iTimeOut, "KEY ", "^M")

return 0
Endfunc
 
your right, that one is a little more complex then it needs to be, try this
Code:
proc main
   transmit "****^M"
   waitfor ">"
   transmit "ld 10^M"
   waitfor "REQ: "
   transmit "new^M"
   waitfor "TYPE: "
   transmit "500^M"
   waitfor "CDEN " forever
   transmit "^M"
   waitfor "DES  "
   transmit "new^M"
   waitfor "CUST "
   transmit "0^M"
   waitfor "DIG  "
   transmit "^M"
  
   waitfor "  CPND " forever
   transmit "^M"
   waitfor "  VMB "
   transmit "^M"
   waitfor "AST  "
   transmit "^M^M"
   waitfor "HUNT "
   transmit "^M"
   waitfor "TGAR "
   transmit "^M"
   waitfor "LDN  "
   transmit "^M"
   waitfor "NCOS "
   transmit "^M"
   waitfor "RNPG "
   transmit "^M"
   waitfor "SCPW "
   transmit "^M"
   waitfor "SGRP "
   transmit "^M"
   waitfor "CLS  "
   transmit "^M"
   waitfor "SCI  "
   transmit "^M"
   waitfor "FCAR "
   transmit "^M"
   waitfor "MLWU_LANG "
   transmit "^M"
   waitfor "PLEV "
   transmit "^M"
   waitfor "FTR  "
   transmit "^M"
endproc

that is super basic, just stops and waits for the tn and dn, if you need a lot of phones that are ncos 5

then modify this line by inserting a 5 between "5^
waitfor "NCOS "
transmit "^M" this line can read transmit "5^M' so modify this as you need to, i might need a fwe cls marks, etc. but change it to match your needs...

heres a clean line, on a new line above req: and loop: then at the end, goto loop, that simple script will add 500 sets as fast as you can enter tn and dn... i usually paste those from an excel


john poole
bellsouth business
columbia,sc
 
is it possible to pull the options from a spreadsheet?

Like the Hunt.

If I had all the TNS and DNS in a spreadsheet with all the programming information. how do I set it up to pull the info from that spreadsheet?

John
 
yes i do it all the time, just pull the script up in work, then use word to do a mail merg. that pulls the data from an excel without any problem (no dll link to build) the word tutorial is so, so. but it is the same software you can use to personalize mass mailings, it pulls names and etc from an excel to make the letter seem more hand written. i have used mail merge to compile over a 1000 new sets, all different key layouts, some with mail some without, total time, less then 8 hours... i always tell new techs, learn the free software, saves me more time to forum.

john poole
bellsouth business
columbia,sc
 
Janaya... In addition to John's suggestion of using mailmerge (is what I use), you can also use DDE to pull information directly from an Excel file.

John has some examples how to setup DDE at
 
I use procomm and use the meta keys alot. How do you execute these script files in procomm?
 
two very quick ways, one is with a meta key, another is with a drop down that shows up if you have scripts on your menu bar.. (little running man icon).. there are 5 or 6 other ways.. i have at least 10 meta keys assigned to scripts..

john poole
bellsouth business
columbia,sc
 
I have a script more simple than that, just build your excel spreadsheet, pay attention to the top of the script, it defines the fields in Excel. Then start script, it asks where the file is, i save it to my root directory so it is easy to input, and watch it go. i have had to tweak it on different switches/software but never had a problem. Just change the fields below to what you need, then save as 500 or 3904 or whatever then you just pull that script up the enxt time instead of tweaking each time.

COPY ALL BELOW

;Recorded script. Editing may be required.

;DESC OLDTN NEWTN TYPE ACD POSID DN NAME
;A061 148 0 4 0 172 0 4 0 3905 3500 551514 431514 CSR


proc main

string xdesc, xoldtn, xnewtn, xtype, xacd, xdn, xpos, xname ; variables to be extracted from input string from file.
string FName ; Declaration of File name to be opened.
string LineBuffer ; Declaration of variable LineBuffer for Line to be read from file.
string nloop = "True"
string LChar = "F"
integer nItem = 0, Len = 2 ; nItem - next comma delimited field in LineBuffer
statmsg "Enter the name of the source file that has DESC, OLDTN, NEWTN, TYPE, ACD, POSID, DN, and NAME defined."
sdlginput "Source File for 3905 Sets" "Enter File Name :" FName
if isfile FName ; Make sure file exists.
fopen 0 FName READ ; Open file for read.
while not feof 0
fgets 0 linebuffer
while not feof 0 ; Loop while not end of file.
statclear
statmsg "Processing file input"
strextract xdesc LineBuffer "," nItem ; Extract description from input string
if not nullstr xdesc ; See if we're at the end of list.
nItem++
;usermsg xdesc ; Increment our item pointer.
endif
strextract xoldtn LineBuffer "," nItem ; Extract tn from input string
if not nullstr xoldtn ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xoldtn
endif

strextract xnewtn LineBuffer "," nItem ; Extract tn from input string
if not nullstr xnewtn ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xnewtn
endif

strextract xtype LineBuffer "," nItem ; Extract tn from input string
if not nullstr xtype ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xtype
endif

strextract xacd LineBuffer "," nItem ; Extract acd from input string
if not nullstr xacd ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xacd
endif
strextract xpos LineBuffer "," nItem ; Extract DN from input string
if not nullstr xpos ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xpos
endif

strextract xdn LineBuffer "," nItem ; Extract position ID from input string
if not nullstr xdn ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xdn

endif

strextract xname LineBuffer "," nItem ; Extract position ID from input string
if not nullstr xname ; See if we're at the end of list.
nItem++ ; Increment our item pointer.
;usermsg xname

endif


;3905 code
if strcmp nloop "True"
transmit "ld 20^M"
endif

waitfor "REQ:"
transmit "new^M"

waitfor "TYPE: "
transmit xtype
transmit "^M"

waitfor "TN "
transmit xnewtn
transmit "^M"

waitfor "DES "
transmit xdesc
transmit "^M"

waitfor "CUST "
transmit "0^M"

waitfor "FDN "
transmit "6245^M"

waitfor "TGAR "
transmit "1^M"

waitfor "LDN "
transmit "^M"

waitfor "NCOS "
transmit "1^M"

waitfor "RNPG "
transmit "^M"

waitfor "SSU "
transmit "0001^M"

waitfor "SGRP "
transmit "^M"

waitfor "CLS "
transmit "MCTA LNA IRA OLA TDD CDMA CFXA CNDA DNDA DPUA FNA HFA HTA SFA MWA ^M"

waitfor "RCO "
transmit "^M"

waitfor "HUNT "
transmit "6245^M"

waitfor "LHK "
transmit "0^M"

waitfor "LNRS "
transmit "^M"

waitfor "SCI "
transmit "^M"

waitfor "LPK "
transmit "1^M"

waitfor "PLEV "
transmit "2^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 "0 scr "
transmit xdn
transmit " 0 "
transmit "^M"

waitfor "CPND"
transmit "^M"
waitfor "VMB"
transmit "^M"

waitfor "KEY"
transmit "5 MWK 6245^M"

waitfor "KEY "
transmit "3 ao6^M"

waitfor "KEY"
transmit "4 trn^M"

waitfor "KEY "
transmit "1 TRC^M"

waitfor "KEY "
transmit "2 SSU 0001^M"

waitfor "KEY "
transmit "^M"

nloop = "False"
NItem = 0

fgets 0 linebuffer

endwhile
endwhile

waitfor "REQ:"
transmit "****^M"
fclose 0 ; Close file opened for read.
statclear

else
errormsg "Couldn't open file `"%s`"." FName
statclear
endif


endproc
 
How come everytime I look at this POST I get a warning popup that says that a script is trying to run.?????????????
 
I do Have a script to install analoge phones. Can mail it to you if u need it.

Riaan
 
can't mail it, post it here, exchange of email addresses is not allowed.

john poole
bellsouth business
columbia,sc
 
ok c
;Create Analog Telephone Set

proc Main
String FileSpec
String FileName

FileSpec = "C:\*.prn"
dir "c:\Script Files\*.prn" FileName
if SUCCESS
call NewPhones with FileName
endif
endproc



proc NewPhones
param String FName

string LineBuffer ;Stores read in line
string DN , TN , SURNAME , NCS , SAR ,HNT ,SPW , SCL
;, NAME PGRP ,FWD ,

if fopen 0 Fname read ;Open Selected File for Reading
while not feof 0 ;Loop while not end of file.
fgets 0 LineBuffer ;Get line from file.
substr DN LineBuffer 0 4 ;Substatute string info
substr TN LineBuffer 8 11
;substr NAME LineBuffer 09 212
substr SURNAME LineBuffer 27 20
substr NCS LineBuffer 51 1
substr SAR LineBuffer 59 1
substr SPW LineBuffer 67 4
substr HNT LineBuffer 75 4
;substr PGRP LineBuffer 64 3
;substr FWD LineBuffer 74 4
substr SCL LineBuffer 83 1


transmit "ld 10^M"
waitfor "REQ: "
mspause 500
transmit "new^M"
waitfor "TYPE: "
transmit "500^M"
waitfor "TN"
transmit TN
transmit "^M"
waitfor "CDEN "
transmit "^M"
waitfor "DES "
transmit "500^M"
waitfor "CUST "
transmit "0^M"
waitfor "WRLS "
transmit "^M"
; waitfor "DIG "
; transmit "^M"
waitfor "DN"
transmit DN
transmit "^M"
waitfor "CPND "
transmit "new^M"
waitfor "CPND_LANG "
transmit "^M"
waitfor "NAME"
; transmit NAME
; transmit " ^M"
transmit SURNAME
transmit "^M"
; waitfor "XPLN"
; transmit "^M"
waitfor "DISPLAY_FMT"
transmit "^M"
waitfor "VMB"
transmit "^M"
waitfor "AST"
transmit "^M"
waitfor "IAPG"
transmit "^M"
waitfor "HUNT"
transmit HNT
transmit "^M"
waitfor "TGAR"
transmit "0^M"
waitfor "LDN"
transmit "^M"
waitfor "NCOS"
transmit NCS
transmit "^M"
waitfor "RNPG"
; transmit PGRP
transmit "^M"
waitfor "SCPW"
transmit SPW
transmit "^M"
waitfor "SGRP"
transmit SAR
transmit "^M"
waitfor "SFLT"
transmit "^M"
waitfor "CAC"
transmit "^M"
waitfor "CLS"
transmit "TLD DTN XFA FNA WTA XRA CWA MWA LPA XHA CCSA LNA CFTA C6A CDMA CFXA ARHA CLTA HBTA DDGA NAMA CFHA USRA^M"
waitfor "RCO"
transmit "^M"
waitfor "LNRS"
transmit "^M"
waitfor "FCAR"
transmit "yes^M"
;waitfor "SCI "
;transmit "^M"
;waitfor "MLWU_LANG "
;transmit "^M"
waitfor "PLEV "
transmit "^M"
waitfor "FTR "
transmit "CFW 4^M"
; waitfor "FTR "
; transmit "FDN "
; transmit FWD
; transmit "^M"
waitfor "FTR "
transmit "SSU "
transmit SCL
transmit "^M"
waitfor "FTR "
transmit "^M"

endwhile
fclose 0 ; Close file opened for read.
else
errormsg "Couldn't open file `"%s`"." Fname

endif
waitfor "REQ: "
transmit "end^M"

endproc
 
What extension would .prn be. Is that just a text file?
 
looks like a temp file for a dll link between gather text and insert txt, but i don't see the deletion of the txt file. but think about it, an analog set, new enter the dn the tn cust and des, default the rest and it works touch tone, and hunt xxxx cls hta fna mwa lpa (for a lamp) and ftr fdn xxxx, and that analog has voice mail. i don't use a script that takes longer then the original entry.. that is a clean script, but like otm, lots of overhead to help with a non issue

john poole
bellsouth business
columbia,sc
 
I like using the script to build phones, only because I know 100% it is built the same way everytime. how many times have you had to troubleshoot a phone and it was a finger flub that caused a problem, witht he script that is eliminated, which is very helpful in a large call center environment where all the phones have to work the same way.
 
I'm just going to use the mail merge. it works fine for what I need.

when I ran your script, johnthephoneguy, it would hang at type and not go any further. Have you tried this recently or am I doing something wrong?......i know i know, i am doing something wrong.

John
 
It's not that you are doing anything wrong, you just have to set it up for your PBX, each PBX I have used it on needed some tweaking, it was originally built for 25.40 but works on any. When it stops you will see it is waiting for something, look at where it is stopped and edit the script to flow. IF that doesnt make sense let me know, once tweaked for your switch, you won't build phones any other way, its sometimes fun just to watch it go.
 
that hang up in this thread is caused by scripts being posted with out the code brackets, the script is trying to execute... read the tcml notes and post scripts per that arrangement, then they will not lock up peoples screen

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

Part and Inventory Search

Sponsor

Back
Top