Skip to main content

OpenSIPS

Installation

Debian 10

OpenSIPS 3.3

apt install gnupg2
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 049AD65B
echo "deb https://apt.opensips.org buster 3.3-releases" >/etc/apt/sources.list.d/opensips.list
echo "deb https://apt.opensips.org buster cli-nightly" >/etc/apt/sources.list.d/opensips-cli.list
apt update
apt install opensips
apt install opensips-cli

# Install all other modules
apt install opensips-*

# Start opensips and check the status
systemctl start opensips
systemctl status opensips

OpenSIPS Database Support (MySQL)

# Install MySQL Server (MariaDB on Debian 10)
apt install mariadb-server

# Create the database opensips using the OpenSIPS command line interface
opensips-cli -x database create opensips

# Verify if the tables were created
mysql opensips -e "show tables"

# Set the root's password for MariaDB and complete a few secure steps.
mysql_secure_installationMariaDB> alter user 'root'@'localhost' identified by 'newpassword';
MariaDB> flush privileges;
MariaDB> exit

OpenSIPS Control Panel 9.3.3


Configuration

OpenSIPS

/etc/opensips/opensips.cfg

/* For AWS and OpenStack Environment */
/* WAN IP: 123.123.123.123 */
/* LAN IP: 172.16.0.67
advertised_address="123.123.123.123"
alias="123.123.123.123"

socket=udp:172.16.0.67:5060
socket=tcp:172.16.0.67:5060

...
...

loadmodule "rtpproxy.so"
## Fixed for ERROR:rtpproxy:send_rtpp_command: proxy <udp:localhost:7890> does not respond, disable it
#modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:7890")
modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")


RTPProxy

/etc/default/rtpproxy

## Replace with your network interface IP address
## If you have WAN IP & LAN IP as follows, here is LAN IP.
## WAN IP: 123.123.123.123
## LAN IP: 172.16.0.67
LISTEN_ADDR=172.16.0.67

# The control socket.
CONTROL_SOCK="unix:/var/run/rtpproxy.sock"
# To listen on an UDP socket, uncomment this line:
# CONTROL_SOCK=udp:127.0.0.1:7890

## If the rtpproxy is behind a NAT firewall. The WAN IP is configured by the -A option.
## NOTE: The option "-A" is supported on RTPProxy newer version only.
#EXTRA_OPTS="-l $LISTEN_ADDR -m 10000 -M 20000"
EXTRA_OPTS="-l $LISTEN_ADDR -m 10000 -M 20000 -A 123.123.123.123"

OpenSIPS CLI

# opensips-cli -x mi version
{
    "Server": "OpenSIPS (3.1.14 (x86_64/linux))"
}

Dispatcher

CGRateS