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

dn to tn conversion

Status
Not open for further replies.

TAnselm

Vendor
Mar 10, 2006
791
US
Does anyone have a ProComm script to print out the TN of a phone from the DN?

Had a problem and I need to check the settings on a whole bunch of phones. Didn't want to print dn, look for tn, prt tn, go back print dn, so on and so forth.
 
Why don’t you print all TN’s in the switch and capture to file.

I just printed all the TN’s in my switch for my records and at took me about 30 min to capture the file. If you can use PTY port that would be a lot faster then TTY.
 
You need to be a bit more specific on the type of system and the software in use if you want a procom script provided. You can just log into the system, go to load 20, and at REQ:pRT
Type:TNB
TN:(enter the TN or just hit return for all)

There is a GrEaT program called MV that will parse the information into Excel if that is something you need.

~N
 
I have a 4 network option 81c. Kind of over the top to print out all the TNs when I need to check the settings on 20 - 30 phones at a time.

What I wanted to do is, having a list of possible affected DN's, I simply wanted to be able to enter the DN and have the switch to a print on the TN for that DN.

I knew it was a long shot going in and I do have a complete DNB that I download and used with the spreadsheet from pepedog. I just wanted to try to save myself some time of having to look up all those TNs.

You know how it is when you have a list of DNs
print the dn
find the tn
print the tn
verify the information
print the dn
find the tn...

I want to skip a few steps which amounts to a fair amount of time save when you multiply by numerous DNs you have to look up.
 
TAnselm,
G'day..
I've a script that will easily adapt to do this.

Are you just after the TN of the MARP?


Or do you require the script to do a full PRT of the TN?
If you want a full PRT of the TN, I'd have these Few Q's before I run it through the mangle...

1. How many digit DN's? 3 / 4
2. Would it be ok to enter all DN's in one go..
i.e. comma seperated format - 1111,1112,1113,1114
Or prefer 1 DN / script run?
3. Would you only want TN info for the MARP?
If all TN info for DN req'...
Would TN Info for KEY appearances of that DN be a prob if included also?
5. TN info transferred into NOTEPAD ok?


 
you could just print a dnb of the first 2 or 3 digit only, this way it will come back with fewer result.

if all your xtn are 53xx then print dnb 53...
 
If you use the parsing program as Nortech1 suggested. you could prt the TNB and have it in a Spread sheet and then just do a sort on the DN's and there yoou have it, real quick.
 
Gday, TAnselm.
Re:- Had a problem and I need to check the settings on a whole bunch of phones. Didn't want to print dn, look for tn, prt tn, go back print dn, so on and so forth.

I think this'll do what you want.

This script will go to LD20, ask for user input in the form of 1 DN or many... e.g.
1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,etc..
Then it PRTs - DNB for each DN saves to capture file.
Capture file is filtered, results displayed as CUST,DN,TN,TYPE in a csv file for the MARP TNs only.

Code:
proc main
   when USEREXIT call term  
   ;LOGOUT OF ANY LD's
   transmit "****^M"
   pause 1	
   call EnableIt	
   call term  
endproc  

proc EnableIt
     integer nItem = 0
     integer Len
     integer Model = 0
     string DirNums, CurDirN, EnterStr
     string FName            ; Name of capture file to open.
     string LineInfo         ; Line from file.
     string FNamebb = "C:\Program Files\Symantec\Procomm Plus\Capture\TN_Info.csv"
     string TmpStrAA, TmpStrBB, TmpStrCC, TmpStrDD, Info_Str	    
     Fname = "screen.txt"   ; Name of capture file to open.
     EnterStr = "^M"
     when USEREXIT call term  ;if user selects exit, call term then exit
     ;Run LD20
     transmit "LD 20^M"
     waitfor "REQ:" 
     sdlginput "Automatically Check and Re-Enable Selected DN's" "Enter 4 digit DN's seperated by a comma." DirNums
     ;open TN_Info file for data
     fopen 3 FNamebb CREATE TEXT
     fputs 3 "CUST,DN,TN,TYPE"
     while 1  ; Loop forever, or until EXITWHILE.
     strextract CurDirN DirNums "," nItem
     if not nullstr CurDirN  ; See if we're at the end of list.
         ;This part of the script is where the DN's are resolved as TN's.
         transmit "prt^M"
         waitfor "TYPE:"
         transmit "dnb^M"
         waitfor "CUST"
         transmit "0^M"
         waitfor "DN"
         strlen CurDirN Len   ; Check length of text string.
         if Len == 4 ; if Len is correct perform action         
         	strcat CurDirN EnterStr
         	mspause 100
         	transmit CurDirN
	 	waitfor "DATE"
	 	transmit EnterStr
	 	waitfor "PAGE"
	 	transmit EnterStr
	 	waitfor "DES"
  	 	transmit EnterStr
	 	waitfor "NACT"
   	 	;capture screen display to file
	 	set capture file FName    ; Set name of capture file.
	 	set capture overwrite ON
   		capture on                 ; Open up the capture file.
	 	transmit EnterStr
	 	waitfor "REQ:" 
	 	capture off                ; Close the capture file.
		;playback from capture file
		FName = "C:\Program Files\Symantec\Procomm Plus\Capture\Screen.txt"
		if isfile FName              ; Make sure file exists.
 	       	   if fopen 0 FName READ     ; Open file for read.
        	     while not feof 0       ; Loop to end of file.
        	       fgets 0 LineInfo    ; Get line from file.
        	       		if rstrcmp LineInfo "CUST" 4 ;1st 4 chars are 'CUST'
					substr TmpStrAA LineInfo 5 2 ; get CUST Info
        	       		endif
	      	       		if rstrcmp LineInfo "DN  " 4 ;1st 4 chars are 'DN  '
					substr TmpStrBB LineInfo 5 4 ; get DN Info
        	       		endif
        	      		if rstrcmp LineInfo "TN  " 4 ;1st 4 chars are 'TN  '
        	       			;so check for MARP
        	       			if strfind LineInfo "MARP"
        	       				;it is the MARP
        	       				substr TmpStrCC LineInfo 5 11 ; get TN Info
        	       				Model = 1 ;turn on search for Model
        	       			endif
					
        	       		endif	
        	       		if Model == 1
        	       		;search for Model No
        	       			if rstrcmp LineInfo "     (" 5 ;1st 5 chars are 'xxxxx('
        	       				substr TmpStrDD LineInfo 6 4 ; get Model Info
        	       			;reset model 
        	       			Model = 0	
        	       			endif
        	       		   		
        	       		endif 
        	       		if rstrcmp LineInfo "NACT" 4 ;1st 4 chars are 'NACT'
        	       		;clean up strings
        	       		strreplace TmpStrAA "`n" "" ;strip new line string
        	     	   	strreplace TmpStrAA "`r" "" ;strip return string
        	       		strreplace TmpStrBB "`n" "" ;strip new line string
        	     	   	strreplace TmpStrBB "`r" "" ;strip return string
        	     	   	strreplace TmpStrCC "`n" "" ;strip new line string
        	     	   	strreplace TmpStrCC "`r" "" ;strip return string
        	     	   	strreplace TmpStrDD "`n" "" ;strip new line string
        	     	   	strreplace TmpStrDD "`r" "" ;strip return string
        	     		;so write string info to file
        	       			strcat Info_Str TmpStrAA
        	       			strcat Info_Str ","
        	       			strcat Info_Str TmpStrBB
        	       			strcat Info_Str ","
        	       			strcat Info_Str TmpStrCC
        	       			strcat Info_Str ","
        	       			strcat Info_Str TmpStrDD
        	       			fputs 3 Info_Str
        	       			Info_Str = "" ;reset Info_Str
					
        	       		endif	
         		endwhile
        	     fclose 0               ; Close the file.

	            endif
	         else
	              errormsg "File doesn't exist."
	         endif
  	     
         else
         	transmit "****^M"
         	waitfor ">"
         	transmit "LD 20^M"
         	waitfor "REQ:"
         endif
         nItem++               ; Increment.
     else
         exitwhile             ; If blank file name, exit loop.
     endif
     endwhile
fclose 3
run FnameBB
endproc


proc term
   ;log out of LD's
   transmit "****^M"
endproc
It's also added to my site.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top