http://opensips.org/pub/opensips/
make all include_modules="db_mysql"
sudo make install include_modules="db_mysql"
vi /usr/local/etc/opensips/opensipsctlrc
解除DBENGIN=MYSQL这句话的注释。
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
安装过程中会提示输入密码,输入并记住。安装完成后,
mysql -u root -p
Enter password:
cd /usr/local/sbin
./opensipsctl create
MySQL password for root:
INFO: test server charset
INFO: creating database opensips ...
INFO: Core OpenSIPS tables succesfully created.
Install presence related tables? (y/n): y
INFO: creating presence tables./opensipsctl stop into opensips ...
INFO: Presence tables succesfully created.
Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist? (y/n): y
INFO: creating extra tables into opensips ...
INFO: Extra tables succesfully created.
./opensipsctl stop
./opensipsctl start
INFO: Starting OpenSIPS :
ERROR: PID file /var/run/opensips.pid does not exist -- OpenSIPS start failed
改成:sudo opensipsctl start
INFO: Starting OpenSIPS :
INFO: started (pid: 23835)
OK.
接下来就是添加用户,例如:用户1001,密码1001
/usr/local/opensips/sbin/opensipsctl add 1001 1001
/usr/local/opensips/sbin/opensipsctl add 1002 1002
查看在线用户:
/usr/local/opensips/sbin/opensipsctl online
删除或修改用户
/usr/local/opensips/sbin/opensipsctl rm
/usr/local/opensips/sbin/opensipsctl passwd