Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vendors:cisco:uc:cms [2021/10/16 16:03] – [Number of calls per day] gerardorourkevendors:cisco:uc:cms [2021/10/20 16:15] (current) – [Verify JSON format of CDR file and correct if necessary] gerardorourke
Line 10: Line 10:
 ==== Verify JSON format of CDR file and correct if necessary ==== ==== Verify JSON format of CDR file and correct if necessary ====
   * Gather your CDRs into one folder and pipe to a single file e.g. type * > ../CDR-file.json   * Gather your CDRs into one folder and pipe to a single file e.g. type * > ../CDR-file.json
 +  * Add an empty first line which contains all of the headers (as its the first line which the json2CSV checks to create the CSV file)
 +
 +<code>
 +{
 +  "session_id": "",
 +  "record_type": "",
 +  "time_stamp": "",
 +  "correlator_index": "",
 +  "call_leg_id": "",
 +  "remote_party": "",
 +  "local_address": "",
 +  "remote_address": "",
 +  "call_leg_type": "",
 +  "direction": "",
 +  "call_id": "",
 +  "call_name": "",
 +  "call_type": "",
 +  "cospace": "",
 +  "call_correlator": "",
 +  "state": "",
 +  "group_id": "",
 +  "sip_call_id": "",
 +  "display_name": "",
 +  "remote_address": "",
 +  "call_leg_id": "",
 +  "reason": "",
 +  "remote_teardown": "",
 +  "duration_seconds": "",
 +  "unencrypted_media": "",
 +  "sip_call_id": "",
 +  "db_record_type": ""
 + }
 +</code>
 +
   * The File can have some corruption on it. Check it is valid JSON using JQ - https://stedolan.github.io/jq/download/   * The File can have some corruption on it. Check it is valid JSON using JQ - https://stedolan.github.io/jq/download/
-  *  
 <code>  <code> 
 C:\X-Temp>jq-win64 -c . CDRs1.json > CDR12.json C:\X-Temp>jq-win64 -c . CDRs1.json > CDR12.json
Line 24: Line 57:
 fixes this issue. fixes this issue.
  
-Confirm all good by re-running with JQ. +  * Even if the file is not corrupt I found running it through JQ was necessary
 +<code> son2csv -i CDR2021_1.json -o CDR2021_1_V2.csv </code> 
 +  * Use the output from this this as the input to the json2csv
 ==== JSON2CSV ==== ==== JSON2CSV ====
  
  • vendors/cisco/uc/cms.1634396610.txt.gz
  • Last modified: 2021/10/16 16:03
  • by gerardorourke