fix: validate caller collector encoding and release engine permissions

This commit is contained in:
hectorzhao
2026-08-31 17:26:29 +08:00
parent 5284d41f9a
commit 116e316eca
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -1,6 +1,7 @@
# 主叫号码接通率与应答率实时分析设计方案 # 主叫号码接通率与应答率实时分析设计方案
日期:2026-08-31 日期:2026-08-31
版本:V1.1(按用户修订后的业务口径) 版本:V1.1(按用户修订后的业务口径)
状态:设计文档已完成;代码、数据库迁移、真实联调与上线均待实施。 状态:设计文档已完成;代码、数据库迁移、真实联调与上线均待实施。
@@ -50,6 +50,8 @@ source /etc/lisglosips/secrets/mysql-migrate.env
set +a set +a
export DATABASE_URL export DATABASE_URL
DATABASE_URL=$(/usr/bin/node -e 'console.log(`mysql://${encodeURIComponent(process.env.MYSQL_USER)}:${encodeURIComponent(process.env.MYSQL_PASSWORD)}@${process.env.MYSQL_HOST}:${process.env.MYSQL_PORT}/${process.env.MYSQL_DATABASE}`)') DATABASE_URL=$(/usr/bin/node -e 'console.log(`mysql://${encodeURIComponent(process.env.MYSQL_USER)}:${encodeURIComponent(process.env.MYSQL_PASSWORD)}@${process.env.MYSQL_HOST}:${process.env.MYSQL_PORT}/${process.env.MYSQL_DATABASE}`)')
# Previous delta releases stripped executable bits from bundled native engines.
find "$new/node_modules/.pnpm" -path '*/@prisma/engines/schema-engine-debian-openssl-3.0.x' -type f -exec chmod 0750 {} \;
/usr/bin/node "$new/node_modules/prisma/build/index.js" migrate deploy --schema "$new/prisma/schema.prisma" /usr/bin/node "$new/node_modules/prisma/build/index.js" migrate deploy --schema "$new/prisma/schema.prisma"
unset DATABASE_URL MYSQL_PASSWORD unset DATABASE_URL MYSQL_PASSWORD
install -d -o syslog -g lisglosips -m 0750 /var/log/lisglosips install -d -o syslog -g lisglosips -m 0750 /var/log/lisglosips
+1 -1
View File
@@ -24,7 +24,7 @@ insert('route[S28_CDR_FAILURE] {', '\n $var(cra_kind)="END"; $var(cra_code)=$
const fields = ['uid', 'callid', 'customer', 'gateway', 'vendor', 'vendorGateway', 'caller', 'landing', 'callee', 'city', 'carrier', 'attempt']; const fields = ['uid', 'callid', 'customer', 'gateway', 'vendor', 'vendorGateway', 'caller', 'landing', 'callee', 'city', 'carrier', 'attempt'];
function emitter(type, prefix) { function emitter(type, prefix) {
const ref = k => `$${prefix}(cra_${k})`; const ref = k => `$${prefix}(cra_${k})`;
const encoded = fields.map(k => `$(${prefix}(cra_${k}){s.encode.base64})`).join('|'); const encoded = fields.map(k => `$(${prefix}(cra_${k}){s.b64encode})`).join('|');
return `\nroute[CRA_EMIT_${type}] {\n if (${ref('customer')}==NULL || ${ref('customer')}=="none") return;\n xlog("L_NOTICE", "CRA1|$var(cra_kind)|$Ts|$Tsm|${ref('startsec')}|${ref('startmicro')}|$var(cra_code)|$var(cra_source)|${encoded}\\n");\n}\n`; return `\nroute[CRA_EMIT_${type}] {\n if (${ref('customer')}==NULL || ${ref('customer')}=="none") return;\n xlog("L_NOTICE", "CRA1|$var(cra_kind)|$Ts|$Tsm|${ref('startsec')}|${ref('startmicro')}|$var(cra_code)|$var(cra_source)|${encoded}\\n");\n}\n`;
} }
cfg += emitter('AVP', 'avp') + emitter('DLG', 'dlg_val') + ` cfg += emitter('AVP', 'avp') + emitter('DLG', 'dlg_val') + `