Mysql installation

Operating system version: I tried on CentOS8, limited to mysql version, every time yum install directly to mysql8.0, also did not take the tar package directly to install mysql, so directly use CentOS7

Mysql version: mysql5.6 needs to be installed, mysql8.0 has been tried, opensips user failed to build the library because of the syntax of changing the password for user

Environment preinstalled software, a few commands can be done:

yum install mysql yum install mysql-server yum install mysql-devel yum install gcc gcc-c++ yum install ncurses-devel yum  install flex yum install bisonCopy the code

If you cannot find the mysql installation package, you can use the following methods to install mysql:

  1. Check whether there has been a mysql: RPM – qa | grep mysql
  2. Version does not conform to requirements is uninstalled, unload command: RPM – qa | grep mysql | xargs RPM -e — nodeps

Mysql set password and enable remote access

  1. Install mysql to start by default, there is no password, enter mysql to run the following code
// Set the passwordset password for 'root'@'localhost' =password('123456'); Grant all PRIVILEGES on *.* to root@The '%'identified by '123456'; // Update privileges flush PRIVILEGES;Copy the code
  1. Enable firewall port 5060
firewall-cmd --zone=public --add-port=5060/udp --permanent
firewall-cmd --reload
Copy the code

OpenSIPs installation and use

  1. Download the source package (version 2.4 below, version 3.0 after I compiled it found some binaries are missing)
git clonehttps://github.com/OpenSIPS/opensips.git - 2.4 opensips 2.4 bCopy the code
  1. Decompress, compile, install
The tar ZXVF - opensips - 2.4.7. Tar. GzcdOpensips - 2.4.7 make menuconfigCopy the code

  1. Directory for configuration files and binary files
  2. Modifying a Configuration File
    • opensips.cfg
      • Listen = udp: 192.168.190.142:5060 # CUSTOMIZE ME
    • opensipsctlrc
# The OpenSIPS configuration file for the control tools.
#
# Here you can set variables used in the opensipsctl and opensipsdbctl setup
# scripts. Per default all variables here are commented out, the control tools
# will use their internal default values.

## your SIP domainSIP_DOMAIN = 192.168.190.142## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"

## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE
## by default none is loaded
# If you want to setup a database with opensipsdbctl, you must at least specify
# this parameter.
DBENGINE=MYSQL

## database port (PostgreSQL=5432 default; MYSQL=3306 default)
DBPORT=3306

## database host
DBHOST=localhost

## database name (for ORACLE this is TNS name)
DBNAME=opensips

# database path used by dbtext, db_berkeley, or sqlite
DB_PATH="/usr/local/etc/opensips/dbtext"

## database read/write user
DBRWUSER=opensips

## password for database read/write user
DBRWPW="opensipsrw"

## engine type for the MySQL/MariaDB tabels (default InnoDB)
MYSQL_ENGINE="MyISAM"

## database super user (for ORACLE this is 'scheme-creator' user)
DBROOTUSER="root"
Copy the code
  1. Create the OpenSiPS library, foolproof
opensipsdbctl create
Copy the code
  1. Start opensips server
opensipsctl start
Copy the code

Opensipsctl user name password
opensipsctl add 1001 1001
opensipsctl add 1002 1002
Copy the code
  1. test
  • Found two free software phone: MicroSIP, Zoiper5, configure the user
  • MicroSIP
  • Zoiper5

  • Phone test:

subsequent

Find out more about OpenSIPS gameplay