OpenSIPS-CP is a Web Control Panel Application for OpenSIPS SIP server and users provisioning. It has the new graphical user interface for the SIP proxy. It was designed to be the primary tool to provision parameters for the OpenSIPS modules in the database. OpenSIPS-CP is developed using PHP that is usual for the VoIP providers to develop their own interface with the end users.
In this article we will show you the step-by-step instructions to install OpenSIPS-CP on Ubuntu 15 using the LAMP (Linux Apache MySQL PHP) stack.
Step 1: LAMP Setup
Login to your Ubuntu 15 server and prepare it for installation of LAMP Stack packages. So, our first step is to install the required packages including Apache2, MySQL and PHP with its required dependencies. Let's run the following command using your root user to install Apache2, PHP and its required modules.
# apt-get install apache2 php5 php5-cli php5-mysql php5-xmlrpc php-pear php-mdb2-driver-mysql php-log
You will be asked to type your desired as 'Y' to continue and 'n' to skip. So, Once you type in the 'Y' your installation of packages will starts.
Install the MySQL database server if you do not have it already installed on your system. Just run the following command and the configure your root password when asked during the installation.
# apt-get instal mysql-server
Once your installation is complete for the Apach2 and MySQL and make sure to restart its services and confirm its status that both services should be running and enabled to start at Boot.
# systemctl restart mysql
# systemctl restart apache2
# systemctl status mysql
# systemctl status apache2
Step 2: Download opensips-CP
Follow the link to Download the OpenSIPS-CP Package from here.
You can also download its package using the 'wget' command if its install on your system following by the link to download the OpenSIP-CP package.
[email protected]:~# cd /usr/src/opensips-2.1.2/
# wget -c "http://downloads.sourceforge.net/project/opensips-cp/opensips-cp/6.1/opensips-cp_6.1.tgz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopensips-cp%2Ffiles%2Fopensips-cp%2F5.0%2F&ts=1371700243&use_mirror=nchc" -O opensips-cp_6.1.tgz
Now you have successfully downloaded OpenSIPS-CP package, run the following command to extract within the same directory using the following command.
# tar -zxf opensips-cp_6.1.tgz
Step 3: Apache Web Configurations
Now we need to move web configurations into their particular directories and assign them the right ownerships.
To do so run the following commands accordingly.
# mkdir -p /var/www/cp
# cp -rR web config /var/www/cp/
# chown www-data:www-data -R /var/www/cp
Now add the configuration below into one of Apache's existent VHOSTs or create a new one, but we are going to use the default configuration to put the following code at the end of its configuration file using the 'vim' editor.
# vim /etc/apache2/apache2.conf
Options Indexes FollowSymLinks MultiViews
allow from all
Options Indexes FollowSymLinks MultiViews
deny from all
Alias /cp /var/www/cp/web
Save and quit the file using ':wq!' .
Step 4: MySQL Database Configurations
In this step we are going to Setup a new database for opensips-cp using the MySQL server and import the opensips-cp schema.
# mysql -u root -p
mysql> create database opensips character set utf8;
Change your directory to move into the opensips directory.
[email protected]:~# cd /usr/src/opensips-2.1.2/6.1
[email protected]:/usr/src/opensips-2.1.2/6.1# ls config/tools/admin/add_admin/
[email protected]:/usr/src/opensips-2.1.2/6.1# mysql -uroot -p opensips < config/tools/admin/add_admin/ocp_admin_privileges.mysql
# echo "INSERT INTO ocp_admin_privileges (username,password,ha1,available_tools,permissions) values ('admin','admin',md5('admin:admin'),'all','all');" | mysql -uroot -p opensips
Step 5: OpenSIPS-CP Database Connection
Now update 'db.inc.php' to suit your database server setups using your command line editor under the following path as shown in the command.
# vim /var/www/cp/config/db.inc.php
//database driver mysql or pgsql
$config->db_driver = "mysql";
$config->db_host = "localhost";
//database port - leave empty for default
$config->db_port = "";
//database connection user
$config->db_user = "root";
//database connection password
$config->db_pass = "******";
$config->db_name = "opensips";
Save and Close the file and setting up your configurations. By default opensips-cp will save subscriber password in plain text, we have to change this because we don't want th password in plain text format. To do so let's edit 'local.inc.php' and update value of '$config->passwd_mode' from 0 to 1. Value 1 will make opensips-cp calculate hash ha1 and ha1b, and save it in database as shown.
# vim /var/www/cp/config/tools/users/user_management/local.inc.php
//Password can be saved in plain text mode by setting $config->passwd_mode to 0 or chyphered mode, by setting it to 1
Few more configurations are stored in every 'inc' files in '/var/www/cp/config' directory and its sub-directories. Here the configuration of 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. So, you might need to edit 'boxes.global.inc.php' to suit our server installations.
# vim /var/www/cp/config/boxes.global.inc.php
Step 6: Access OpnSIP Web CP
When you have active state of both web and database services, then we are good to go on the browser to flow the following link to login by using the default user name and password that is 'admin' 'admin'.
Upon successful credentials you will be directed towards the OpenSIPs Control panel where you can start exploring its features choosing the options from the drop menu under the 'Admin', 'Users' and 'System' tabs.
In this article you have learned the installation of OpenSIPS Web control Panel using the LAMP stack on Ubuntu 15 server. Let's start using it as per your needs and explore its awesome features using OpenSIPS CP graphical user interface. So, this will guide you through the process of doing a quick installation of OpenSIPS and OpenSIPS Control Panel, and will show you what you have to do in order to get a fully functional platform with reference to our previous article on How to Install OpenSIPS Server on Ubuntu 15.04. Thank you for reading will back to you with more interested articles.