From a3414042e335b0f0685b34a41ee5b691e122bdcc Mon Sep 17 00:00:00 2001 From: kthiry Date: Tue, 23 Sep 2025 14:20:03 +0200 Subject: [PATCH] MT#63594 Add log_debug preference in Cloud PBX group Add new 'log_debug' preference in voip_preferences for Cloud PBX, allowing scoped SIP debug logging to be enabled at subscriber, domain or peer level. Preference is exposed to subscribers, default is disabled. Change-Id: Ic55bdc937a9804fe266cb2072b786429af2a1828 --- db_scripts/diff/15871.down | 6 ++++++ db_scripts/diff/15871.up | 31 +++++++++++++++++++++++++++++++ schema/ngcp.sql | 3 ++- schema/provisioning.sql | 3 ++- 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 db_scripts/diff/15871.down create mode 100644 db_scripts/diff/15871.up diff --git a/db_scripts/diff/15871.down b/db_scripts/diff/15871.down new file mode 100644 index 00000000..3d449260 --- /dev/null +++ b/db_scripts/diff/15871.down @@ -0,0 +1,6 @@ +use provisioning; +set autocommit=0; + +DELETE from voip_preferences WHERE attribute = "log_debug"; + +COMMIT; \ No newline at end of file diff --git a/db_scripts/diff/15871.up b/db_scripts/diff/15871.up new file mode 100644 index 00000000..2a10d092 --- /dev/null +++ b/db_scripts/diff/15871.up @@ -0,0 +1,31 @@ +use provisioning; +set autocommit=0; + +SET @group_id = (SELECT id FROM voip_preference_groups WHERE name = 'Cloud PBX' LIMIT 1); + +INSERT INTO voip_preferences SET +voip_preference_groups_id = @group_id, +attribute = 'log_debug', +label = 'Debug log level', +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 = 1, +data_type = 'boolean', +read_only = 0, +description = 'Enable scoped SIP debug logging for subscriber, domain, or peer. When enabled, all log levels for dialogs in this scope are promoted to be recorded regardless of the global proxy log setting. The default is disabled.', +dynamic = 0, +reseller_pref = 0, +expose_to_subscriber = 1; + +COMMIT; \ No newline at end of file diff --git a/schema/ngcp.sql b/schema/ngcp.sql index edd48a07..0f5e723f 100644 --- a/schema/ngcp.sql +++ b/schema/ngcp.sql @@ -25,7 +25,7 @@ CREATE TABLE `db_schema` ( PRIMARY KEY (`id`), UNIQUE KEY `rev_idx` (`revision`,`node`,`site_id`), KEY `release_idx` (`release`) -) ENGINE=InnoDB AUTO_INCREMENT=916 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=917 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8mb4 */; @@ -30967,6 +30967,7 @@ INSERT INTO `db_schema` VALUES (912,15867,'spce','1970-01-01 00:00:01','trunk',1 INSERT INTO `db_schema` VALUES (913,15868,'spce','1970-01-01 00:00:01','trunk',1); INSERT INTO `db_schema` VALUES (914,15869,'spce','1970-01-01 00:00:01','trunk',1); INSERT INTO `db_schema` VALUES (915,15870,'spce','1970-01-01 00:00:01','trunk',1); +INSERT INTO `db_schema` VALUES (916,15871,'spce','1970-01-01 00:00:01','trunk',1); commit; set autocommit=0; INSERT INTO `timezone` VALUES ('1','localtime','1970-01-01 00:00:01','1970-01-01 00:00:01',NULL); diff --git a/schema/provisioning.sql b/schema/provisioning.sql index ee7f5bb2..58fa99c3 100644 --- a/schema/provisioning.sql +++ b/schema/provisioning.sql @@ -1195,7 +1195,7 @@ CREATE TABLE `voip_preferences` ( UNIQUE KEY `attribute_idx` (`attribute`), KEY `vpgid_ref` (`voip_preference_groups_id`), CONSTRAINT `vpgid_ref` FOREIGN KEY (`voip_preference_groups_id`) REFERENCES `voip_preference_groups` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=412 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=413 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8mb4 */; @@ -4162,6 +4162,7 @@ INSERT INTO `voip_preferences` VALUES (408,3,'otp_secret','OTP Secret',0,1,1,0,0 INSERT INTO `voip_preferences` VALUES (409,3,'show_otp_registration_info','Show OTP Registration Info',0,1,1,0,0,0,0,0,0,0,0,'1970-01-01 00:00:01',1,0,'boolean',1,'Show Time-based One-Time-Password (TOTP) secret and registration info for the next CSC logins.',0,0,0); INSERT INTO `voip_preferences` VALUES (410,3,'dnd','Do Not Disturb (DND) mode',1,1,1,1,0,0,0,0,0,0,0,'1970-01-01 00:00:01',0,1,'boolean',0,'Enable Do Not Disturb (DND) mode. If activated the subscriber will not receive any call. The call forwards will not be taken into account.',0,0,1); INSERT INTO `voip_preferences` VALUES (411,4,'colr','Hide own number for inbound calls',1,1,1,0,0,0,0,0,0,0,0,'1970-01-01 00:00:01',0,1,'boolean',0,'\'Connected line identification restriction\' - if set to true, the CLI is not displayed to the remote party on incoming calls.',0,0,1); +INSERT INTO `voip_preferences` VALUES (412,9,'log_debug','Debug log level',1,1,1,1,1,1,0,0,0,0,0,'1970-01-01 00:00:01',0,1,'boolean',0,'Enable scoped SIP debug logging for subscriber, domain, or peer. When enabled, all log levels for dialogs in this scope are promoted to be recorded regardless of the global proxy log setting. The default is disabled.',0,0,1); commit; set autocommit=0; INSERT INTO `voip_preferences_enum` VALUES (8,62,'use domain default',NULL,1,1,0,0,NULL,0,0,0,0,NULL,NULL);