VoIP Cookbook: Prepare User Database Server in OpenSIPS

From OnnoWiki
Jump to navigation Jump to search

OpenSIPS uses database server, such as, MySQL for handling user registration. Install MySQL Server and make sure it works using the following command,

# apt-get install mysql-server libmysqlclient15-dev mysql-client-5.0
# /etc/init.d/mysql restart 

To setup the database server, we need to edit /usr/local/etc/opensips/opensipsctlrc or /etc/opensips/opensipsctlrc, such as,

# vi /usr/local/etc/opensips/opensipsctlrc 

or

 vi /etc/opensips/opensipsctlrc 

Make sure,

BENGINE=MYSQL
BHOST=localhost
BNAME=opensips
BRWUSER=opensips
BROUSER=opensipsro
BROPW=opensipsro
BROOTUSER="root"

Copy scripts to /usr/local/lib/opensips/opensipsctl

# cp -Rf /usr/local/src/opensips-1.6.1-tls/scripts/* /usr/local/lib/opensips/opensipsctl/

Initialized the user database using opensipsdbctl command as follow,

# cd /usr/local/lib/opensips/opensipsctl
# opensipsdbctl create

Follow the following commad

MySQL password for root:  <enter MySQL root password>
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 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.

See Also