I am logging all calls comming from my PBX what I need to do is record all calls every couple minutes to a file that can be imported into SQL for furture use. I would also like to have one file from the entire day for archiving purposes.
Yes ther is I am sorry for my wording. I need to capture all the data on the screen every 5 minutes if I use the capture on and off with a clear screen I run the risk of missing some data. I could get data every second. What I was asking is if there was another way to write the data to a file other than Captureon and off. can you leave the capture on and write the data to the file without capture off?
Does the files that are generated every 5 minutes needed for semi-real time analysis, or can they be processed at the end of the day?
What I'm trying to get at is, can you capture for the whole day, then at the end of the day parse out the data into smaller files? I'm assuming the data you're looking at capturing is going to be scrolling, and not a static 'snapshot', is this correct?
Yes they are needed for semi-real time analysis. I would actually like to have real time analysis, but thought that would be harder. And yes the data is scrolling.
If a capture file won't work, the only other option is to use the rget command, read it character by character or line by line, and save that a text file for analysis.
so with the rget command I can trigger it after a character is recieved or after a specific period of time? correct?
Here s a sample of my data:
N 099 00 3463 T001046 06/07 11:42 00:00:18 A 710115552534253
& 0000 0000
N 100 00 T001006 2273 06/07 11:42 00:00:30
& 0000 0000 5556036133XXXXXX
There are actually only four lines on screen in this example two lines start with N the other two start with a space and &. word wrapping causes it to be 5.
Does rget always buffer all the data and only write to a file when certain criteria is met?
Rget is pretty flexible in what it can look for to determine when a string has been received. In your case, you can probably look for a carriage return and/or linefeed at the end of the string and use the set aspect rgetchar command to tell rget to look for that particular character to know when a string has been received (I believe carriage return is the default value). You can use the monitor window to see just which character is ending the line (see end of this post for a copy and paste job from my site).
You will likely want to add the STRIP keyword to the rget command so that the ending character is stripped from the string.
Rget does not write to the file itself, you will need to use the fopen/fputs/fclose commands to open the file in append mode, write the line, and close the file each time a string is received.
Procomm's Monitor Window can be used to view the incoming and outgoing data, in both hex and ASCII format. To activate this window, select the Data | Monitor Window menu item. Resize the Monitor Window so that you can view the entire width of the window, then click back in the Procomm Plus window so that the Monitor Window does not have focus. Incoming text is displayed in red, while text you send is colored blue. The Monitor Window can be handy for viewing incoming escape sequences (to determine if Procomm Plus is responding properly to them) or to verify that the program is sending the data you think it should be.
Here is your code modified it does not does not output all the data.
string fname ;first part of file name
string datefilename ;this is the date part of file name
string datahold
proc main
dial data "PBX"
set aspect rgetchar 13
fname = "syrpbx " ;put the first part of name here leave a space at the end
datefilename = "" ;to ensure string datefilename is empty
call file_date ;calls file_date proc
strcat fname datefilename ;this combines the two string (in this case M1_Log YYYYMMDD)
set capture path "C:\Program Files\Symantec\Procomm Plus\Capture\"
set capture file fname ;sets caputure file to the file named in file_date proc
; capture on ;turns on capture
; waituntil "23:59:57" ;keeps capturing until this time
; pause 30
; capture off ;turns capture off
; clear
; pause 5 ;waits 5 seconds
Hmm, seems a bit suspicious that both of the strings in the output file are the same length. If you use the monitor window, did you notice anything "odd" about the way the data was being sent (lots of escape sequences, long time delays, etc.)?
Actually I did some research on previous posts andfound one where the user was getting 00 hex character in the line which would terminate the rget abnormally. I tried both solutions in the post. The first solution was to use the translation table but that did not work for me. The second option was to terminate the rget on the 00 which works I was able to get all the data. I am going to run it all night and check the data in the morning. The next step is to get it into SQL.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.