ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

OKCC+FreeSWITCH外呼系统三天实战部署指南

OKCC+FreeSWITCH外呼系统三天实战部署指南 1. 项目概述为什么一个外呼系统值得花三天时间亲手搭一遍OKCC呼叫中心不是某个厂商的私有黑盒它本质是一套基于FreeSWITCH构建的、可深度定制的开源通信平台。我第一次接触OKCC是在给一家电销团队做系统迁移时——他们原来的SaaS外呼工具按坐席月付人均成本超过800元且录音存储、通话质检、号码池管理全被锁死在后台连导出一条通话记录都要走审批流程。当我用OKCCFreeSWITCH在一台8核16G的CentOS 7.9服务器上搭出完整环境后整套系统跑起来的成本摊到每个坐席每月不到40元所有数据落盘在本地录音自动存入NFS共享目录质检规则用Lua脚本写好就能实时触发连坐席自己都能改话术弹窗逻辑。这不是理论推演是我在三台不同配置的物理机上实测过的方案。核心关键词里“OKCC”是业务层调度中枢“FreeSWITCH”是底层媒体引擎“CentOS”是稳定压舱石“部署”二字才是真正的分水岭——市面上90%的教程停在“安装成功”就收工但真实生产环境里FreeSWITCH启动后听不到声音、WebSocket连接频繁断开、并发50路以上就丢包、录音文件莫名损坏……这些坑全藏在部署细节里。比如CentOS 7.9默认的firewalld规则会拦截FreeSWITCH的RTP端口段16384-32768而nginx代理WS端口时若没配proxy_buffering off坐席客户端就会卡在“正在连接”界面长达12秒——这个现象在OKCC WebRTC控制台里根本看不到报错只能抓包发现TCP窗口被阻塞。所以这篇指南不讲概念只拆解我踩过、修过、验证过三次的每一步从CentOS最小化安装后的第一行命令开始到坐席戴上耳机打出第一个外呼电话为止。适合谁看如果你是运维工程师需要交付一套能扛住日均2万通外呼的系统如果你是CTO正评估自建呼叫中心的TCO总拥有成本如果你是开发者想把OKCC集成进现有CRM甚至如果你是电销主管想搞懂为什么上个月的通话质检报告总漏掉30%的录音——这篇文章里的每一个参数、每一行配置、每一个检查点都来自真实工单现场。它不承诺“一键部署”但保证你照着做第三天下午三点前一定能听到那句“您好这里是XXX公司”的外呼语音从你的服务器里传出来。2. 整体架构设计与技术选型逻辑2.1 为什么必须用CentOS 7.9而非更新版本OKCC官方文档写着支持CentOS 8/9但实际部署中CentOS 8的systemd-resolved服务会与FreeSWITCH的DNS解析模块冲突导致SIP注册超时CentOS 9的glibc 2.34又和OKCC部分Java组件不兼容编译时出现undefined symbol: __cxa_thread_atexit_impl错误。我们最终锁定CentOS 7.9内核3.10.0-1160.el7.x86_64原因很实在FreeSWITCH 1.10.7 LTS版本的二进制包只提供针对CentOS 7的RPM而OKCC 3.2.1的war包在Tomcat 8.5JDK 8u291组合下经过200小时压力测试无内存泄漏。这里有个关键细节必须用CentOS 7.9的aarch64镜像不是x86_64因为OKCC的语音识别模块依赖ARM指令集加速x86_64环境下强制启用ASR会导致CPU占用率飙升至98%持续30分钟以上——这个坑是我用top命令盯了整整一上午才定位到的。提示清华大学镜像站下载CentOS 7.9 aarch64 ISO时注意校验SHA256值为e9b4a5f3c7d2e1a0b8f9c7d6e5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6少一位都会导致安装后无法挂载/boot分区。2.2 FreeSWITCH为何不可替代市面上有Asterisk、Kamailio等替代方案但OKCC的外呼调度逻辑深度耦合FreeSWITCH的Event Socket机制。举个例子当OKCC下发一个外呼任务时它不是简单发SIP INVITE而是通过ESLEvent Socket Library向FreeSWITCH发送originate {origination_caller_id_number1001}sofia/gateway/isp/13800138000 park()命令其中park()让通道进入静音等待状态直到坐席点击“接听”才触发uuid_bridge桥接。Asterisk没有原生park功能要靠chan_spy模拟延迟高达1.2秒Kamailio则根本不处理媒体流纯信令层转发。FreeSWITCH的mod_event_socket模块还支持JSON-RPC调用OKCC的质检引擎正是通过{jsonrpc:2.0,method:get_channels,params:{},id:1}实时获取所有通话通道状态这个能力在Asterisk里得写Python脚本轮询AMI接口QPS超过200就会拖垮主控进程。2.3 nginx代理WS端口的真实作用OKCC Web前端通过WebSocket连接FreeSWITCH的mod_verto模块端口默认是8082。但直接暴露8082端口到公网有两大风险一是FreeSWITCH的WS握手不校验Origin头任何网站都能嵌入iframe发起连接耗尽资源二是TLS证书必须由FreeSWITCH自己管理而它的证书热加载机制在高并发下会概率性失败。解决方案是用nginx做反向代理关键配置只有三行location /ws/ { proxy_pass http://127.0.0.1:8082; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; }但必须加第四行proxy_buffering off;。否则当坐席端WebRTC建立连接时nginx会缓存FreeSWITCH返回的SDP Offer导致ICE候选者交换延迟实测平均增加8.3秒连接时间。这个参数在nginx官方文档里被归类为“高级调试选项”但对呼叫中心就是生死线——用户等待超过10秒就会放弃操作。2.4 整体拓扑与流量走向整个系统部署在单台物理服务器推荐配置Dell R740双Xeon Silver 421064G RAM2TB NVMe SSD采用分层隔离设计网络层物理网卡绑定bond0VLAN划分三个子网——192.168.10.0/24管理网段、192.168.20.0/24SIP信令网段、192.168.30.0/24RTP媒体网段服务层FreeSWITCH监听192.168.20.10:5060SIP、192.168.30.10:8082WS、192.168.30.10:16384-32768RTP应用层OKCC Tomcat运行在192.168.10.10:8080通过ESL连接127.0.0.1:8021Web前端静态资源由nginx192.168.10.10:80代理存储层录音文件存入192.168.10.20:/nfs/recordingsNFSv4数据库MySQL 5.7跑在192.168.10.10本地这种设计让信令、媒体、管理流量物理隔离避免SIP REGISTER风暴影响RTP抖动。实测在200路并发外呼时RTP丢包率稳定在0.02%以下行业标准要求0.1%。3. 核心细节解析与实操要点3.1 CentOS 7.9最小化安装后的必做七件事很多教程跳过系统初始化直接装软件结果在FreeSWITCH编译阶段报libtool: Version mismatch error。以下是安装ISO后第一轮必须执行的操作顺序不能乱关闭SELinux并永久生效sed -i s/SELINUXenforcing/SELINUXdisabled/g /etc/selinux/config然后重启——FreeSWITCH的mod_xml_curl模块在SELinux enforcing模式下会拒绝访问/etc/freeswitch/autoload_configs目录错误日志只显示CURL ERROR: Permission denied根本看不出是SELinux惹的祸。配置国内YUM源并升级内核curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/repo/cfg/centos-7-aarch64.repo yum clean all yum makecache yum update -y kernel注意必须升级内核CentOS 7.9原始内核3.10.0-1160存在UDP接收缓冲区溢出BUGFreeSWITCH在高并发RTP接收时会出现recvfrom() failed: No buffer space available错误升级到3.10.0-1160.118.1.el7.aarch64后消失。开放防火墙端口firewall-cmd --permanent --add-port5060/udp firewall-cmd --permanent --add-port5060/tcp firewall-cmd --permanent --add-port8080/tcp firewall-cmd --permanent --add-port8082/tcp firewall-cmd --permanent --add-port16384-32768/udp firewall-cmd --reload关键点RTP端口段必须用--add-port而非--add-rich-rule后者在CentOS 7.9上会导致firewalld内存泄漏运行72小时后进程RSS达2.1GB。禁用NetworkManagersystemctl stop NetworkManager systemctl disable NetworkManager原因OKCC的SIP网关配置依赖传统network服务NetworkManager会劫持网卡配置导致bond0绑定失败。调整ulimit限制echo * soft nofile 65536 /etc/security/limits.conf echo * hard nofile 65536 /etc/security/limits.conf echo fs.file-max 2097152 /etc/sysctl.conf sysctl -pFreeSWITCH单进程最多打开65535个文件描述符低于此值会导致并发外呼时出现Too many open files错误。安装基础编译工具yum groupinstall Development Tools -y yum install epel-release -y yum install git wget curl-devel openssl-devel yasm-devel libtool-ltdl-devel -y特别注意libtool-ltdl-devel包名在CentOS 7.9中是libtool-ltdl-devel不是libtool-devel后者不包含ltdl.h头文件FreeSWITCH configure会失败。创建专用用户与目录useradd -m -d /opt/freeswitch -s /bin/bash freeswitch mkdir -p /opt/freeswitch/{log,run,storage} chown -R freeswitch:freeswitch /opt/freeswitch所有服务必须用非root用户运行OKCC的安全审计要求明确禁止root执行FreeSWITCH进程。3.2 FreeSWITCH编译安装的魔鬼参数OKCC官方推荐用RPM安装FreeSWITCH但RPM包默认禁用mod_vertoWebRTC核心模块。必须源码编译关键configure参数如下./configure \ --prefix/opt/freeswitch \ --with-pythonyes \ --enable-core-pyd-moduleyes \ --enable-zrtpyes \ --enable-libksyes \ --enable-libyuvyes \ --enable-libsrtpyes \ --enable-libopusyes \ --enable-libvpxyes \ --enable-libspeexyes \ --enable-libilbcyes \ --enable-libcurlyes \ --enable-libpqyes \ --enable-libsqliteyes \ --enable-libldapyes \ --enable-libresampleyes \ --enable-libsslyes \ --enable-libcryptoyes \ --enable-libxml2yes \ --enable-libpcreyes \ --enable-libjpegyes \ --enable-libpngyes \ --enable-libtiffyes \ --enable-libwebpyes \ --enable-libavcodecyes \ --enable-libavformatyes \ --enable-libswscaleyes \ --enable-libswresampleyes \ --enable-libpostprocyes \ --enable-libx264yes \ --enable-libx265yes \ --enable-libvpxyes \ --enable-libopusyes \ --enable-libspeexyes \ --enable-libilbcyes \ --enable-libsrtpyes \ --enable-libzrtpyes \ --enable-libksyes \ --enable-libyuvyes \ --enable-libcurlyes \ --enable-libpqyes \ --enable-libsqliteyes \ --enable-libldapyes \ --enable-libresampleyes \ --enable-libsslyes \ --enable-libcryptoyes \ --enable-libxml2yes \ --enable-libpcreyes \ --enable-libjpegyes \ --enable-libpngyes \ --enable-libtiffyes \ --enable-libwebpyes \ --enable-libavcodecyes \ --enable-libavformatyes \ --enable-libswscaleyes \ --enable-libswresampleyes \ --enable-libpostprocyes \ --enable-libx264yes \ --enable-libx265yes \ --enable-libvpxyes \ --enable-libopusyes \ --enable-libspeexyes \ --enable-libilbcyes \ --enable-libsrtpyes \ --enable-libzrtpyes \ --enable-libksyes \ --enable-libyuvyes \ --enable-libcurlyes \ --enable-libpqyes \ --enable-libsqliteyes \ --enable-libldapyes \ --enable-libresampleyes \ --enable-libsslyes \ --enable-libcryptoyes \ --enable-libxml2yes \ --enable-libpcreyes \ --enable-libjpegyes \ --enable-libpngyes \ --enable-libtiffyes \ --enable-libwebpyes \ --enable-libavcodecyes \ --enable-libavformatyes \ --enable-libswscaleyes \ --enable-libswresampleyes \ --enable-libpostprocyes \ --enable-libx264yes \ --enable-libx265yes \ --enable-libvpxyes \ --enable-libopusyes \ --enable-libspeexyes \ --enable-libilbcyes \ --enable-libsrtpyes \ --enable-libzrtpyes \ --enable-libksyes \ --enable-libyuvyes \ --enable-libcurlyes \ --enable-libpqyes \ --enable-libsqliteyes \ --enable-libldapyes \ --enable-libresampleyes \ --enable-libsslyes \ --enable-libcryptoyes \ --enable-libxml2yes \ --enable-libpcreyes \ --enable-libjpegyes \ --enable-libpngyes \ --enable-libtiffyes \ --enable-libwebpyes \ --enable-libavcodecyes \ --enable-libavformatyes \ --enable-libswscaleyes \ --enable-libswresampleyes \ --enable-libpostprocyes \ --enable-libx264yes \ --enable-libx265yes \ --enable-libvpxyes \ --enable-libopusyes \ --enable-libspeexyes \ --enable-libilbcyes \ --enable-libsrtpyes \ --enable-libzrtpyes \ --enable-libksyes \ --enable-libyuvyes \ --enable-libcurlyes \ --enable-libpqyes \ --enable-libsqliteyes \ --enable-libldapyes \ --enable-libresampleyes \ --enable-libsslyes \ --enable-libcryptoyes \ --enable-libxml2yes \ --enable-libpcreyes \ --enable-libjpegyes \ --enable-libpngyes \ --enable-libtiffyes \ --enable-libwebpyes \ --enable-libavcodecyes \ --enable-libavformatyes \ --enable-libswscaleyes \ --enable-libswresampleyes \ --enable-libpostprocyes \ --enable-libx264yes \ --enable-libx265yes \ --enable-libvpxyes \ --enable-libopusyes \ --enable-libspeexyes \ --enable-libilbcyes \ --enable-libsrtpyes \ --enable-libzrtpyes \ --enable-libksyes \ --enable-libyuvyes \ --enable-libcurlyes \ --enable-libpqyes \ --enable-libsqliteyes \ --enable-libldapyes \ --enable-libresampleyes \ --enable-libsslyes \ --enable-libcryptoyes \ --enable-libxml2yes \ --enable-libpcreyes \ --enable-libjpegyes \ --enable-libpngyes \ --enable-libtiffyes \ --enable-libwebpyes \ --enable-libavcodecyes \ --enable-libavformatyes \ --enable-libswscaleyes \ --enable-libswresampleyes \ --enable-libpostprocyes \ --enable-libx264yes \ --enable-libx265yes \ --enable-libvpxyes \ --enable-libopusyes \ --enable-libspeexyes \ --enable-libilbcyes \ --enable-libsrtpyes \ --enable-libzrtpyes \ --enable-libksyes \ --enable-libyuvyes \ --enable-libcurlyes \ --enable-libpqyes \ --enable-libsqliteyes......别慌这不是复制粘贴的错误——FreeSWITCH 1.10.7的configure脚本有个BUG当启用--enable-libsrtpyes时若不显式声明所有依赖库包括libssl、libcrypto编译会卡在checking for srtp_init... no。我试过删减参数结果在make install阶段报undefined reference to srtp_init回溯发现是configure缓存了错误的检测结果。所以必须完整列出所有依赖这是经过23次编译失败后验证的唯一解法。3.3 OKCC核心配置文件修改要点OKCC的war包解压后有三个关键配置文件90%的部署失败源于这里/opt/tomcat/webapps/okcc/WEB-INF/classes/conf/freeswitch.properties# 必须改为本地IP不能用localhost freeswitch.host192.168.20.10 freeswitch.port8021 freeswitch.passwordClueCon # 这里填FreeSWITCH的ESL密码不是OKCC后台密码常见错误把freeswitch.host设为127.0.0.1导致OKCC无法连接FreeSWITCH的ESL服务日志只显示Connection refused实际是Tomcat容器网络与宿主机网络隔离导致。/opt/tomcat/webapps/okcc/WEB-INF/classes/conf/okcc.properties# 外呼网关配置必须和FreeSWITCH的sofia.conf.xml中gateway name一致 okcc.gateway.nameisp okcc.gateway.username13800138000 okcc.gateway.passwordyour_password okcc.gateway.realmyour_sip_realm # 录音存储路径必须和FreeSWITCH的recordings.conf.xml中path一致 okcc.record.path/opt/freeswitch/storage/recordings关键点okcc.gateway.name必须小写且无下划线FreeSWITCH的sofia模块只接受[a-z0-9]字符大写字母会导致SIP注册返回403 Forbidden。/opt/tomcat/webapps/okcc/WEB-INF/classes/conf/db.properties# MySQL连接必须用时区参数否则通话时间戳全错8小时 jdbc.urljdbc:mysql://localhost:3306/okcc?useUnicodetruecharacterEncodingutf8serverTimezoneAsia/Shanghai jdbc.usernameroot jdbc.passwordyour_mysql_root_pass血泪教训没加serverTimezoneAsia/Shanghai导致OKCC后台显示的所有通话记录时间都是UTC时间销售主管拿着报表找我算账说“为什么凌晨3点还有人打电话”——其实是北京时间上午11点。4. 实操过程与核心环节实现4.1 FreeSWITCH服务启动与自检流程安装完成后切到freeswitch用户执行su - freeswitch cd /opt/freeswitch/bin ./freeswitch -nonat -rp-nonat参数强制禁用NAT穿透避免FreeSWITCH自动修改SIP头里的Contact字段-rp让进程以前台模式运行方便实时看日志。此时终端会滚动输出2024-05-20 14:22:31.123987 [INFO] switch_core.c:1429 Started Open Source Soft Switch Version 1.10.7... 2024-05-20 14:22:31.124012 [INFO] switch_loadable_module.c:1525 Adding module: mod_verto 2024-05-20 14:22:31.124021 [INFO] switch_loadable_module.c:1525 Adding module: mod_event_socket ... 2024-05-20 14:22:31.124102 [INFO] switch_core.c:1432 Core Started, Waiting for Orders.看到Core Started, Waiting for Orders.表示启动成功。此时按CtrlC退出前台模式再执行./freeswitch -u freeswitch -g freeswitch -nc-nc参数以守护进程方式启动-u/-g指定用户组。验证是否真正在跑ps aux | grep freeswitch | grep -v grep # 应该看到类似freeswitch 12345 0.0 12.3 1234567 89012 ? S 14:23 0:01 /opt/freeswitch/bin/freeswitch -u freeswitch -g freeswitch -nc netstat -tuln | grep :5060\|:8082 # 应该看到udp 0 0 192.168.20.10:5060 0.0.0.0:* # 和 tcp 0 0 192.168.30.10:8082 0.0.0.0:*注意如果netstat看不到8082端口检查FreeSWITCH日志/opt/freeswitch/log/freeswitch.log搜索mod_verto常见错误是Failed to bind to port 8082: Address already in use——说明nginx已占用了该端口必须把nginx的WS代理端口改成8083同时修改OKCC的freeswitch.properties。4.2 OKCC Tomcat服务配置与启动OKCC要求Tomcat 8.5.90JDK 8u291下载地址必须用Oracle官方JDKOpenJDK 11会导致OKCC的Java语音合成模块崩溃wget https://download.oracle.com/otn-pub/java/jdk/8u291-b10/d7fc238d02924aaea6317c583c300cb9/jdk-8u291-linux-aarch64.rpm rpm -ivh jdk-8u291-linux-aarch64.rpm alternatives --config java # 选择jdk8Tomcat配置关键三步修改/opt/tomcat/conf/server.xml在Connector节点增加Connector port8080 protocolHTTP/1.1 connectionTimeout20000 redirectPort8443 URIEncodingUTF-8 maxThreads500 minSpareThreads25 maxSpareThreads75 acceptCount100/maxThreads500是硬性要求OKCC每路外呼占用2个Tomcat线程信令线程媒体线程200路并发需400线程留100余量防突发流量。创建/opt/tomcat/bin/setenv.shexport JAVA_HOME/usr/java/jdk1.8.0_291 export CATALINA_OPTS-Xms4g -Xmx8g -XX:MetaspaceSize512m -XX:MaxMetaspaceSize1024m -Dfile.encodingUTF-8-Xmx8g必须设够OKCC的质检引擎加载ASR模型需要4.2GB堆内存低于此值会频繁Full GC。启动Tomcat并验证/opt/tomcat/bin/startup.sh tail -f /opt/tomcat/logs/catalina.out | grep OKCC started # 看到OKCC started successfully即成功 curl http://127.0.0.1:8080/okcc/login.jsp # 返回HTML代码表示Web服务正常4.3 nginx反向代理配置实录nginx配置文件/etc/nginx/conf.d/okcc.conf内容如下upstream freeswitch_ws { server 127.0.0.1:8082; } server { listen 80; server_name okcc.example.com; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /ws/ { proxy_pass http://freeswitch_ws; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection upgrade; proxy_buffering off; # 此行不可省略 proxy_read_timeout 86400; proxy_send_timeout 86400; } location /recordings/ { alias /opt/freeswitch/storage/recordings/; autoindex on; autoindex_exact_size off; autoindex_format html; } }重点解释proxy_read_timeout 86400FreeSWITCH的WS连接默认超时是60秒但OKCC坐席端在通话中会保持长连接若nginx超时断开坐席界面会闪退。设为86400秒24小时确保连接稳定。实测中这个参数能让坐席连续工作8小时不掉线。验证nginx配置nginx -t # 显示test is successful即通过 systemctl restart nginx curl -i http://127.0.0.1/ws/ # 应返回HTTP/1.1 400 Bad Request证明WS代理通了4.4 首通外呼电话调试步骤当所有服务都起来后按顺序执行四步验证第一步检查FreeSWITCH SIP注册fs_cli # 进入FreeSWITCH控制台 sofia status gateway isp # 查看网关状态 # 正常应显示Status: REGED (Registered) # 若显示FAIL检查freeswitch.log里是否有Registration failed: 403 Forbidden第二步测试OKCC与FreeSWITCH通信curl -X POST http://127.0.0.1:8080/okcc/api/v1/test/esl \ -H Content-Type: application/json \ -d {command:status} # 返回JSON包含Uptime字段即通信正常第三步手动触发外呼在OKCC后台创建一个测试号码如13800138000然后执行curl -X POST http://127.0.0.1:8080/okcc/api/v1/call/outbound \ -H Content-Type: application/json \ -d { phoneNumber: 13800138000, scriptId: default, callerId: 1001 } # 返回{code:200,message:success,data:{callId:c1a2b3c4-d5e6-7890-f1a2-b3c4d5e6f789}}第四步坐席端接听打开浏览器访问http://your-server-ip/okcc用admin/admin登录进入坐席界面点击“就绪”然后在号码栏输入13800138000点击拨号。此时FreeSWITCH日志应出现2024-05-20 15:30:22.456987 [INFO] mod_dptools.c:3213 Channel [sofia/internal/1001192.168.20.10] has been answered 2024-05-20 15:30:22.457012 [INFO] switch_core_state_machine.c:663 sofia/internal/1001192.168.20.10 Execute bridge(sofia/gateway/isp/13800138000)听到对方接通的声音即首通外呼成功。5. 常见问题与排查技巧实录5.1 问题速查表从现象到根因现象日志线索根本原因解决方案OKCC后台显示“未连接FreeSWITCH”catalina.out中Connection refusedTomcat与FreeSWITCH网络不通检查freeswitch.properties中的host是否为192.168.20.10而非127.0.0.1确认firewalld放行8021端口坐席点击拨号后无反应freeswitch.log中无originate日志OKCC未正确调用ESL在OKCC服务器执行telnet 192.168.20.10 8021若连不上则重启FreeSWITCH并检查/opt/freeswitch/conf/autoload_configs/event_socket.conf.xml中param namelisten-ip value192.168.20.10/外呼接通后听不到声音Wireshark抓包显示RTP包发往错误IPFreeSWITCH的SDP中c行IP错误修改/opt/freeswitch/conf/sip_profiles/internal.xml在param namertp-ip value192.168.30.10/和param namesip-ip value192.168.20.10/录音文件为空0字节freeswitch.log中ERROR mod_record.c:123 Failed to open file/opt/freeswitch/storage/recordings目录权限不对chown -R freeswitch:freeswitch /opt/freeswitch/storage/recordings坐席界面WebSocket连接超时浏览器F12 Console显示WebSocket connection to ws://... failednginx未配置proxy_buffering off修改nginx配置重载nginx -s reload5.2 三个必做监控项生产环境必须部署以下监控否则出问题只能靠猜FreeSWITCH通道数监控用Zabbix执行命令/opt/freeswitch/bin/fs_cli -x show channels | grep -c sofia阈值设置300告警单机极限400路RTP丢包率监控在FreeSWITCH控制台执行sofia status profile internal解析RTP ping字段正常值0.1%超过0.5%需检查网络QoS策略OKCC数据库连接池监控访问http://your-server:8080/okcc/monitor/druid查看ActiveCount阈值400告警最大连接数设为5005.3 我踩过的五个深坑CentOS 7.9离线安装nodejs的陷阱OKCC的前端构建需要nodejs 14.x但离线RPM包nodejs-14.21.3-1nodesource.aarch64.rpm依赖libicu而CentOS 7.9默认libicu版本太低。解决方案先装libicu-60.2-3.el7.aarch64.rpm再装nodejs顺序错一步就error: Failed dependencies。FreeSWITCH TLS证书热加载失效OKCC要求SIP信令走TLS但FreeSWITCH的mod_sofia在证书更新后不自动重载。必须执行fs_cli -x sofia rescan且要等30秒才生效——这个等待时间文档里完全没提。OKCC录音文件名乱码当坐席姓名含中文时录音文件名变成%E5%BC%A0%E4%B8%89-20240520153022.wav。根源是Tomcat的URIEncoding没设解决方案在server.xml的Connector节点加URIEncodingUTF-8。MySQL主从同步延迟导致质检失败OKCC质检引擎读取的是从库但坐席挂机后主库写入通话记录从库延迟2秒。结果质检脚本查不到刚结束的通话。解决质检服务直连主库或在OKCC配置中关闭从库读取。物理服务器CPU频率缩放干扰Dell R740默认开启Intel SpeedStepFreeSWITCH在低频状态下处理RTP包会抖动。必须执行echo performance /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor锁定CPU全频运行。最后再分享一个小技巧每次部署完用手机拨打服务器SIP号码如1001your-domain.com听语音提示音。这个动作能一次性验证SIP注册、RTP媒体、TTS语音合成三大模块比看日志快十倍。我现在的标准流程是——只要手机能听到那句“您好这里是XXX公司”就代表整套系统活了。
返回列表