Scripts for CDR fixing when we have wrong billsec cdr_check.sh CDRs from Providers are necessary to get correct billsec. Then we get cdrs from db and map with cdrs from providers to find call ID. output -> text file with call_id, correct_billsec_from_provider_cdr Based on call ID we do backups (cdr_backup.sh) snd prepare cdr fixing sqls (cdr_fix.sh), which we execute with separate script later (cdr_fix_execite.sh) Rerating is necessary afterwards for user_billsec and provider_billsec (need to modify rerating script - script added in this folder) ref: https://support.kolmisoft.com/tickets/ticket_show/49631 When starting - copy scripts to /tmp/cdr_fix source file [provider cdr] in tsv format (tab separated values) import into google sheets, clean the data, export to tsv format: calldate, src, dst, billsec check cdr_check.sh for more data Script run order: 1. cdr_check.sh 2. cdr_backup.sh 3. cdr_fix.sh 4. cdr_fix_execute.sh in case something goes wrong -> cdr_backup_restore.sh also original billsecs are stored in not-used cdr fields: user_billsec -> reseller_billsec, provider_billsec->partner_billsec, billsec->did_billsec