From 93e82cfaefbcec4fcee523448f2750e4630e0282 Mon Sep 17 00:00:00 2001 From: Marco Capetta Date: Thu, 5 Jul 2018 16:32:33 +0200 Subject: [PATCH] TT#39750 Add CFR voip preferences and support for it in CDRs Change-Id: I59a4025dba5045e74acb9bbe78a8cda52004e9af --- db_scripts/diff/15416.down | 9 +++++++++ db_scripts/diff/15416.up | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 db_scripts/diff/15416.down create mode 100644 db_scripts/diff/15416.up diff --git a/db_scripts/diff/15416.down b/db_scripts/diff/15416.down new file mode 100644 index 00000000..92583c0b --- /dev/null +++ b/db_scripts/diff/15416.down @@ -0,0 +1,9 @@ +USE provisioning; + +DELETE FROM voip_preferences WHERE attribute = 'cfr'; +DELETE FROM voip_cf_mappings WHERE type = 'cfr'; +ALTER TABLE voip_cf_mappings MODIFY COLUMN type enum ('cfu','cfb','cfna','cft','cfs') NOT NULL DEFAULT 'cfu'; + +USE accounting; + +ALTER TABLE cdr MODIFY COLUMN call_type enum('call','cfu','cft','cfb','cfna','cfs','sms') NOT NULL DEFAULT 'call'; diff --git a/db_scripts/diff/15416.up b/db_scripts/diff/15416.up new file mode 100644 index 00000000..d5eced17 --- /dev/null +++ b/db_scripts/diff/15416.up @@ -0,0 +1,30 @@ +USE provisioning; + +ALTER TABLE voip_cf_mappings MODIFY COLUMN type enum('cfu','cfb','cfna','cft','cfs','cfr') NOT NULL DEFAULT 'cfu'; + +insert into voip_preferences + set +voip_preference_groups_id = (select id from voip_preference_groups where name="Call Forwards"), +attribute = "cfr", +label = "Internal Call Forward Rerouting #", +type = 1, +max_occur = 0, +usr_pref = 1, +prof_pref = 0, +dom_pref = 0, +peer_pref = 0, +contract_pref = 0, +contract_location_pref = 0, +dev_pref = 0, +devprof_pref = 0, +internal = 1, +expose_to_customer = 0, +data_type = "int", +read_only = 1, +description = 'The id pointing to the "Call Forward Rerouting" entry in the voip_cf_mappings table'; + + +USE accounting; + +-- add new options at the end to make alter table run instantly +ALTER TABLE cdr MODIFY COLUMN call_type enum('call','cfu','cft','cfb','cfna','cfs','sms','cfr') NOT NULL DEFAULT 'call';