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

Procomm 1

Status
Not open for further replies.

terrysdavid

Programmer
Jun 6, 2006
350
TT
Hi guys. I'm new to procomm. I'm looking for two scripts.

One that will allow me to take information like phone type, TN, DN from an excel file an program about 400 phones.

And the other that will allow me to make a change like the cls from HTD to HTA on all the phones on the system.

Any assistance will greatly be appreciated.
 
This script builds sets, you will have to tweak it for your PBX. If you read the top of the script it defines the fields for your Excel spreadsheet that it will pull from.


;Recorded script. Editing may be required.

;DESC OLDTN NEWTN TYPE ACD POSID DN NAME
;3905 4 0 13 2 4 0 13 2 3905 3700 554001 514011
;3905 4 0 12 15 4 0 12 15 554002 514002
;3905 4 0 13 15 4 0 13 15 554131 514131



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"


strright LChar xnewtn Len

if not strcmp LChar " 0"
waitfor "CTYP "
transmit "XDLC^M"
endif

waitfor "CUST "
transmit "0^M"

waitfor "KBA "
transmit "^M"

waitfor "DBA "
transmit "^M"

waitfor "FDN "
transmit "^M"

waitfor "TGAR "
transmit "1^M"

waitfor "LDN "
transmit "^M"

waitfor "NCOS "
transmit "3^M"

waitfor "RNPG "
transmit "^M"

waitfor "SSU "
transmit "0000^M"

waitfor "SGRP "
transmit "^M"

waitfor "CLS "
transmit "AGN HTD TDD LNA CNDA MCTA DNDA ICDA ^M"

waitfor "HUNT "
transmit "000^M"

waitfor "LHK "
transmit "1^M"

waitfor "LNRS "
transmit "^M"

waitfor "SCI "
transmit "^M"

waitfor "PLEV "
transmit "2^M"

waitfor "SPID "
transmit "^M"

waitfor "AST "
transmit "00 01^M"

waitfor "IAPG "
transmit "1^M"

waitfor "ITNA "
transmit "^M"

waitfor "PRI "
transmit "^M"

waitfor "MLNG "
transmit "^M"

waitfor "DNDR "
transmit "^M"

waitfor "KEY "
transmit "0 acd "
transmit xacd
transmit " 0 "
transmit xpos
transmit "^M"

waitfor "KEY "
transmit "1 scr "
transmit xdn
transmit " 0^M"
waitfor "CPND"
transmit "^M"
waitfor "VMB"
transmit "^M"

waitfor "KEY "
transmit "2 trc^M"

waitfor "KEY "
transmit "8 msb^M"

waitfor "KEY "
transmit "9 nrd^M"

waitfor "KEY "
transmit "10 dwc "
transmit xacd
transmit "^M"

waitfor "KEY "
transmit "11 acnt^M"

waitfor "KEY"
transmit "12 nul^M"

waitfor "KEY"
transmit "13 nul^M"

waitfor "KEY"
transmit "14 nul^M"

waitfor "KEY "
transmit "19 NUL^M"

waitfor "KEY"
transmit "16 nul^M"

waitfor "KEY "
transmit "20 NUL^M"

waitfor "KEY "
transmit "21 NUL^M"

waitfor "KEY "
transmit "22 NUL^M"

waitfor "KEY "
transmit "23 SSU 0000^M"

waitfor "KEY "
transmit "24 NUL^M"

waitfor "KEY "
transmit "25 NUL^M"

waitfor "KEY "
transmit "26 NUL^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

JohnThePhoneGuy

"If I can't fix it, it's not broke!
 
here's one that is a little more on the simple size... built for the 3904 but i've used it for a template for 2616's as well..

Code:
proc main

   string sline, tn,key0,cpnd,key1,key2

   fopen 0 "3904.txt" READ         ;Open our data file
   while not feof 0                ;While the file still has data
      fgets 0 sLine                ;Read a line of data
      strtok tn sLine "`t" 1       ;Get the first field
      strtok key0 sLine "`t" 1     ;Get the second field
      strtok cpnd sLine "`t" 1     ;Get the third field
      strtok key1 sLine "`t" 1     ;Get the fourth field
      strtok key2 sLine "`t" 1     ;Get the fifth field
     ; strtok sTemp3 sLine "`t" 1  ;Get the sixth field
  
  set txpace 30
  waitfor "req:"
   transmit "new^M"
  waitfor "type"
   transmit "3904^M" 
  waitfor "tn  "
   transmit tn
   transmit "^M"
  waitfor "des"
   transmit "xxxx^M"
  waitfor "CUST"
   transmit "0^M"
  waitfor "KBA"
   transmit "^M"
  waitfor "dba"
   transmit "^M"
 waitfor "fdn"
   transmit "xxxxx^M"
 waitfor "tgar"
   transmit "^M"
 waitfor "ldn"
   transmit "^M"
 waitfor "ncos"
   transmit "5^M"
 waitfor "rnpg"
   transmit "^M"
 waitfor "ssu"
   transmit "^M"
 waitfor "xlst"
   transmit "^M"
 waitfor "sgrp"
   transmit "^M"
 waitfor "cls"
   transmit "LNA FNA HTA HFA MWA CNDA DNDA CFXA FTTU AHA^M"
 waitfor "rco"
   transmit "^M"
 waitfor "hunt"
   transmit "xxxxx^M"
 waitfor "lhk"
   transmit "0^M"
 waitfor "lnrs"
   transmit "^M"
 waitfor "sci"
   transmit "^M"
 waitfor "plev"
   transmit "^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 key0
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "new^M"
 waitfor "name  "
   transmit cpnd
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key  "
   transmit key1
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key  "
   transmit key2
   transmit "^M"
 waitfor "marp"
   transmit "^M"
 waitfor "cpnd"
   transmit "^M"
 waitfor "vmb"
   transmit "^M"
 waitfor "key"
   transmit "3 adl^M"
 waitfor "key"
   transmit "4 adl^M"
 waitfor "key"
   transmit "5 adl^M"
 waitfor "key"
   transmit "6 csd^M"
 waitfor "key"
   transmit "7 adl^M"
 waitfor "key"
   transmit "8 adl^M"
 waitfor "key"
   transmit "9 adl^M"
 waitfor "key"
   transmit "10 adl^M"
 waitfor "key"
   transmit "11 adl^M"
 waitfor "key"
   transmit "16 mwk xxxxx^M"
 waitfor "key"
   transmit "24 nul^M"
 waitfor "key"
   transmit "25 nul^M"
 waitfor "key"
   transmit "26 nul^M"
   
  
   endwhile
   
   fclose 0

   
endproc

a tab delimited with the 5 variables named tnb.txt is used on almost all my tnb files... so i can prt a list idu a list or in this case new... here;s a simple one that does just a print tnb of a list of tn's
Code:
Proc main

  
   
   
  
	string tn
   
   integer count
   string szline
   fopen 0 "tnb.wud" read

   while not feof 0
   SZLINE = "2"
   fgets 0 szline

    strtok tn szline "t"  1  
  			
   set txpace 70
  
   transmit "prt^M"
   waitfor "TYPE: "
   transmit "tnb^M"
   
  
    transmit tn
    mspause 10
    transmit "^M"
     waitfor "DATE "
   transmit "^M"
   waitfor "PAGE "
   transmit "^M"
   waitfor "DES  "
   transmit "^M"
   mspause 6
 
   transmit "^M"
  waitfor "NACT "
  transmit "^M"
   waitfor "REQ: " forever
  
   

 
   
   
  
    count += 2
   endwhile
   fclose 0
   fclose 1
   call main
   
   endproc

most of my scripts are tech style.. no frills, just a little faster for me to play... i get a lot of add mail, so i have a metakey to vm to any set.. i use the metakey alt2 as paste.. so to print a tn/dn i type in the dn, capture the tnb to my windows buffer and hit enter... doesn't save that much time but when you have techs in the field waiting for details.. it helps (and i'm lazy)
Code:
proc main
   uwincreate FULL SCREEN 00 00 240 0  BITMAP ;
   uwinpaint               ; Paint the user window.
   pause 1                 ; Show off user window.
   uwincreate FULL SCREEN 0 255 0 0 BITMAP
   uwinpaint               ; Paint the user window.
   pause 1                 ; Show off user window.
  uwinremove
  
    ; Destroy the user window.
    set txpace 50
   transmit "****^M"
   waitfor ">"
   transmit "LD 20^M"
   waitfor "REQ: "
   transmit "PRT^M"
   waitfor "TYPE: "
   transmit "DNB^M"
   waitfor "CUST "
   transmit "^M"   
   waitfor "DATE "  forever
   transmit "^M"
   waitfor "PAGE "
   transmit "^M"
   waitfor "DES "
   transmit "^M"
   waitfor "NACT "
   transmit "^M"  
   
   waitfor "TYPE: " forever
   transmit "TNB^M"
   waitfor "TN "
   metakey alt 2  
   waitfor "DATE "
   transmit "^M"
   waitfor "PAGE "
   transmit "^M"
   waitfor "DES  "
   transmit "^M"
endproc


remember go to alt m, make metakey alt 2 paste txt for that one to work.. but the up side is now after i prt the tn/dn. i can use stat alt 2 chg 2616 alt 2 etc.. after the copy, i may use the tnb several times

john poole
bellsouth business
columbia,sc
 
John,

I use your DNB script everyday. Its funny how sometimes the simplest scripts are the best ones. My 2nd meta key on my ProComm is still the function "paste" because it's so darn useful all day long but in scripting I have found the command "metakey alt 2" can be replaced with "pastetext" and it works the same.

The "pastetext" will work without the meta key being setup at all. So if I e-mail the script to someone it will work without the dependency of the person getting his meta key setup right. For some reason they always skipped the meta key setup and would call me to say it's not working.


 
that helps, i can stop telling people how to use meta keys. and your right, we have 3 pc's on line at all times and without alt 2 things would slow down

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

Part and Inventory Search

Sponsor

Back
Top