mirror of https://github.com/sipwise/db-schema.git
Added two new preferences needed for the new lnp local_qor type. connect_on_ported: In case of successful lockup in the lnp table for a call to non-local ported number, send the outgoing call to the ported number. ported_n1_to_ruri: If the caller subscriber is ported and the CLI ported number (N2) matches the allowed CLIs, substitute the CLI with the original number (N1) At the same time, all the preferences related to the number portability have been migrated into the new 'Number Portability' group, for an easy finding. Change-Id: I5889997a260e52c5c661f49624d984776ab3b384mr26.0
parent
7eac6bfe2e
commit
f5375d94e1
@ -0,0 +1,47 @@
|
||||
use provisioning;
|
||||
set autocommit=0;
|
||||
|
||||
SELECT id INTO @vpg_id FROM voip_preference_groups WHERE name = 'Internals';
|
||||
|
||||
# Migrate lnp preferences to the old Internals group
|
||||
UPDATE voip_preferences SET
|
||||
voip_preference_groups_id = @vpg_id
|
||||
WHERE attribute in ('caller_lnp_lookup', 'default_lnp_prefix', 'lnp_add_npdi', 'lnp_to_rn', 'skip_callee_lnp_lookup', 'lnp_for_local_sub');
|
||||
|
||||
|
||||
# Remove 'connect_on_ported' preference
|
||||
SELECT id INTO @vp_id FROM voip_preferences WHERE attribute = 'connect_on_ported';
|
||||
|
||||
DELETE FROM voip_usr_preferences WHERE attribute_id=@vp_id;
|
||||
DELETE FROM voip_prof_preferences WHERE attribute_id=@vp_id;
|
||||
DELETE FROM voip_dom_preferences WHERE attribute_id=@vp_id;
|
||||
DELETE FROM voip_peer_preferences WHERE attribute_id=@vp_id;
|
||||
|
||||
DELETE FROM kamailio.usr_preferences WHERE attribute='connect_on_ported';
|
||||
DELETE FROM kamailio.prof_preferences WHERE attribute='connect_on_ported';
|
||||
DELETE FROM kamailio.dom_preferences WHERE attribute='connect_on_ported';
|
||||
DELETE FROM kamailio.peer_preferences WHERE attribute='connect_on_ported';
|
||||
|
||||
DELETE FROM voip_preferences WHERE attribute = 'connect_on_ported';
|
||||
|
||||
|
||||
# Remove 'ported_n1_to_ruri' preference
|
||||
SELECT id INTO @vp_id FROM voip_preferences WHERE attribute = 'ported_n1_to_ruri';
|
||||
|
||||
DELETE FROM voip_usr_preferences WHERE attribute_id=@vp_id;
|
||||
DELETE FROM voip_prof_preferences WHERE attribute_id=@vp_id;
|
||||
DELETE FROM voip_dom_preferences WHERE attribute_id=@vp_id;
|
||||
DELETE FROM voip_peer_preferences WHERE attribute_id=@vp_id;
|
||||
|
||||
DELETE FROM kamailio.usr_preferences WHERE attribute='ported_n1_to_ruri';
|
||||
DELETE FROM kamailio.prof_preferences WHERE attribute='ported_n1_to_ruri';
|
||||
DELETE FROM kamailio.dom_preferences WHERE attribute='ported_n1_to_ruri';
|
||||
DELETE FROM kamailio.peer_preferences WHERE attribute='ported_n1_to_ruri';
|
||||
|
||||
DELETE FROM voip_preferences WHERE attribute = 'ported_n1_to_ruri';
|
||||
|
||||
|
||||
# Remove the new 'Number Portability' group
|
||||
DELETE FROM voip_preference_groups WHERE name = 'Number Portability';
|
||||
|
||||
COMMIT;
|
||||
@ -0,0 +1,65 @@
|
||||
use provisioning;
|
||||
set autocommit=0;
|
||||
|
||||
# Create the new 'Number Portability' group
|
||||
INSERT INTO voip_preference_groups (name) values ('Number Portability');
|
||||
SELECT LAST_INSERT_ID() INTO @vpg_id;
|
||||
|
||||
# Migrate lnp preferences to the new 'Number Portability' group
|
||||
UPDATE voip_preferences SET
|
||||
voip_preference_groups_id = @vpg_id
|
||||
WHERE attribute in ('caller_lnp_lookup', 'default_lnp_prefix', 'lnp_add_npdi', 'lnp_to_rn', 'skip_callee_lnp_lookup', 'lnp_for_local_sub');
|
||||
|
||||
# Add 'connect_on_ported' preference
|
||||
INSERT INTO voip_preferences SET
|
||||
voip_preference_groups_id = @vpg_id,
|
||||
attribute = 'connect_on_ported',
|
||||
label = 'Connect to the final destination using ported number',
|
||||
type = 1,
|
||||
max_occur = 1,
|
||||
usr_pref = 1,
|
||||
prof_pref = 1,
|
||||
dom_pref = 1,
|
||||
peer_pref = 1,
|
||||
contract_pref = 0,
|
||||
contract_location_pref = 0,
|
||||
dev_pref = 0,
|
||||
devprof_pref = 0,
|
||||
fielddev_pref = 0,
|
||||
modify_timestamp = now(),
|
||||
internal = 0,
|
||||
expose_to_customer = 0,
|
||||
data_type = 'boolean',
|
||||
read_only = 0,
|
||||
description = 'In case of successful lookup in the lnp table for a call to a non-local ported number, send the outgoing call to the ported number (used only for lnp local_qor type).',
|
||||
dynamic = 0,
|
||||
reseller_pref = 0,
|
||||
expose_to_subscriber = 0;
|
||||
|
||||
# Add 'ported_n1_to_ruri' preference
|
||||
INSERT INTO voip_preferences SET
|
||||
voip_preference_groups_id = @vpg_id,
|
||||
attribute = 'ported_n1_to_ruri',
|
||||
label = 'Substitute the CLI with the original number (N1)',
|
||||
type = 1,
|
||||
max_occur = 1,
|
||||
usr_pref = 1,
|
||||
prof_pref = 1,
|
||||
dom_pref = 1,
|
||||
peer_pref = 0,
|
||||
contract_pref = 0,
|
||||
contract_location_pref = 0,
|
||||
dev_pref = 0,
|
||||
devprof_pref = 0,
|
||||
fielddev_pref = 0,
|
||||
modify_timestamp = now(),
|
||||
internal = 0,
|
||||
expose_to_customer = 0,
|
||||
data_type = 'boolean',
|
||||
read_only = 0,
|
||||
description = 'If the caller subscriber is ported and the CLI ported number (N2) matches the allowed_cli list, then substitute the CLI with the original number (N1) (used only for lnp local_qor type).',
|
||||
dynamic = 0,
|
||||
reseller_pref = 0,
|
||||
expose_to_subscriber = 0;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in new issue