OpenSIPS-CP Installation & Configuration



Installation and Configuration Steps:

Apache must be Installed and Configured:

# yum install httpd

Run it :

# systemctl start httpd

Then be sure it is running: # ps aux |grep http or # netstat -lpn |grep http

Go to and get the source:

# cd /var/www

# svn checkout svn:// opensips-cp

Install PHP and some extensions: Here i have Fedora Red Hat:

 #  yum install php php-common php-gd php-mysql php-xmlrpc php-pear

Install Mysql Driver

# pear install mdb2#mysql

Check if the Extensions are Installed Correctly:

For Redhat check “mysql.ini”/”mysqlnd.ini”, “gd.ini”, “xmlrpc.ini” in “/etc/php.d/”.

Enable short_open_tag in “/etc/php.ini”:

 short_open_tag = On

Configure OpenSIPS-CP’s Database Connection:

# cd /var/www/opensips-cp

# vi config/

Configure OpenSIPS-CP Boxes:

The configuration of these boxes determines how the OpenSIPS-CP will communicate with OpenSIPS. For example you can configure Mi box to access the OpenSIPS Mi interface. This can be through RPC protocol, FIFO, UDP, or JSON.

 # vi config/

Part of this file:

            // options: fifo:/path/to/fifo_file | xmlrpc:host:port | udp:host:port | json:json_url


This file “/tmp/opensips_fifo” is configured  in OpenSIPS’s configuration file in the FIFO module section:

            #### FIFO Management Interface

            loadmodule “”

            modparam(“mi_fifo”, “fifo_name”, “/tmp/opensips_fifo”)

            modparam(“mi_fifo”, “fifo_mode”, 0666)

This file is created by OpenSIPS. so the access permission to this file is determined by OpenSIPS. “0666” is the (read&write for all ) permission to the fifo file.

Note: The global  file “/var/www/opensips-cp/config/” is important but also the local file for each module is important. For example: the file “/var/www/opensips-cp/config/tools/system/dialog/” contains some options  for “dialog” module.

If you have any problem related to accessing the fifo file please click here.

Now OpenSIPS-CP can access the opensips database and can communicate with opensips through Mi interface.

OpenSIPS-CP needs an extra table as an addition to OpenSIPS’s Database. We need to push it in the opensips database. Install the “ocp_admin_privileges” table schema.

# cd /var/www/opensips-cp

# mysql -Dopensips -p < config/tools/admin/add_admin/ocp_admin_privileges.mysql

Create Admin Account with all Privileges:

You will use this account from the opensips-cp web interface. I will add the user admin with password admin withh full permission:

Login to the Database as Root

         # mysql -uroot -p

Mysql> use opensips;

Mysql> INSERT INTO ocp_admin_privileges (username,password,ha1,available_tools,permissions) values (‘admin’,’admin’,md5(‘admin:admin’),’all’,’all’);

Configure Apache:

# vi /etc/httpd/conf/httpd.conf

Add the following:

<Directory /var/www/opensips-cp>

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all denied


<Directory  /var/www/opensips-cp/web>

Options Indexes FollowSymLinks MultiViews

AllowOverride None
Require all granted


Alias /cp /var/www/opensips-cp/web

Restart Apache:

# systemctl restart httpd

Make apache, the owner of opensips-cp folder:

# chown -R apache:apache /var/www/opensips-cp/

Open the browser and go to OpenSIPS-CP main page: http://localhost/cp

 snapshot6Login by username:admin and password:admin


Go a head and explore it.

More Information


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s