VoIP Cookbook: Compile OpenSIPS

From OnnoWiki
Jump to navigation Jump to search

Prepare the supporting software. In Ubuntu 9.10, it can be prepared by using the following command.

# apt-get install flex bison gcc make libperl5.10 libperl-dev libxmlrpc-c3 libxmlrpc-c3-dev \
unixodbc unixodbc-dev libradiusclient-ng2 libradiusclient-ng-dev libxml2 openssl libsctp1 \
libsctp-dev libexpat1 libexpat1-dev libldap-2.4-2 libldap2-dev libsnmp15 libsnmp-dev \
libconfuse0 libconfuse-dev libmysqlclient15off libmysqlclient15-dev mysql-client-5.1 \
mysql-server zlib1g zlib1g-dev libmysql++3 libmysql++-dev

Get source code of OpenSIPS, such as, opensips-XXX-tls_src.tar.gz ,from

http://opensips.org/pub/opensips/
http://www.opensips.org/index.php?n=Resources.Downloads#osippub
http://www.opensips.org/index.php?n=Resources.Downloads#osipsf

If we would like to use opensips with TLS, we need to do the followings.

$ sudo su -
# cp opensips-1.6.1-tls_src.tar.gz /usr/local/src/
# cd /usr/local/src/
# tar zxvf opensips-1.6.1-tls_src.tar.gz
# cd opensips-1.6.1-tls

Compile and install the following modules, i.e., "acc", "mysql", "textops", "sl", "db_mysql" and "enum" using the following command,

# cd opensips-1.6.1-tls
# make all && make include_modules="acc mysql textops sl enum db_mysql" modules
# make install

It seems, we need to copy some scripts to /usr/local/src/opensips/opensipsctl

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

That's it. OpenSIPS is compiled and install and ready to use. OpenSIPS configuration file is located at

/usr/local/etc/opensips

Check for any problem in the configuration file can be done using the following command,

# opensips -c -f /usr/local/etc/opensips/opensips.cfg

See Also