From de4495f9094f8f432244030b47f2b27b6bc1ec99 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 21 Jan 2021 10:56:52 +0100 Subject: [PATCH] TT#108065 emergency_location_format * defines the format of emergency_location_object field * set cirpack as default since that was the original format * add PIDF-LO for implementing TR Notruf Change-Id: Ifcac50b7147f7233d42e1abea75c6cfc1d59f604 --- db_scripts/diff/15664.down | 36 +++++++++++++++++++++++++++++ db_scripts/diff/15664.up | 46 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 db_scripts/diff/15664.down create mode 100644 db_scripts/diff/15664.up diff --git a/db_scripts/diff/15664.down b/db_scripts/diff/15664.down new file mode 100644 index 00000000..5251a225 --- /dev/null +++ b/db_scripts/diff/15664.down @@ -0,0 +1,36 @@ +USE provisioning; +SET autocommit=0; + +UPDATE voip_preferences SET + description = 'Provide this field as pre-coded value to add it to the SDP as MIME object with content-type "application/vnd.cirpack.isdn-ext" and "content-disposition: signal;handling=required" according to the German NGN interconnect specification', + type = 0, + data_type = "string" + WHERE attribute = 'emergency_location_object'; + +SELECT id into @at_id FROM voip_preferences where + attribute = "emergency_location_format" and + label = "Emergency location format"; + +DELETE FROM voip_preferences_enum where + preference_id = @at_id; + +DELETE FROM voip_preferences where + id = @at_id; + +-- migrate values to string +SELECT id into @at_id FROM voip_preferences + WHERE attribute = 'emergency_location_object'; + +-- migrate values to string +CREATE TEMPORARY TABLE tmp_voip_usr_preferences_blob + SELECT id, preference_id, value FROM voip_usr_preferences_blob as _blob + WHERE id IN (SELECT value FROM voip_usr_preferences WHERE attribute_id = @at_id); + +DELETE FROM voip_usr_preferences_blob + WHERE id IN (SELECT id FROM tmp_voip_usr_preferences_blob); + +UPDATE voip_usr_preferences as _up, tmp_voip_usr_preferences_blob as _blob + SET _up.value = _blob.value + WHERE _up.id = _blob.preference_id and _up.attribute_id = @at_id; + +COMMIT; diff --git a/db_scripts/diff/15664.up b/db_scripts/diff/15664.up new file mode 100644 index 00000000..35a124f5 --- /dev/null +++ b/db_scripts/diff/15664.up @@ -0,0 +1,46 @@ +USE provisioning; +SET autocommit=0; + +-- update emergency_location_object to blob +UPDATE voip_preferences SET + description = "SDP MIME object related to location to be added on an emergency call", + type = 2, + data_type = "blob" + WHERE attribute = 'emergency_location_object'; + +SELECT id into @at_id FROM voip_preferences + WHERE attribute = 'emergency_location_object'; + +SELECT id into @vpg_id FROM voip_preference_groups + WHERE name = 'Number Manipulations'; + +INSERT INTO voip_preferences + SET +voip_preference_groups_id = @vpg_id, +attribute = "emergency_location_format", +label = "Emergency location format", +type = 0, +max_occur = 1, +usr_pref = 1, +prof_pref = 1, +data_type = "enum", +description = "Defines the format of emergency_location_object"; + +SELECT LAST_INSERT_ID() INTO @format_att_id; + +INSERT INTO voip_preferences_enum +(preference_id, label, value, usr_pref, dom_pref, peer_pref, contract_pref, prof_pref, default_val) +VALUES +(@format_att_id, "Presence Information Data Format Location + Object", 'PIDF-LO', 1, 0, 0, 0, 1, 0), +(@format_att_id, "cirpack", 'cirpack', 1, 0, 0, 0, 1, 1); + +-- migrate values to blob +CREATE TEMPORARY TABLE tmp_voip_usr_preferences + SELECT id, "application/vnd.cirpack.isdn-ext", value FROM voip_usr_preferences + WHERE attribute_id = @at_id; +INSERT INTO voip_usr_preferences_blob(preference_id, content_type, value) + SELECT * FROM tmp_voip_usr_preferences; + +COMMIT; +