From a5555d27c275b4c47561189d60a27cbd254a0923 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Wed, 4 Sep 2013 15:25:08 +0200 Subject: [PATCH] Add shared_buddylist_visibility and display_name. The former is used to control whether to export a subscriber to the customer's shared XMPP roster. The latter is used to set the XMPP name for a contact and can be used in outbound_from_display. --- db_scripts/diff/15009.down | 16 ++++++++++++++++ db_scripts/diff/15009.up | 24 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 db_scripts/diff/15009.down create mode 100644 db_scripts/diff/15009.up diff --git a/db_scripts/diff/15009.down b/db_scripts/diff/15009.down new file mode 100644 index 00000000..05b489f0 --- /dev/null +++ b/db_scripts/diff/15009.down @@ -0,0 +1,16 @@ +SET AUTOCOMMIT=0; + +USE provisioning; + +DELETE FROM voip_preferences WHERE attribute = 'shared_buddylist_visibility'; +DELETE FROM voip_preference_groups WHERE name = 'XMPP Settings'; + +DELETE FROM voip_preferences WHERE attribute = 'display_name'; + +SELECT id INTO @out_id FROM voip_preferences WHERE attribute = 'outbound_from_display'; +DELETE FROM voip_preferences_enum WHERE preference_id = @out_id AND value = 'np_display'; +UPDATE voip_usr_preferences SET value = 'npn' WHERE attribute_id = @out_id AND value = 'np_display'; +UPDATE voip_dom_preferences SET value = 'npn' WHERE attribute_id = @out_id AND value = 'np_display'; +UPDATE voip_peer_preferences SET value = 'npn' WHERE attribute_id = @out_id AND value = 'np_display'; + +COMMIT; diff --git a/db_scripts/diff/15009.up b/db_scripts/diff/15009.up new file mode 100644 index 00000000..51d56a4e --- /dev/null +++ b/db_scripts/diff/15009.up @@ -0,0 +1,24 @@ +SET AUTOCOMMIT=0; + +USE provisioning; + +INSERT INTO voip_preference_groups (name) values ('XMPP Settings'); +SELECT LAST_INSERT_ID() INTO @xmpp_id; +SELECT id INTO @num_id FROM voip_preference_groups WHERE name = 'Number Manipulations'; + +INSERT INTO voip_preferences + (voip_preference_groups_id, attribute, type, usr_pref, dom_pref, peer_pref, + internal, data_type, max_occur, description, modify_timestamp) +VALUES + (@xmpp_id, 'shared_buddylist_visibility', 1, 1, 0, 0, + 0, 'boolean', 1, 'Export this subscriber into the shared XMPP buddy list for the customer.', '1970-01-01 00:00:00'), + (@num_id, 'display_name', 0, 1, 0, 0, + 0, 'string', 1, 'The network-provided display name used for XMPP contacts and optionally SIP outbound header manipulation.', '1970-01-01 00:00:00'); + +SELECT id INTO @disp_id FROM voip_preferences WHERE attribute = 'outbound_from_display'; +INSERT INTO voip_preferences_enum + (preference_id, label, value, usr_pref, dom_pref, peer_pref, default_val) + VALUES + (@disp_id, 'Network-Provided Display-name', 'np_display', 1, 1, 1, 0); + +COMMIT;