From 54f1988337a7b7548b6c6ae9eba489be7b915561 Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Fri, 14 Aug 2015 14:58:42 +0200 Subject: [PATCH] MT#12707 - add accounting.malicious_calls table - add malicious_call_identification voip_preference - add malicious_call_identification sound set - add 'Applications' voip_preference_group Change-Id: I6707913b576ec7066d6c5a5af06eeff903c2ce20 --- db_scripts/diff/15185.down | 6 ++++++ db_scripts/diff/15185.up | 18 ++++++++++++++++++ db_scripts/diff/15186.down | 11 +++++++++++ db_scripts/diff/15186.up | 10 ++++++++++ db_scripts/diff/15187.down | 7 +++++++ db_scripts/diff/15187.up | 8 ++++++++ 6 files changed, 60 insertions(+) create mode 100644 db_scripts/diff/15185.down create mode 100644 db_scripts/diff/15185.up create mode 100644 db_scripts/diff/15186.down create mode 100644 db_scripts/diff/15186.up create mode 100644 db_scripts/diff/15187.down create mode 100644 db_scripts/diff/15187.up diff --git a/db_scripts/diff/15185.down b/db_scripts/diff/15185.down new file mode 100644 index 00000000..1fe07442 --- /dev/null +++ b/db_scripts/diff/15185.down @@ -0,0 +1,6 @@ +use accounting; +set autocommit=0; + +DROP TABLE accounting.malicious_calls; + +commit; diff --git a/db_scripts/diff/15185.up b/db_scripts/diff/15185.up new file mode 100644 index 00000000..b0910f8d --- /dev/null +++ b/db_scripts/diff/15185.up @@ -0,0 +1,18 @@ +use accounting; +set autocommit=0; + +CREATE TABLE accounting.malicious_calls ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + callee_uuid varchar(255) NOT NULL, + call_id varchar(255) NOT NULL, + start_time decimal(13,3) NOT NULL, + duration decimal(13,3) NOT NULL, + caller varchar(255) NOT NULL, + callee varchar(255) NOT NULL, + reported_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (id), + KEY mcid_callee_uuid_idx (callee_uuid), + UNIQUE KEY mcid_callid_idx (call_id) +) ENGINE=InnoDB; + +commit; diff --git a/db_scripts/diff/15186.down b/db_scripts/diff/15186.down new file mode 100644 index 00000000..764ccc65 --- /dev/null +++ b/db_scripts/diff/15186.down @@ -0,0 +1,11 @@ +use provisioning; +set autocommit=0; + +SELECT id into @attr_id from voip_preferences where attribute = 'malicious_call_identification'; +DELETE from voip_dom_preferences WHERE attribute_id=@attr_id; +DELETE from voip_usr_preferences WHERE attribute_id=@attr_id; +DELETE from voip_contract_preferences WHERE attribute_id=@attr_id; +DELETE from voip_preferences WHERE id=@attr_id; +DELETE from voip_preference_groups where name = 'Applications'; + +commit; diff --git a/db_scripts/diff/15186.up b/db_scripts/diff/15186.up new file mode 100644 index 00000000..4716cae5 --- /dev/null +++ b/db_scripts/diff/15186.up @@ -0,0 +1,10 @@ +use provisioning; +set autocommit=0; + +INSERT INTO voip_preference_groups (name) VALUES ('Applications'); +SELECT id into @vpg_id FROM voip_preference_groups where name = 'Applications'; +INSERT INTO voip_preferences (voip_preference_groups_id, attribute, label, type, max_occur, usr_pref, prof_pref, dom_pref, peer_pref, contract_pref, modify_timestamp, internal, expose_to_customer, data_type, read_only, description) + VALUES +(@vpg_id, 'malicious_call_identification', "Malicious Call Identification", 0, 1, 1, 1, 1, 0, 1, NOW(), 0, 0, 'boolean', 0, 'Report last call as malicious by calling at malicious_call@'); + +commit; diff --git a/db_scripts/diff/15187.down b/db_scripts/diff/15187.down new file mode 100644 index 00000000..eb89c303 --- /dev/null +++ b/db_scripts/diff/15187.down @@ -0,0 +1,7 @@ +use provisioning; +set autocommit=0; + +DELETE FROM voip_sound_handles WHERE name = 'malicious_call_report'; +DELETE FROM voip_sound_groups WHERE name = 'malicious_call_identification'; + +commit; diff --git a/db_scripts/diff/15187.up b/db_scripts/diff/15187.up new file mode 100644 index 00000000..a0816af4 --- /dev/null +++ b/db_scripts/diff/15187.up @@ -0,0 +1,8 @@ +use provisioning; +set autocommit=0; + +INSERT INTO voip_sound_groups (name) values ('malicious_call_identification'); +SELECT id into @mcid_id from voip_sound_groups where name = 'malicious_call_identification'; +INSERT INTO voip_sound_handles (name, group_id) VALUES ('malicious_call_report', @mcid_id); + +commit;