USE provisioning;
SET AUTOCOMMIT=0;

ALTER TABLE voip_preferences ADD COLUMN label varchar(255) NOT NULL AFTER attribute;
UPDATE voip_preferences SET label = 'Area Code' WHERE attribute = 'ac';
UPDATE voip_preferences SET label = 'Internal Contract #' WHERE attribute = 'account_id';
UPDATE voip_preferences SET label = 'Administratively block anonymous inbound calls' WHERE attribute = 'adm_block_in_clir';
UPDATE voip_preferences SET label = 'Administrative Block List for inbound calls' WHERE attribute = 'adm_block_in_list';
UPDATE voip_preferences SET label = 'Administrative Block Mode for inbound calls' WHERE attribute = 'adm_block_in_mode';
UPDATE voip_preferences SET label = 'Administrative Block List for outbound calls' WHERE attribute = 'adm_block_out_list';
UPDATE voip_preferences SET label = 'Administrative Block Mode for outbound calls' WHERE attribute = 'adm_block_out_mode';
UPDATE voip_preferences SET label = 'Administrative PIN to bypass outbound Block List' WHERE attribute = 'adm_block_out_override_pin';
UPDATE voip_preferences SET label = 'Administrative NCOS Level' WHERE attribute = 'adm_ncos';
UPDATE voip_preferences SET label = 'Internal Administrative NCOS Level #' WHERE attribute = 'adm_ncos_id';
UPDATE voip_preferences SET label = 'Allowed CLIs for outbound calls' WHERE attribute = 'allowed_clis';
UPDATE voip_preferences SET label = 'Allowed source IPs' WHERE attribute = 'allowed_ips';
UPDATE voip_preferences SET label = 'Internal allowed source IP group #' WHERE attribute = 'allowed_ips_grp';
UPDATE voip_preferences SET label = 'Allow calls to foreign domains' WHERE attribute = 'allow_out_foreign_domain';
UPDATE voip_preferences SET label = 'Block anonymous inbound calls' WHERE attribute = 'block_in_clir';
UPDATE voip_preferences SET label = 'Block List for inbound calls' WHERE attribute = 'block_in_list';
UPDATE voip_preferences SET label = 'Block Mode for inbound calls' WHERE attribute = 'block_in_mode';
UPDATE voip_preferences SET label = 'Block List for outbound calls' WHERE attribute = 'block_out_list';
UPDATE voip_preferences SET label = 'Block Mode for outbound calls' WHERE attribute = 'block_out_mode';
UPDATE voip_preferences SET label = 'PIN to bypass outbound Block List' WHERE attribute = 'block_out_override_pin';
UPDATE voip_preferences SET label = 'Country Code' WHERE attribute = 'cc';
UPDATE voip_preferences SET label = 'Internal Call Forward Busy map #' WHERE attribute = 'cfb';
UPDATE voip_preferences SET label = 'Internal Call Forward Unavailable #' WHERE attribute = 'cfna';
UPDATE voip_preferences SET label = 'Internal Call Forward Timeout #' WHERE attribute = 'cft';
UPDATE voip_preferences SET label = 'Internal Call Forward Unconditional #' WHERE attribute = 'cfu';
UPDATE voip_preferences SET label = 'Network-Provided CLI' WHERE attribute = 'cli';
UPDATE voip_preferences SET label = 'Hide own number for outbound calls' WHERE attribute = 'clir';
UPDATE voip_preferences SET label = 'CloudPBX Subscriber' WHERE attribute = 'cloud_pbx';
UPDATE voip_preferences SET label = 'CLI of CloudPBX Pilot Subscriber' WHERE attribute = 'cloud_pbx_base_cli';
UPDATE voip_preferences SET label = 'CloudPBX Hunt Group List' WHERE attribute = 'cloud_pbx_hunt_group';
UPDATE voip_preferences SET label = 'CloudPBX Hunt Policy' WHERE attribute = 'cloud_pbx_hunt_policy';
UPDATE voip_preferences SET label = 'CloudPBX Serial Hunt Timeout' WHERE attribute = 'cloud_pbx_hunt_timeout';
UPDATE voip_preferences SET label = 'Total max of overall concurrent calls' WHERE attribute = 'concurrent_max';
UPDATE voip_preferences SET label = 'Total max of outbound concurrent calls' WHERE attribute = 'concurrent_max_out';
UPDATE voip_preferences SET label = 'Total max of outbound calls of Customer' WHERE attribute = 'concurrent_max_out_per_account';
UPDATE voip_preferences SET label = 'Total max of overall calls of Customer' WHERE attribute = 'concurrent_max_per_account';
UPDATE voip_preferences SET label = 'Network-Provided Display Name' WHERE attribute = 'display_name';
UPDATE voip_preferences SET label = 'Use Number instead of Contact first for outbound calls' WHERE attribute = 'e164_to_ruri';
UPDATE voip_preferences SET label = 'Emergency CLI' WHERE attribute = 'emergency_cli';
UPDATE voip_preferences SET label = 'Emergency Prefix variable' WHERE attribute = 'emergency_prefix';
UPDATE voip_preferences SET label = 'Emergency Suffix variable' WHERE attribute = 'emergency_suffix';
UPDATE voip_preferences SET label = 'Use valid Alias CLI as NPN' WHERE attribute = 'extension_in_npn';
UPDATE voip_preferences SET label = 'External Contract #' WHERE attribute = 'ext_contract_id';
UPDATE voip_preferences SET label = 'External Subscriber #' WHERE attribute = 'ext_subscriber_id';
UPDATE voip_preferences SET label = 'Find Subscriber by UUID' WHERE attribute = 'find_subscriber_by_uuid';
UPDATE voip_preferences SET description = 'For incoming calls from this peer, find the destination subscriber by a uuid parameter in R-URI which has been sent in Contact at outbound registration.' WHERE attribute = 'find_subscriber_by_uuid';
UPDATE voip_preferences SET label = 'Force inbound calls to peer' WHERE attribute = 'force_inbound_calls_to_peer';
UPDATE voip_preferences SET label = 'Force outbound calls to peer' WHERE attribute = 'force_outbound_calls_to_peer';
UPDATE voip_preferences SET label = 'Ignore allowed IPs' WHERE attribute = 'ignore_allowed_ips';
UPDATE voip_preferences SET label = 'Inbound Network-Provided Number' WHERE attribute = 'inbound_npn';
UPDATE voip_preferences SET label = 'Inbound User-Provided Number' WHERE attribute = 'inbound_upn';
UPDATE voip_preferences SET label = 'Inbound User-Provided Redirecting Number' WHERE attribute = 'inbound_uprn';
UPDATE voip_preferences SET label = 'IPv4/IPv6 briding mode' WHERE attribute = 'ipv46_for_rtpproxy';
UPDATE voip_preferences SET label = 'IP Header Field' WHERE attribute = 'ip_header';
UPDATE voip_preferences SET label = 'Lock Level' WHERE attribute = 'lock';
UPDATE voip_preferences SET label = 'Manually defined allowed source IPs' WHERE attribute = 'man_allowed_ips';
UPDATE voip_preferences SET label = 'Internal manual allowed source IP group #' WHERE attribute = 'man_allowed_ips_grp';
UPDATE voip_preferences SET label = 'Enable Apple/Google Mobile Push' WHERE attribute = 'mobile_push_enable';
UPDATE voip_preferences SET label = 'Mobile Push Expiry Timeout' WHERE attribute = 'mobile_push_expiry';
UPDATE voip_preferences SET label = 'NCOS Level' WHERE attribute = 'ncos';
UPDATE voip_preferences SET label = 'Internal NCOS Level #' WHERE attribute = 'ncos_id';
UPDATE voip_preferences SET label = 'Disable NAT SIP pings' WHERE attribute = 'no_nat_sipping';
UPDATE voip_preferences SET label = 'Outbound Diversion Header' WHERE attribute = 'outbound_diversion';
UPDATE voip_preferences SET label = 'Outbound From-Display Field' WHERE attribute = 'outbound_from_display';
UPDATE voip_preferences SET label = 'Outbound From-Username Field' WHERE attribute = 'outbound_from_user';
UPDATE voip_preferences SET label = 'Outbound PAI-Username Field' WHERE attribute = 'outbound_pai_user';
UPDATE voip_preferences SET label = 'Outbound PPI-Username Field' WHERE attribute = 'outbound_ppi_user';
UPDATE voip_preferences SET label = 'Force outbound call via socket' WHERE attribute = 'outbound_socket';
UPDATE voip_preferences SET label = 'Peer Authentication Password' WHERE attribute = 'peer_auth_pass';
UPDATE voip_preferences SET label = 'Peer Authentication Domain' WHERE attribute = 'peer_auth_realm';
UPDATE voip_preferences SET label = 'Enable Peer Authentication' WHERE attribute = 'peer_auth_register';
UPDATE voip_preferences SET label = 'Peer Authentication User' WHERE attribute = 'peer_auth_user';
UPDATE voip_preferences SET label = 'Enable Prepaid' WHERE attribute = 'prepaid';
UPDATE voip_preferences SET label = 'Reject Emergency Calls' WHERE attribute = 'reject_emergency';
UPDATE voip_preferences SET label = 'Internal # for inbound callee rewrite rule set' WHERE attribute = 'rewrite_callee_in_dpid';
UPDATE voip_preferences SET label = 'Internal # for outbound callee rewrite rule set' WHERE attribute = 'rewrite_callee_out_dpid';
UPDATE voip_preferences SET label = 'Internal # for inbound caller rewrite rule set' WHERE attribute = 'rewrite_caller_in_dpid';
UPDATE voip_preferences SET label = 'Internal # for outbound caller rewrite rule set' WHERE attribute = 'rewrite_caller_out_dpid';
UPDATE voip_preferences SET label = 'Rewrite Rule Set' WHERE attribute = 'rewrite_rule_set';
UPDATE voip_preferences SET label = 'Ring Timeout for CFT' WHERE attribute = 'ringtimeout';
UPDATE voip_preferences SET label = 'RTCP Feedback Mode' WHERE attribute = 'rtcp_feedback';
UPDATE voip_preferences SET label = 'Export subscriber to shared XMPP Buddylist' WHERE attribute = 'shared_buddylist_visibility';
UPDATE voip_preferences SET label = 'Sound Set' WHERE attribute = 'sound_set';
UPDATE voip_preferences SET label = 'SRTP Transcoding Mode' WHERE attribute = 'srtp_transcoding';
UPDATE voip_preferences SET label = 'Enable Session-Timers' WHERE attribute = 'sst_enable';
UPDATE voip_preferences SET label = 'Session-Timer Refresh Interval' WHERE attribute = 'sst_expires';
UPDATE voip_preferences SET label = 'Session-Timer Max Refresh Interval' WHERE attribute = 'sst_max_timer';
UPDATE voip_preferences SET label = 'Session-Timer Min Refresh Interval' WHERE attribute = 'sst_min_timer';
UPDATE voip_preferences SET label = 'Session-Timer Refresh Method' WHERE attribute = 'sst_refresh_method';
UPDATE voip_preferences SET label = 'Allow inbound calls from foreign subscribers' WHERE attribute = 'unauth_inbound_calls';
UPDATE voip_preferences SET label = 'User-Provided Number' WHERE attribute = 'user_cli';
UPDATE voip_preferences SET label = 'RTP-Proxy Mode' WHERE attribute = 'use_rtpproxy';

COMMIT;
