Before going ahead with opensips installation, update the system to use the latest packages.
yum update
This will download all the latest versions of the installed components.
Once done, start with opensips dependencies installation.
- yum install bison
- yum install libxml2-devel
- yum install gcc-c++
- xmlrpc installation:
- download xmlrpc-c-1.06.41
- untar sources and run
- ./configure –disable-abyss-threads
- make
- make install
- go to /etc/ld.so.conf.d
-
create a file xmlrpc.conf and write one line:
- /usr/local/lib
- save and exit
- run ldconfig
All the prerequisites are installed.
Now start with compilation of opensips
- cd /usr/local/src/opensips-src
- make all
- make modules=modules/db_mysql modules
- make modules=modules/presence modules
- make modules=modules/mi_xmlrpc modules
- make install
This will install only the default modules in the right directories
copy the .so files from each additional module (mentioned above) directory to /usr/loca/lib/opensips/modules/
Now copy the startup script for start/stop/restart of opensips
- cp /usr/local/src/opensips-1.6.4-2-notls/packaging/rpm/opensips.init /etc/init.d/opensips
- chmod 777 /etc/init.d/opensips
- cp /usr/local/src/opensips-1.6.4-2-notls/scripts/opensipsdbctl.mysql /usr/local/lib/opensips/opensipsdbctl/opensipsdbctl.mysql
Opensips needs an user account for running the service.
- useradd opensips
Open init script in /etc/init.d/opensips
Change all the references of config files to point to /usr/local/etc
Copy the opensips.cfg file to the location: /usr/local/etc/opensips/opensips.cfg
Create file /etc/default/opensips and put the below contents in the file:
RUN_OPENSIPS=yes
USER=opensips
GROUP=opensips
MEMORY=128
Open file /usr/local/etc/opensips/opensipsctlrc
Change all the usernames and passwords in opensipsctlrc for cluster, configure database IP as cluster virtual IP instead of localhost
Starting opensips:
run the following command:
/etc/init.d/opensips start
Stopping opensips:
run the following command:
/etc/init.d/opensips stop