Posts Tagged ‘Install OpenSIPS on Debian or Ubuntu’

This is long time draft before being published,,,,

You may known that OpenSIPS is the project continuation of OpenSER, tough Kamailio is said to be closer to OpenSER. But after all, it’s all about taste,,lol 😀

OpenSIPS will be best deployed on Sun machine running Solaris OS to obtain it’s best performance. But installing on Debian or Ubuntu machine will much easier. OpenSIPS modules depend on various package which is hard to get for Solaris. Debian or Ubuntu will be the best OS for installing practice. To get familiar with OpenSIPS, you’ll may need to practice installing too :D.

OpenSIPS is recommended to install with DNS. So that you wouldn’t have a lot of changes to move the system from a machine to another. These steps I’ve used to build a presence system server with TLS enabled. If you don’t need any presence enabled, you may leave mi_xmlrpc, xcap_client, presence, presence_xml, presence_mwi, presence_dialoginfo, pua, pua_bla, pua_mi, pua_usrloc, pua_xmpp,  pua_dialoginfo, and TLS=1 commented.
It’s hard to find a good OpenSIPS installation tutorial, so I try to write these steps which is work for me. Hopefully these steps will help you much 😀

1. sudo apt-get install bison bison++ bisonc++
2. sudo apt-get install flex
3. sudo apt-get install libsctp1
4. sudo apt-get install mysql-server
5. sudo apt-get install libmysqlclient-dev
6. sudo apt-get install libxml2-dev
7. sudo apt-get install libexpat1-dev
8. sudo apt-get install libradius-ng2 libradius-ng-dev
9. sudo apt-get install libcurl3-dev
10. sudo apt-get install libxmlrpc-c3 libxmlrpc-c3-dev
11. sudo apt-get install libperl-dev
12. sudo apt-get install libsnmp-dev
13. sudo apt-get install libconfuse0 libconfuse-dev
14. sudo apt-get install build-essential
15. sudo tar xvfz opensips-1.5.0-tls_src.tar.gz
16. edit opensips-1.5.0-tls/Makefile/
change : #TLS=1
to : TLS=1
remove : – jabber
– cpl-c
– xmpp
– rls
– mi_xmlrpc
– xcap_client
– db_mysql
– presence
– presence_xml
– presence_mwi
– presence_dialoginfo
– pua
– pua_bla
– pua_mi
– pua_usrloc
– pua_xmpp
– pua_dialoginfo
– perl
– snmpstats
– peering
– carrierroute
from : exclude_modules=
17. sudo make
18. sudo make install
19. sudo cp opensips-1.5.0-tls/packaging/debian-etch/opensips.default /etc/default/opensips
sudo cp opensips-1.5.0-tls/packaging/debian-etch/opensips.init /etc/init.d/opensips
20. sudo nano /etc/default/opensips
change : RUN_OPENSIPS=no
to : RUN_OPENSIPS=yes
21. sudo nano /etc/init.d/opensips
change : DAEMON=/usr/sbin/opensips
RUN_OPENSIPS=no
to : DAEMON=/usr/local/sbin/opensips
RUN_OPENSIPS=yes
22. sudo chmod +x /etc/init.d/opensips
23. sudo groupadd opensips
sudo useradd -g opensips opensips
24. sudo mkdir /var/run/opensips
sudo chmod 777 /var/run/opensips
25. sudo chmod 777 /usr/local/etc/opensips/
26. sudo apt-get install bind9
27. sudo nano /etc/bind9/named.conf
add : zone “opensips.org” {
type master;
file “/etc/bind/db.opensips”;
};

zone “18.14.10.in-addr.arpa” {
type master;
file “/etc/bind/db.18.14.10″;
};
28. Create new RR file

sudo nano /etc/bind9/db.opensips
write :

;
; BIND data file for opensips.org
;
$TTL 604800
@ IN SOA opensips.org. root.opensips.org. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS opensips.org.
opensips.org. IN A 10.14.18.56
29.  Create new RR file

sudo nano /etc/bind9/db.18.14.10
add :

;
; BIND data file for opensips.org
;
$TTL 604800
@ IN SOA opensips.org. root.opensips.org. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS opensips.org.
opensips.org. IN A 10.14.18.56
30. sudo nano /etc/bind9/named.conf.option
add : recursion no;
in : option { }
31. sudo /etc/init.d/bind9 restart
32. sudo nano /usr/local/etc/opensips/opensipsctlrc
uncomment : # SIP_DOMAIN=opensips.org
# DBENGINE=MYSQL
# DBHOST=localhost
# DBNAME=opensips
# DBRWUSER=opensips
# DBRWPW=”opensipsrw”
# DBROUSER=opensipsro
# DBROPW=opensipsro
# DBROOTUSER=”root”
# USERCOL=”username”
# INSTALL_EXTRA_TABLES=ask
# INSTALL_PRESENCE_TABLES=ask
uncomment and change :
# PID_FILE=/var/run/opensips.pid
to : PID_FILE=/var/run/opensips/opensips.pid
33. sudo mysqladmin -u root password ‘root’
34. sudo opensipsdbctl create
35. sudo nano /usr/local/etc/opensips/opensips.cfg
uncomment : #loadmodule “db_mysql.so”
#loadmodule “auth.so”
#loadmodule “auth_db.so”

#modparam(“usrloc”, “db_mode”, 2)
#modparam(“usrloc”, “db_url”,
# “mysql://opensips:opensipsrw@localhost/opensips”)

#modparam(“auth_db”, “calculate_ha1”, yes)
#modparam(“auth_db”, “password_column”, “password”)
#modparam(“auth_db”, “db_url”,
# “mysql://opensips:opensipsrw@localhost/opensips”)

comment : modparam(“usrloc”, “db_mode”, 0)
36. sudo nano mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON *.* TO opensips@localhost IDENTIFIED BY ‘opensipsrw’;
mysql> GRANT ALL PRIVILEGES ON *.* TO opensips@127.0.0.1 IDENTIFIED BY ‘opensipsrw’;
37. start opensips, choose one of these method:
1. sudo opensipsctl start
2. sudo /etc/init.d/opensips start
38. sudo opensipsctl add 1001 1001

You can use any kind of SIP client you have. These install will be default enable your SIP chat.

Comment me if you have any error on installation. Feel free to try 😀