TT#70329 Change serial_forking_by_q_value in enum

The elements available in the list are:
 - use domain preference
 - no
 - standard
 - probability

Change-Id: I5b83dd52abf7795ac458cd7a9994c13ca910c92e
changes/02/35602/6
Marco Capetta 6 years ago
parent 771b93f9a9
commit 38c8dca4bd

@ -0,0 +1,22 @@
USE provisioning;
SET AUTOCOMMIT=0;
SET sql_log_bin=0;
SELECT id INTO @vp_attr_id FROM voip_preferences WHERE attribute='serial_forking_by_q_value';
DELETE FROM voip_preferences_enum WHERE preference_id=@vp_attr_id;
UPDATE voip_preferences SET
data_type = 'boolean',
type = 1,
description = "Check the box if you want to perform serial forking based on q-value instead of parallel forking for registered contacts"
WHERE id = @vp_attr_id;
DELETE FROM voip_usr_preferences WHERE value <> 'standard' AND value <> 'probability' AND attribute_id = @vp_attr_id;
UPDATE voip_usr_preferences SET value = 1 WHERE value in ('standard','probability') AND attribute_id = @vp_attr_id;
DELETE FROM voip_dom_preferences WHERE value <> 'standard' AND value <> 'probability' AND attribute_id = @vp_attr_id;
UPDATE voip_dom_preferences SET value = 1 WHERE value in ('standard','probability') AND attribute_id = @vp_attr_id;
UPDATE kamailio.usr_preferences SET type = 1 WHERE attribute='serial_forking_by_q_value';
UPDATE kamailio.dom_preferences SET type = 1 WHERE attribute='serial_forking_by_q_value';
COMMIT;

@ -0,0 +1,28 @@
USE provisioning;
SET AUTOCOMMIT=0;
SET sql_log_bin=0;
SELECT id INTO @vp_attr_id FROM voip_preferences WHERE attribute='serial_forking_by_q_value';
INSERT INTO voip_preferences_enum
(preference_id, label, value, usr_pref, dom_pref, peer_pref, contract_pref, default_val)
VALUES
(@vp_attr_id, 'use domain default', NULL, 1, 0, 0, 0, 1),
(@vp_attr_id, 'No', 'no', 0, 1, 0, 0, 1),
(@vp_attr_id, 'No', 'no', 1, 0, 0, 0, 0),
(@vp_attr_id, 'Standard', 'standard', 1, 1, 0, 0, 0),
(@vp_attr_id, 'Probability', 'probability', 1, 1, 0, 0, 0);
UPDATE voip_preferences SET
data_type = 'enum',
type = 0,
description = "Select which type of forking based on q-value you want to perform. Select 'Standard' for the serial forking defined by q-value priority: the higher the q value number the more priority is given, same values mean parallel ringing. Select 'Probability' for a serial forking based on probability: higher q-value means higher probability to be contacted as first, contacts with q-value 0 have the lowest priority and they are tried after all the others."
WHERE id = @vp_attr_id;
UPDATE voip_usr_preferences SET value = 'standard' WHERE value = 1 and attribute_id = @vp_attr_id;
UPDATE voip_dom_preferences SET value = 'standard' WHERE value = 1 and attribute_id = @vp_attr_id;
UPDATE kamailio.usr_preferences SET type=0 WHERE attribute='serial_forking_by_q_value';
UPDATE kamailio.dom_preferences SET type=0 WHERE attribute='serial_forking_by_q_value';
COMMIT;
Loading…
Cancel
Save