ALTER TABLE cc_call_phone ADD COLUMN asr_seconds INT(10) DEFAULT 0 NOT NULL COMMENT 'asr时长（秒）';
ALTER TABLE cc_call_phone ADD COLUMN tts_times INT(10) DEFAULT 0 NOT NULL COMMENT 'tts调用次数（次）';
ALTER TABLE cc_call_phone ADD COLUMN tts_flow_tokens INT(10) DEFAULT 0 NOT NULL COMMENT '大模型tts的字符数（字符）';
ALTER TABLE cc_call_phone ADD COLUMN input_tokens INT(10) DEFAULT 0 NOT NULL COMMENT '总输入token数';
ALTER TABLE cc_call_phone ADD COLUMN output_tokens INT(10) DEFAULT 0 NOT NULL COMMENT '总输出token数';
ALTER TABLE cc_call_phone ADD COLUMN total_cost DECIMAL(10,8) DEFAULT 0.0 NOT NULL COMMENT '总调用费用（asr+tts+大模型）';
ALTER TABLE cc_call_phone ADD COLUMN billing_status INT(1) DEFAULT 0 NOT NULL COMMENT '计费状态（1：已计费、0：未计费）';



ALTER TABLE cc_inbound_cdr ADD COLUMN asr_seconds INT(10) DEFAULT 0 NOT NULL COMMENT 'asr时长（秒）';
ALTER TABLE cc_inbound_cdr ADD COLUMN tts_times INT(10) DEFAULT 0 NOT NULL COMMENT 'tts调用次数（次）';
ALTER TABLE cc_inbound_cdr ADD COLUMN tts_flow_tokens INT(10) DEFAULT 0 NOT NULL COMMENT '大模型tts的字符数（字符）';
ALTER TABLE cc_inbound_cdr ADD COLUMN input_tokens INT(10) DEFAULT 0 NOT NULL COMMENT '总输入token数';
ALTER TABLE cc_inbound_cdr ADD COLUMN output_tokens INT(10) DEFAULT 0 NOT NULL COMMENT '总输出token数';
ALTER TABLE cc_inbound_cdr ADD COLUMN total_cost DECIMAL(10,8) DEFAULT 0.0 NOT NULL COMMENT '总调用费用（asr+tts+大模型）';
ALTER TABLE cc_inbound_cdr ADD COLUMN billing_status INT(1) DEFAULT 0 NOT NULL COMMENT '计费状态（1：已计费、0：未计费）';


ALTER TABLE cc_tts_aliyun ADD COLUMN voice_source VARCHAR(32) DEFAULT 'aliyun_tts' COMMENT '声音源,aliyun_tts、aliyun_tts_flow';



DELETE FROM cc_params WHERE id = 87 AND param_code = 'price_aliyun_asr';
INSERT INTO cc_params VALUES ('87', '阿里云asr单价（每小时）', 'price_aliyun_asr', '1.8', 'sys', '0');

DELETE FROM cc_params WHERE id = 88 AND param_code = 'price_aliyun_tts';
INSERT INTO cc_params VALUES ('88', '阿里云tts单价（每千次）', 'price_aliyun_tts', '1.8', 'sys', '0');

DELETE FROM cc_params WHERE id = 89 AND param_code = 'price_aliyun_tts_flow';
INSERT INTO cc_params VALUES ('89', '阿里云声音克隆单价（每万字符）', 'price_aliyun_tts_flow', '2.0', 'sys', '0');

DELETE FROM cc_params WHERE id = 90 AND param_code = 'price_llm_token';
INSERT INTO cc_params VALUES ('90', '大模型单价（每千token）', 'price_llm_token', '0.00015', 'sys', '0');


UPDATE sys_config SET config_value = 'v20250923' WHERE config_key = 'sys.version';

