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!

TARGET??? (HELP KNOB)

Status
Not open for further replies.

Mjamm

IS-IT--Management
Dec 24, 2001
88
US
I am trying to print out a directory number(DN) in a Nortel Meridian PBX. After I print the DN, it will provide me a terminal number(TN). However, if a DN appears on multiple phones it will print out multiple TNs. I want to set up a When TARGET and grab the TN of only the one that has the word MARP associated with it. Printed below is the input/output from the PBX. Can you help with this and only grab then numeric numbers of the TN with the MARP (018 0 07 06)???

REQ: PRT
TYPE: DNB
CUST 0
DN 2980
DATE
PAGE
DES

DN 2980
CPND
NAME Switch Room
XPLN 11
DISPLAY_FMT FIRST,LAST
TYPE SL1
TN 020 0 04 00 KEY 05 DES CENSVC 11 NOV 2004
TN 024 0 01 00 KEY 05 DES CENSVC 2 NOV 2004
(2616)
TN 018 0 07 06 KEY 00 H MARP 6 FEB 2003
 
Not being familiar with Nortels, I've got a couple questions to ask about the formatting first. Will you always receive one TN or one group of TNs from the PBX, or will you be receiving several groups of TNs per command issued? Will the "MARP" string always be present in the TN that you are wanting?


aspect@aspectscripting.com
 
Q: Will you always receive one TN or one group of TNs from the PBX, or will you be receiving several groups of TNs per command issued?

A: That depends... The DN is a (Phone Number) and the TN is an identifer for a telephone. If a phone number only appears on one telephone it will always be Marp'd. If the phone number appears on (3) telephones, then there will be (3) TN's displayed, and at least one will always have the "MARP" string.

Q: Will the "MARP" string always be present in the TN that you are wanting?

A: Yes, the "MARP" string will always be present for the particular TN that I am wanting.

 
Below is the first cut at a script to test. Is the format (mainly the length) of the TN data constant? If so, then the below code to parse the TN out, assuming the correct line was read, should work.

I'm not certain how you want to include the below sample into your script, but if it it will be running inside another script, you'll likely need to remove the while 1/endwhile loop to start with. You'll also need to add a way (probably define sTN as a global variable) to get the TN value back to the level of the script that wants that data.

proc main
when target 0 "MARP" call read_line

while 1
yield
endwhile
endproc

proc read_line
string sLine, sTN

termgets $ROW 0 sLine
substr sTN sLine 5 11
usermsg "%s" sTN
endproc

aspect@aspectscripting.com
 
Hello,

Is there a Ending Line String that Indicates the Endof the REQ ?? IE: "REQ COMPLETE"

If so you could doa Pattern Match from the Start to End with a Double While Loop.

Hank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top