安装依赖
apt-get install gcc bison flex make openssl libmysqlclient-dev perl libdbi-perl libdbd-mysql-perl libdbd-pg-perl libfrontier-rpc-perl libterm-readline-gnu-perl libberkeleydb-perl mysql-server ssh libxml2 libxml2-dev libxmlrpc-core-c3-dev libpcre3 libpcre3-dev subversion libncurses5-dev git ngrep libssl-dev
下载源码
wget https://opensips.org/pub/opensips/latest/opensips-3.3.7.tar.gz
解压后配置模块
make menuconfig
注意: opensipsctl 在3.X版本已经取消,替换为opensips-cli.需要手动自行安装
https://github.com/OpenSIPS/opensips-cli/blob/master/docs/INSTALLATION.md
opensips-cli.cfg 配置:
[default] log_level: WARNING prompt_name: opensips-cli prompt_intro: Welcome to OpenSIPS Command Line Interface! prompt_emptyline_repeat_cmd: False history_file: ~/.opensips-cli.history history_file_size: 1000 output_type: pretty-print communication_type: fifo fifo_file: /tmp/opensips_fifo database_schema_path: /home/app/opensips-3.3.7/scripts/ #这个配置项必须要有,否则不会创建表,该路径为opensips的源码目录 (需删除注释) database_modules: ALL database_admin_url: mysql://root@localhost
opensips 启动命令 : opensips
退出命令: opensips-cli -x mi kill
在使用 opensips-cli的时候,如果发生错误,可以用 -d 参数开启debug模式,显示详细信息
--end