-- 2026-02-28
INSERT INTO `cc_params` VALUES ('101', 'freeswitch根目录', 'freeswitch_root', '/home/freeswitch', 'sys', '0', '1');

ALTER TABLE cc_tts_aliyun ADD COLUMN language_code VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Language of the voice';
UPDATE cc_tts_aliyun SET language_code = 'zh-CN' WHERE language_code = '';

ALTER TABLE cc_inbound_llm_account ADD COLUMN asr_language_code VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Language of the asr';
UPDATE cc_inbound_llm_account SET asr_language_code = 'zh-CN' WHERE asr_language_code = '';
ALTER TABLE cc_inbound_llm_account ADD COLUMN tts_language_code VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Language of the tts';
UPDATE cc_inbound_llm_account SET tts_language_code = 'zh-CN' WHERE tts_language_code = '';

ALTER TABLE cc_ivr ADD COLUMN tts_language_code VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Language of the tts';
UPDATE cc_ivr SET tts_language_code = 'zh-CN' WHERE tts_language_code = '';

ALTER TABLE cc_call_task ADD COLUMN asr_language_code VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Language of the asr';
UPDATE cc_call_task SET asr_language_code = 'zh-CN' WHERE asr_language_code = '';
ALTER TABLE cc_call_task ADD COLUMN tts_language_code VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Language of the tts';
UPDATE cc_call_task SET tts_language_code = 'zh-CN' WHERE tts_language_code = '';

-- 2026-03-25
insert  into `sys_menu`(`menu_id`,`menu_name`,`menu_code`,`parent_id`,`order_num`,`url`,`target`,`menu_type`,`visible`,`is_refresh`,`perms`,`icon`,`create_by`,`create_time`,`update_by`,`update_time`,`remark`) values (4001,'防火墙管理','firewalld',2000,0,'/system/firewalld','menuItem','C','0','1','system:firewalld:view','#','admin','2025-04-21 16:08:39','admin','2025-05-05 13:00:39','');
insert  into `sys_menu`(`menu_id`,`menu_name`,`menu_code`,`parent_id`,`order_num`,`url`,`target`,`menu_type`,`visible`,`is_refresh`,`perms`,`icon`,`create_by`,`create_time`,`update_by`,`update_time`,`remark`) values (4002,'防火墙管理-添加','firewalldAdd',4001,1,'#','','F','0','1','system:firewalld:add','#','admin','2025-04-21 16:08:41','',NULL,'');
insert  into `sys_menu`(`menu_id`,`menu_name`,`menu_code`,`parent_id`,`order_num`,`url`,`target`,`menu_type`,`visible`,`is_refresh`,`perms`,`icon`,`create_by`,`create_time`,`update_by`,`update_time`,`remark`) values (4003,'防火墙管理-修改','firewalldEdit',4001,2,'#','','F','0','1','system:firewalld:edit','#','admin','2025-04-21 16:08:44','',NULL,'');
insert  into `sys_menu`(`menu_id`,`menu_name`,`menu_code`,`parent_id`,`order_num`,`url`,`target`,`menu_type`,`visible`,`is_refresh`,`perms`,`icon`,`create_by`,`create_time`,`update_by`,`update_time`,`remark`) values (4004,'防火墙管理-删除','firewalldDel',4001,3,'#','','F','0','1','system:firewalld:remove','#','admin','2025-04-21 16:08:45','',NULL,'');

-- 2026-03-31
INSERT INTO `cc_params` VALUES ('102', '客户未说话静默时长', 'max-wait-time-customer-speaking', '7000', 'sys', '0', '1');

-- 2026-04-07
ALTER TABLE cc_tts_aliyun ADD COLUMN language_name VARCHAR(255) DEFAULT '' NOT NULL COMMENT 'Language name of the voice';
ALTER TABLE cc_tts_aliyun ADD COLUMN tts_models VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Models of the voice';
UPDATE cc_tts_aliyun SET language_name = '中文' WHERE language_code = 'zh-CN';

ALTER TABLE cc_inbound_llm_account ADD COLUMN asr_models VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Models of the asr';
ALTER TABLE cc_inbound_llm_account ADD COLUMN tts_models VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Models of the tts';

ALTER TABLE cc_ivr ADD COLUMN tts_models VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Models of the tts';

ALTER TABLE cc_call_task ADD COLUMN asr_models VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Models of the asr';
ALTER TABLE cc_call_task ADD COLUMN tts_models VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Models of the tts';

ALTER TABLE his_cc_call_task ADD COLUMN asr_language_code VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Language of the asr';
ALTER TABLE his_cc_call_task ADD COLUMN tts_language_code VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Language of the tts';
ALTER TABLE his_cc_call_task ADD COLUMN asr_models VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Models of the asr';
ALTER TABLE his_cc_call_task ADD COLUMN tts_models VARCHAR(32) DEFAULT '' NOT NULL COMMENT 'Models of the tts';

DROP TABLE IF EXISTS cc_asr_languages;
CREATE TABLE `cc_asr_languages` (
                                    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'id',
                                    `asr_provider` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'provider of asr',
                                    `models` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'models of asr',
                                    `language_code` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'language code',
                                    `language_name` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'language name',
                                    PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


UPDATE cc_tts_aliyun SET tts_models = 'seed-tts-2.0' WHERE voice_source = 'doubao_vcl_tts' AND id >= 158 AND id <= 168;
UPDATE cc_tts_aliyun SET tts_models = 'seed-tts-1.0' WHERE voice_source = 'doubao_vcl_tts' AND id >= 169 AND id <= 520;

INSERT  INTO `cc_params`(`id`,`param_name`,`param_code`,`param_value`,`param_type`,`hide_value`,`allow_edit`) VALUES (1231316,'firewalld 防火墙配置文件路径','firewalld-config-path','/etc/firewalld/zones/public.xml','sys',0,1);
INSERT  INTO `cc_params`(`id`,`param_name`,`param_code`,`param_value`,`param_type`,`hide_value`,`allow_edit`) VALUES (1231317,'重启firewalld防火墙的命令','firewalld-restart-cmd','/usr/bin/systemctl  restart firewalld','sys',0,1);
INSERT  INTO `cc_params`(`id`,`param_name`,`param_code`,`param_value`,`param_type`,`hide_value`,`allow_edit`) VALUES (1231318,'是否启用firewalld防护墙','firewalld-enabled','true','sys',0,1);
INSERT  INTO `cc_params`(`id`,`param_name`,`param_code`,`param_value`,`param_type`,`hide_value`,`allow_edit`) VALUES (1231319,'呼入ip白名单(用于外部线路呼入)','fs-inbound-allow-ip-list','192.168.67.110\r\n192.168.67.120','sys',0,1);
INSERT  INTO `cc_params`(`id`,`param_name`,`param_code`,`param_value`,`param_type`,`hide_value`,`allow_edit`) VALUES (1231320,'分机注册的白名单 ','fs-register-allow-ip-list','192.168.67.110\r\n192.168.67.120','sys',0,1);
INSERT  INTO `cc_params`(`id`,`param_name`,`param_code`,`param_value`,`param_type`,`hide_value`,`allow_edit`) VALUES (1231321,'是否启用freeswitch的分机注册防护','fs-register-acl-enabled','true','sys',0,1);






