robotastic / trunk-recorder

Records calls from a Trunked Radio System (P25 & SmartNet)
GNU General Public License v3.0
863 stars 192 forks source link

Use the JSON lib to generate call end data #927

Closed taclane closed 7 months ago

taclane commented 7 months ago

Instead of using file operations to emulate the creation of call JSON, this should be handled by the new JSON library. This should ultimately be easier to maintain, less prone to typo errors, and provide easier-to-read output.

Upon call completion, the call information is first collected into an ordered_json object before being written to disk with two-space indentation.

This json object is now included in the Call_Data_t struct, and passed back to call_info after generation. Doing so allows upload plugins to have direct access to this call end data without re-reading the .json file, or including a redundant method to recreate it locally.

robotastic commented 7 months ago

This seems like a great idea - merging it in for testing