mirror of https://github.com/sipwise/db-schema.git
* 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: Ifcac50b7147f7233d42e1abea75c6cfc1d59f604mr9.4
parent
0ad0181ce2
commit
de4495f909
@ -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;
|
||||||
@ -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;
|
||||||
|
|
||||||
Loading…
Reference in new issue