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!

Naming capture files 2

Status
Not open for further replies.

Pandab2002

IS-IT--Management
Apr 16, 2003
47
US
Hi all,

I created a simple script to go in and pull data from a nortel pbx and capture it to a file. I am trying to come up with a way to fetch the telnet entry name and concatenate the entry name and the current date and use it as the capture file name. However the fetch dialentry dialname command seems to be invalid. Any suggestions on how to get the dialentry name from a telnet group?

 
I'm not aware of any issues off the top of my head, can you post your script to review?

Below is a script, that while using data connections, should work OK for telnet connections with the change of DATA to TELNET in the proper places.

proc main
integer iEntries ;Number of entries in dialing class
integer iCount ;Loop variable
string sName ;Name of Connection Directory entry
string sAreaCode
string sCompany
string sPhoneNumber
string sUserID
string sPassword
string sMisc

dialcount DATA iEntries ;Get number of data entries
for iCount = 0 upto (iEntries - 1)
dialname DATA iCount sName ;Get name of entry based on index
set dialentry access DATA sName ;Turn on dialentry for the current entry
fetch dialentry areacode sAreaCode
fetch dialentry phonenumber sPhoneNumber
fetch dialentry company sCompany
fetch userid sUserID
fetch password sPassword
fetch misc sMisc
endfor
endproc

 
Give $DIALCONNECT a try.

proc main
string switchName
switchName = $DIALCONNECT
pwtitlebar switchName PERMANENT ;Display switch name in title.
msgbox "Name of this switch is: %s" switchName
endproc

$DIALCONNECT
Identifies the name of the Connection Directory entry that established the current connection.


One way to add the date is:
string Year, Month, Day, Hour, Min, Sec
string cap_fileName = "dataCaptured"

;Add time to capture file name.
ltimeints $LTIME Year Month Day Hour Min Sec
strfmt cap_fileName "%s_%d_%d_%d_%d_%d_%d" fn_cap Year Month Day Hour Min Sec
 
Thanks both of you for your outstanding suggestions. I wish i sent this earlier but it resides on my work PC which is not networked with this one. Anyway, here is the script that I built last week.

string Da, Fs, Fu, dcf
proc main
capture off
Da = $DATE
Fs = "/"
Fu = "_"
s0 = $DIALCONNECT
;set dialentry access 1 s0
set aspect spawn ON
strreplace Da Fs Fu
strcat S0 fu
strcat S0 da

set capture file s0
capture on
transmit "ld 20^M"
waitfor "REQ: "
transmit "prt^M"
waitfor "TYPE: "
transmit "tnb^M"
waitfor "TN "
transmit "^M"
waitfor "CDEN "
transmit "^M"
waitfor "CUST "
transmit "^M"
waitfor "DATE "
transmit "^M"
waitfor "PAGE "
transmit "^M"
waitfor "DES "
transmit "^M"
while not waitfor "NACT "
endwhile
transmit "end^M"
pause 3
transmit "logo^M"
pause 1
capture off
disconnect
endproc


I found the culprit. The "set dialentry access 1 s0" statement was messing up the script. I ; it out and the script worked as intended. Again, thanks to both of you for outstanding suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top