-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-day call log plugin, log P25 priority/mode/duplex #482
Conversation
I've always been confused by the php files in this project. Are they a functional requirement for the core basis of trunk-recorder? If not, can they be moved somewhere else as a new repository? I know there's really no concrete policy, but as a matter of form, I think utility-type tools and scripts are fine for inclusion within the project (such as build scripts, or theoretical examples like tuning utilities or channel/source calculators), but anything beyond that, for example playback systems (like the audio player, or OpenMHz!) deserve their own repositories. |
@rosecitytransit Thanks for the PR! I agree having some method for aggregating activity would be helpful. Instead of baking ing a single specific method for aggregating, I would like to have a more flexible option. I can see this creeping into having to add in support for hourly logs, and sending logs to splunk. Things are looking pretty good with the plugin system. Instead of merging this into the core code, let me see if I can build this out as a plugin. It would be a good test to make sure the plugins can be useful. Alternatively, could this just be done using the websocket interface? Something like this ( #462 (comment) ) would allow for aggregation and saving data in what ever level/method is needed. |
I know you said you have ideas about it, and feel free to do what you want with it. As for logging, the unitScript process may be good for that (though not running at the end of a call it doesn't have the details, and is currently set to ignore messages w/radio IDs of 0) |
They could be, and probably should be.
Something like a SQLite database that sits along side this might be a good idea. I'm currently saving all of the file information into an SQLite database to keep track of everything. It generally makes the query time for a page load much, much smaller. -- SNIP -- I move the rest of this to the issue linked below. |
I thought I mentioned this, but my thought was the Web page shouldn't be a problem since it's just a couple files and don't require compiling or anything besides PHP. I put them in the
How about having the information passed on as an extra parameter (or parameters?) to the As I said in my original comment, if I were creating the project, I'd have all data writing be external, and the default
You don't have an official playback function? BTW, as set in |
@rosecitytransit agreed - I want to try and move the writing external to the core program. I am hoping that the plugins will let that happen, both for completed calls, but also for system events. An upload script could probably get the job done. Things started out simple though, and then the complexity trickled in :) I originally just used The upload script should get all the details now, via the JSON file. Python or Node have good tools for parsing the JSON information. It would be a little tough to correctly encode some of the lists, like Freq or Source as command line arguments. I am reworking the end_call() function to take care of things more sequentially. Right now, it is safe to call the upload script or use one of the built-in uploaders... but not both. |
I don't think so, as long as a quoted/escaped string is used and the format is defined. The simplest idea would be to just include the entire JSON now being created as a single (second) argument, and expect the |
Planning on re-doing this to either output the existing JSON creation to a daily file, or create a plugin |
Can you create a plugin? It would be a good example for others and they could customize for specific formats and output time periods. I am out on spring break be will be checking on things. Let me know if the plugin system needs any additions!On Apr 16, 2023, at 5:26 AM, Jason McHuff ***@***.***> wrote:
Planning on re-doing this to either output the existing JSON creation to a daily file, or create a plugin
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
I have it now so it can output the exiting JSON to a daily file either in addition to or instead of the per-call files. Can look into moving things into a plugin. |
Here's what I have so far. If you don't mind, I moved the existing JSON creation to the plugin, so it could also be put in a per-day file if desired. Also, note that the CSV creation as is does not store the position or length of each transmission. Issues: -It doesn't have to be a part of this, but how about removing the frequency section from the JSON like you did for OpenMHz uploading, and just keeping track of spikes and errors per call, instead per transmission and then adding them together on call conclusion? -One issue I've experienced is that sometimes my Web page will fail to include (a link to) the actual call when someone is listening "live" and the page fetches new calls while the audio file is being converted. I think one option would be to put a non-blocking delay in the log file creation or to move the per-day logging to use -When the logging format is settled, I can edit the live Web page to match and include it here. |
@robotastic When you have time, can you give your thoughts on this and the issues I raised in my last comment? |
Also, one idea is to have creating the JSON files be a config option, then I could put the daily log creation in an external plugin. It would just be nice to not have to duplicate the JSON creation code, to be able to write the same info to two different places (single file and daily log). Unless there's a desire to have daily log entries to be different than the single files. |
Trying to catch up on where things are with this. I think all of the daily call logging should be in an external plugin, in its own repo. Plugins do support reading from the Config file, so a user can configure aspects of the plugin. What are the "duplex, mode, priority" fields? If you can carve this into a few minimal set of PRs that would help track what is changing, and why. |
My initial read on this is that just about all of this can be done without much change to t-r. All a logging plugin would need to do is wait for a I get that there's an overhead inherent in creating a file and then deleting it, but compared to the intermediate .wav files that are being generated an extra few hundred bytes of json isn't much. So long as |
This is correct. If there's not a desire to eliminate that overhead, and there's not a desire to have a daily log (and better Web page) be a part of the core Trunk Recorder code, I see 3 options:
Also, as I mentioned a good thing about the plugin hook is that it's called after the upload script, so if one is using that to convert files they're guaranteed to be ready by then. |
@robotastic do you have thoughts on this? Should I submit a config option that disables the creation of JSON files or just go with one of the 3 options above? |
Let's leave the JSON file alone for now. It would probably be worth revisiting JSON files and the upload script as a whole sometime, but lets leave that as a new, clean PR because there is so much tangled up in this PR. It would be best to have the Web Page be external to Trunk Recorder and just have a link to it. That will make it easier to keep it up to date. Options 1 or 3 seem like good approaches to me. |
OK, I created an external plugin that does option 1 and have added a link to README.md. If someone wants to test it, that would be desirable. |
does not look at status bits in voice frames, only control channel messages
Completes #153
9a115eb puts a link to my daily log plugin (and live Web page audio player) in README.md and makes a few minor changes, including correcting links
83bed1f adds logging of P25 call priority (can be 0-7), circuit/packet mode and duplex from the Service Options field in control channel packets. Was originally 67a0d86