Opensips Implementation on Ubuntu 18.04

 

Theory

 

 

Load Balancing in OpenSIPS

 

·       The "load-balancing" module comes to provide traffic routing based on load. Shortly, when OpenSIPS routes call to a set of destinations, it is able to keep the load status (as number of ongoing calls) of each destination and to choose to route to the less loaded destination (at that moment)

 

·       OpenSIPS is aware of the capacity of each destination - it is preconfigured with the maximum load accepted by the destinations.

 

 

·       OpenSIPS will consider the less loaded destination not the destination with the smallest number of ongoing calls, but the destination with the largest available slot.

 

·       Also, the "load-balancing" (LB) module is able to receive feedback from the destinations (if they are capable of). This mechanism is used for notifying OpenSIPS when the maximum capacity of a destination changed (like a GW with more or less E1 cards)

 

·       The "load-balancing" functionality comes to enhance the "dispatcher" one. The difference comes in having or not load information about the destinations where you are routing to:

o   The dispatcher has no load information - it just blindly forwards calls to the destinations based on a probabilistic dispersion logic. It gets no feedback about the load of the destination (like how many calls that were sent actually were established or how many are still going).

o   Load-balancer is load driven - LB routing logic is based primarily on the load information. The LB module is using the DIALOG module in order to keep track of the load (ongoing calls).


Software Implementation Guide

 

Add the below line to /etc/apt/sources.list

·       deb http://apt.opensips.org bionic 2.3-releases

save and exit

·       sudo apt update

·       sudo apt install opensips

·       Check opensips version by,  

·       opensips -V

Install the Pgsql module to opensips.

https://zoomadmin.com/HowToInstall/UbuntuPackage/opensips-postgres-module

                sudo apt-get update -y

                sudo apt-get install -y opensips-postgres-module


      go to /etc/opensips 

      edit the file vim opensipsctlrc




   For the DBHOST you have to edit the IP address to pgadmin virtual IP

·       To find the virtual IP for the pg go to the pg master server and type ipaddr.

                


       

·       The highlighted area on the screenshot is the virtual IP of the pg.

       

                You have to add the opensips user for in the pg master server.

                Log in to the pg master server.

                Go to cd /etc/postgresql/9.6

                vim pg_hba.conf

       


      

·       u have to add

      host           all        opensips          0.0.0.0/0          md5

                 

·       To create the tables go to the opensips server and type

o   opensipsdbctl create opensips

o   if you log in to the pgadmin u will see opensips database and tables are created.

·       Now you have to configure the opensips cf file.

o   Go to cd /etc/opensips put the opensip.conf .

o   vim opensips.cfg

                


  •                 log_level=4
  •                 log_stderror=no
  •                 log_name="opensips"
  •                 log_facility=LOG_LOCAL0
  •                 children=2

                


                 

  •                 listen=udp:127.0.0.1:5060
  •                 #local host

                 

  •                 #listen=udp:10.0.0.3:5060   # CUSTOMIZE ME

                 

  •                 listen=udp:192.168.3.196:5060
  •                 listen=udp:192.168.3.196:5080
  •                 #type the opensiplb1 ip address

                 

                 

  •                 #listen=udp:192.168.49.130:5060
  •                 #listen=udp:192.168.49.130:5080
  •                 #type the opensip_vip address


·       you have to uncommon the required modules but if you use the opensips.conf file which is uploaded into the support hub this step is not required.

                 

                


 

·       type the pg database virtual IP and the URL to the below sections.

                 

                


 

                


 

 

·       type the FreeSWITCH IP address in the below section.

                 

                


                 

                 

·       type the truck IP address

   


·       restart the opensips

o   service opensips restart






Comments

Popular posts from this blog

AWS Global infrastructure.

AWS Private Virtual Cloud