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!

question to johnpoole... 2

Status
Not open for further replies.

I2007

Programmer
Dec 13, 2004
506
0
0
NO
I've realized that you sit on tons of procomm scripts to do almost everything. What scripts are you willing to share with the rest of us? I've done some scripting my self, but everything disappeared when I got a HD crash resently, and much of it I don't want to reprogram because of it's complexity and time spent on programming.

hopefull rgds,
i2007
 
[rofl]
I try & answer when I can too ..... tho time zones & work sometimes get in the way :)

<Do I need A Signature or will an X do?>
 
Here's a couple of quickie's that I wrote that help printing phones:

This one will prompt you for a DN and then print it out:

-----------------------------------------------------------
;Print DN

proc main

string DN_input
sdlginput "Extension" "What is the Extension:" DN_Input

strcat DN_input "^M"

transmit "******^M"
transmit "LD 20^M"
waitfor "REQ:"
transmit "prt^M"
waitfor "TYPE: "
transmit "DN^M"
waitfor "CUST "
transmit "0^M"
waitfor "DN "
transmit DN_Input
waitfor "DATE "
transmit "^M"
waitfor "PAGE "
transmit "^M"
waitfor "DES "
transmit "^M"
waitfor "NACT "
transmit "^M"
------------------------------------------------------------



This one will prompt you for a TN, then print it out:


;Very Simple script that will print a TN for you.


proc main

string TN_Input

sdlginput "TN" "What is the TN:" TN_Input
strcat TN_Input "^M"


transmit "******^M"
transmit "ld 20^M"
waitfor "REQ: "
transmit "prt^M"
waitfor "TYPE: "
transmit "tn^M"
waitfor "TN "
transmit TN_Input
waitfor "DATE "
transmit "^M"
waitfor "PAGE "
transmit "^M"
waitfor "DES "
transmit "^M"


;pause 5


endproc


 
This one will build a phone based upon the prompts answered. It will out anything on the existing TN then build the new phone. Keep in mind this is created with parameters needed for our PBX, so it would need to be tweaked for yours.

I've also got other scripts that read info from a text file (like cmawbey's) to do moves. We've done moves of between 400 - 500 agents without issue.


;*******************************
;** DECLARE VARIABLES **
;*******************************


string Phone_Type
string New_TN
string DES_entry
string NCOS_entry
string DN_Primary
string DN_Secondary
integer answer



proc main

;*******************************
;** GET PHONE INFO **
;*******************************

StartEverything:


sdlginput "New_TN" "What is the TN:" New_TN
sdlginput "DES" "What is the DES:" DES_entry
sdlginput "NCOS" "What is the NCOS:" NCOS_entry
sdlginput "Primary DN" "What is the Primary Extension:" DN_Primary
sdlginput "Secondary DN" "What is the Secondary Extension:" DN_Secondary




Phone_Type = "2616"
strcat Phone_Type "^M"
strcat New_TN "^M"
strcat DES_Entry "^M"
strcat NCOS_Entry "^M"
strcat DN_Primary "^M"
strcat DN_Secondary "^M"

;*******************************
;** OUT ANY EXISTING PHONE **
;*******************************

transmit "****"
transmit "^M"
transmit "LD 20^M"
waitfor "REQ:"
transmit "disu "
transmit New_TN
when TARGET 1 "OVL429 - OVERLAY CONFLICT." call overlay_conflict
waitfor "REQ:"
transmit "out^M"
waitfor "TYPE: "
transmit Phone_Type
waitfor "TN "
transmit New_TN
when TARGET 0 "SCH0128" call enter_stars



;*******************************
;** BUILD THE PHONE **
;*******************************


;waitfor "REQ :"
transmit "new^M"
waitfor "TYPE: "
transmit Phone_Type
waitfor "TN "
transmit New_TN
waitfor "DES "
transmit DES_Entry
;waitfor "CTYP "
;transmit "^M"
waitfor "CUST "
transmit "0^M"
waitfor "AOM "
transmit "^M"
waitfor "FDN "
transmit "3123^M"
waitfor "TGAR "
transmit "1^M"
waitfor "LDN "
transmit "^M"
waitfor "NCOS "
transmit NCOS_entry
waitfor "RNPG "
transmit "^M"
waitfor "SSU "
transmit "^M"
waitfor "SGRP "
transmit "^M"
waitfor "CLS "
transmit "hta fna ira ola cnda fita lna mwa tdd^M"
;transmit "^M"
waitfor "RCO "
transmit "^M"
waitfor "HUNT "
transmit "3123^M"
waitfor "LHK "
transmit "1^M"
waitfor "LNRS "
transmit "^M"
waitfor "SCI "
transmit "^M"
waitfor "LPK "
transmit "0^M"
waitfor "PLEV "
transmit "^M"
;waitfor "SPID "
;transmit "^M"
waitfor "AST "
transmit "^M"
waitfor "IAPG "
transmit "^M"
waitfor "MLWU_LANG "
transmit "^M"
waitfor "DNDR "
transmit "^M"
waitfor "KEY "
transmit "0 scr "
transmit DN_Primary
waitfor " CPND "
transmit "^M"
waitfor " VMB "
transmit "^M"
waitfor "KEY "
transmit "1 scr "
transmit DN_Secondary
waitfor " CPND "
transmit "^M"
waitfor " VMB "
transmit "^M"
waitfor "KEY "
;transmit "3 nrd^M"
;waitfor "KEY "
transmit "4 msb^M"
waitfor "KEY "
transmit "5 dsp^M"
waitfor "KEY "
transmit "8 ao6^M"
waitfor "KEY "
transmit "9 trn^M"
waitfor "KEY "
transmit "10 cfw 4^M"
;waitfor "KEY "
;transmit "11 asp^M"
waitfor "KEY "
transmit "14 mwk 3123^M"
waitfor "KEY "
transmit "^M"

;*******************************
;** ASK FOR ANOTHER **
;*******************************

answer = 0
sdlgmsgbox "Another" "Do you want to do another" QUESTION OKCANCEL answer

if answer == 1
goto StartEverything
else
goto EndScript
endif

EndScript:


ENDPROC



proc enter_stars
waitfor "TN "
transmit "***^M"
endproc

proc overlay_conflict
usermsg "Sorry, there's an overlay conflict"
exit
endproc
 
And here's one that moves phones based upon a spreadsheet saved as a .csv. Bascially, it first reads the file line by line and outs all the "old" locations. It then reads through the same file again and builds phones on the "new" locations. Every time it builds a "new" phone it outs what's on that TN. It also handles MARP issues...

---------------------------------------------------------------------


proc main
string Fname ; String to contain file name.
string FileSpec ; String to contain file spec.
;string Attr ; String to contain attributes.
string linebuffer
string lineinfo
string lineparse
string Desi
string Ext1
string Ext2
string TN
string Phone_Type
integer counter
string TN_Old
string MCR
integer MCR_yes
integer added_mcr
integer count_all

;******************************************************************************
;****** CHANGED ON 6/16/04 TO REFLECT THE FOLLOWING SPREADSHEET CONFIG: *******
; DESI = 1
; OLD TN = 2
; NEW TN = 3
; DN1 = 4
; DN2 = 5
; MCR = 6
;******************************************************************************






;***********************************
;****** Open file from drive *******
;***********************************

FileSpec = "c:\*.*" ; Set spec to all files in "c:\".
dir FileSpec Fname ; Display dir and get file name.
if SUCCESS ; See if a file was chosen.
; Get and display attributes for chosen file.
;fileget Fname ATTRIBUTE Attr
;usermsg "Attributes for `"%s`" are `"%s`"." Fname Attr

endif

;************************************
;***** Read each line from file *****
;************************************

transmit "****"
transmit "^M"
transmit "LD 20^M"

if fopen 0 Fname READ TEXT ; Open file for read only.

while not feof 0 ; Loop while not end of file.
fgets 0 LineBuffer
lineinfo = LineBuffer


;******************************************
;****** Get Old TN info and out phone *****
;******************************************

strtok lineparse lineinfo "," 2
TN_Old = lineparse
strcat TN_Old "^M"


waitfor "REQ:"
transmit "disu "
transmit TN_Old
when TARGET 1 "OVL429 - OVERLAY CONFLICT." call overlay_conflict
waitfor "REQ:"
transmit "out^M"
waitfor "TYPE: "
transmit "2616^M"
waitfor "TN "
mspause 500
transmit TN_Old
when TARGET 0 "SCH0128" call enter_stars




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




if fopen 0 Fname READ TEXT ; Open file for read only.
while not feof 0 ; Loop while not end of file.
fgets 0 LineBuffer ; Get line from file.
;usermsg LineBuffer ; Display
lineinfo = LineBuffer
counter = 1


;***********************************
;***** Get each item in line *****
;***********************************



while 1 ; Loop forever, or until EXITWHILE.

strtok lineparse lineinfo "," 1 ; Get first item from data list.
if nullstr lineparse ; Check to see if item is null.
exitwhile ; If so, exit loop.
endif

switch counter
case 1
desi = lineparse
endcase

case 3
TN = lineparse
endcase

;REMOVED NCOS
;case 2
;Ncos = lineparse
;endcase

case 4
Ext1 = lineparse
endcase

case 5
Ext2 = lineparse
endcase

;REMOVED HFA
;case 5
;HFA = lineparse
;endcase

case 6
mcr = lineparse
endcase

endswitch

counter = counter + 1

;usermsg "Data item is `"%s`"." lineparse
endwhile

;*****************************
;***** Add ^M to each var ****
;*****************************

Phone_Type = "2616"
strcat Phone_Type "^M"
strcat TN "^M"
strcat desi "^M"
;strcat Ncos "^M"
;strcat Queue "^M"
;strcat acd "^M"
strcat Ext1 "^M"
strcat Ext2 "^M"

if strcmp mcr "3311"
mcr_yes = 1
else
mcr_yes = 0
endif

;*******************************
;** OUT ANY EXISTING PHONE **
;*******************************



transmit "^M"
transmit "*^M"
waitfor "REQ:"
transmit "disu "
transmit TN
waitfor "REQ:"
transmit "out^M"
waitfor "TYPE: "
transmit Phone_Type
waitfor "TN "
transmit TN
when TARGET 0 "SCH0128" call enter_stars




;*******************************
;** BUILD THE PHONE **
;*******************************


waitfor "REQ:"
transmit "new^M"
waitfor "TYPE: "
transmit Phone_Type
waitfor "TN "
transmit TN
waitfor "DES "
transmit desi
;waitfor "CTYP "
;transmit "^M"
waitfor "CUST "
transmit "0^M"
waitfor "AOM "
transmit "^M"
waitfor "FDN "
transmit "3123^M"
waitfor "TGAR "
transmit "1^M"
waitfor "LDN "
transmit "^M"
waitfor "NCOS "
transmit "4^M"
waitfor "RNPG "
transmit "^M"
waitfor "SSU "
transmit "^M"
waitfor "SGRP "
transmit "^M"
waitfor "CLS "
;transmit HFA
transmit " hta fna ira ola cnda fita lna mwa tdd ^M"
;transmit "^M"
waitfor "RCO "
transmit "^M"
waitfor "HUNT "
transmit "3123^M"
waitfor "LHK "
transmit "1^M"
waitfor "LNRS "
transmit "^M"
waitfor "SCI "
transmit "^M"
waitfor "LPK "
transmit "0^M"
waitfor "PLEV "
transmit "^M"
;waitfor "SPID "
;transmit "^M"
waitfor "AST "
transmit "^M"
waitfor "IAPG "
transmit "^M"
;waitfor "PRI "
;transmit "^M"
waitfor "MLWU_LANG " ;added 8/31/04 due to succession 3.0
transmit "^M"
waitfor "DNDR "
transmit "^M"

waitfor "KEY "
transmit "0 scr "
transmit Ext1
when TARGET 0 "MARP ON " call marp_entry

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

transmit "1 scr "
transmit Ext2
when TARGET 0 "MARP ON " call marp_entry

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





waitfor "KEY "
transmit "4 msb^M"
waitfor "KEY "
transmit "5 dsp^M"
waitfor "KEY "
transmit "8 ao6^M"
waitfor "KEY "
transmit "9 trn^M"
waitfor "KEY "
transmit "10 cfw 4^M"

;**************************
;** PUT IN MCR IF NEEDED **
if mcr_yes == 1
waitfor "KEY "
transmit "12 MCR 3311^M"
waitfor " CPND "
transmit "^M"
waitfor " VMB "
transmit "^M"
added_mcr = 1
endif
;**************************



waitfor "KEY "
transmit "14 mwk 3123^M"
waitfor "KEY "
transmit "^M"

Pause 2
count_all = count_all + 1



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

endif

if added_mcr == 1
transmit "chg^M"
waitfor "TYPE: "
transmit "500^M"
waitfor "TN "
transmit "36 0 12 2^M"
waitfor "ECHG "
transmit "yes^M"
waitfor "ITEM "
transmit "dn 3311^M"
waitfor " MARP "
transmit "yes^M"
waitfor " CPND "
transmit "^M"
waitfor " VMB "
transmit "^M"
waitfor "ITEM "
transmit "^M"
endif


usermsg "Jeez Louise, I just moved %d phones!!" count_all





endproc


proc enter_stars
waitfor "TN "
mspause 500
transmit "***^M"

endproc


proc overlay_conflict
usermsg "Sorry, there's an overlay conflict"
exit
endproc

proc marp_entry
waitfor "MARP "
transmit "^M"
endproc
 
those are some great scripts for anyone that doesn't do commands, very clean. i still use mov and cpy for almost the same thing. looks like your using a major upgrade on otm, like i said, the scripts i use are way simpler, and they save me time over a command line. yours are great they do the command line. i should give these to the help desk so they could program phones..not

john poole
bellsouth business
columbia,sc
 
We generally never use the move or copy command - most of our phones are ACD sets (I didn't post that script, it's fairly complex because it handles many different scenarios), so we are always in the practice of outing and rebuilding.

 
your right, i'll add a dacr and disu command and use that for my acd moves..it will save time. i use mov and cpy, 20 times a day in an 81 with 7000 sets and have had zero problems. i do disu sets before the move

john poole
bellsouth business
columbia,sc
 
yes, I do have another script that will deaquire sets. We use this when we do large moves to make sure we have deacquired everything (since it's tedious to do in Symposium, granted they still need to be done there, this is just to make sure we don't miss any). If not, my acd move script will fail - only because I haven't written in a subroutine to handle when it tries to out an acquired phone...

Here's that deacquire script...

String TN_New
string lineparse
string LineBuffer
string lineinfo
string fname
string FileSpec


proc main

FileSpec = "c:\*.*" ; Set spec to all files in "c:\".
dir FileSpec Fname ; Display dir and get file name.
if SUCCESS ; See if a file was chosen.
; Get and display attributes for chosen file.
;fileget Fname ATTRIBUTE Attr
;usermsg "Attributes for `"%s`" are `"%s`"." Fname Attr

endif


transmit "****"
transmit "^M^M"
pause 2
transmit "LD 48^M"
pause 1


if fopen 0 Fname READ TEXT ; Open file for read only.

while not feof 0 ; Loop while not end of file.
fgets 0 LineBuffer
lineinfo = LineBuffer


;******************************************
;****** Get TN info and DACR phone *****
;******************************************

strtok lineparse lineinfo "," 8
TN_New = lineparse
strcat TN_New "^M"
transmit "^m"
waitfor "."
transmit "DACR AGT "
transmit TN_New
pause 2



endwhile



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


endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top