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