RTPProxy is a software proxy delivering high-performance control to any kind of VoIP network infrastructure. RTPProxy enables the following services in a VoIP network.
  1. VoIP calls to traverse NAT firewalls systems
  2. Packet flow optimization
  3. Relaying of voice, video or any RTP stream of data
  4. Playing of pre-encoded in-band announcements
  5. Re-framing of RTP payload
  6. Routing VoIP to VPN links routing
  7. Real-time stream copying

Install RTPProxy on CentOS 7.x using steps provided below:

  1. Change directory to /usr/src.

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20~%5D%23%20cd%20%2Fusr%2Fsrc%2F%0A”/]

  1. Clone rtpproxy source from github.

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20src%5D%23%20git%20clone%20https%3A%2F%2Fgithub.com%2Fsippy%2Frtpproxy.git%0ACloning%20into%20’rtpproxy’…%0Aremote%3A%20Counting%20objects%3A%208581%2C%20done.%0Aremote%3A%20Total%208581%20(delta%200)%2C%20reused%200%20(delta%200)%2C%20pack-reused%208581%0AReceiving%20objects%3A%20100%25%20(8581%2F8581)%2C%203.82%20MiB%20%7C%20561.00%20KiB%2Fs%2C%20done.%0AResolving%20deltas%3A%20100%25%20(6205%2F6205)%2C%20done.%0A%5Broot%40kamailio-cloud%20src%5D%23″/]

  1. cd into rtpproxy source tree.

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20src%5D%23%20cd%20rtpproxy%2F%0A”/]

4.Configure the source tree for installing rtpproxy

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20.%2Fconfigure%0A”/]

  1. Compile rtpproxy

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20make%0A”/]

  1. Install Rtpproxy

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20make%20install%0A”/]

  1. Copy init.d script to /etc/rc.d/init.d directory.

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20cp%20rpm%2Frtpproxy.init%20%2Fetc%2Frc.d%2Finit.d%2Frtpproxy%0A”/]

  1. Make the file executable

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20chmod%20%2Bx%20%2Fetc%2Frc.d%2Finit.d%2Frtpproxy%0A”/]

  1. Add a user that will run the program. I will add user called rtpproxy and group called rtpproxy:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”root%40kamailio-cloud%20rtpproxy%5D%23%20mkdir%20-p%20%2Fvar%2Frun%2Frtpproxy%0Aroot%40kamailio-cloud%20rtpproxy%5D%23%20groupadd%20-g%208002%20rtpproxy%0Aroot%40kamailio-cloud%20rtpproxy%5D%23%20useradd%20-u%208002%20-g%208002%20-d%20%2Fvar%2Frun%2Frtpproxy%20-M%20-s%20%2Fbin%2Ffalse%20%20rtpproxy%0Aroot%40kamailio-cloud%20rtpproxy%5D%23%20chown%20rtpproxy%3Artpproxy%20-R%20%2Fvar%2Frun%2Frtpproxy%2F”/]

  1. Check the location of rtpproxy executable file

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”root%40kamailio-cloud%20rtpproxy%5D%23%20which%20rtpproxy”/]

  1. Change rtpproxy=/usr/bin/rtpproxy to /usr/local/bin/rtpproxy, pidfile in /etc/rc.d/init.d/rtpproxy file

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20nano%20%2Fetc%2Frc.d%2Finit.d%2Frtpproxy%0A”/]

Sample output is as shown:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%23%20Source%20function%20library.%0A.%20%2Fetc%2Frc.d%2Finit.d%2Ffunctionsopy%0Aprog%3Drtpproxy%0Artpproxy%3D%2Fusr%2Flocal%2Fbin%2F%24prog%0Auser%3Drtpproxy%0Alockfile%3D%2Fvar%2Flock%2Fsubsys%2F%24prog%0Apidfile%3D%2Fvar%2Frun%2F%24prog.pid”/]

  1. You can include Additional Options like:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”OPTIONS%3D%22%20-l%20192.168.1.60%20-s%20unix%3A%2Fvar%2Frun%2Frtpproxy.sock%22%0A”/]

Rtpproxy will listen on ip: 192.168.1.60 , control socket being unix:/var/run/rtpproxy.sock.
To make it listen on an UDP socket, add option:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”CONTROL_SOCK%3Dudp%3A127.0.0.1%3A7722%0A”/]

12 Reload and start rtpproxy

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20systemctl%20daemon-reload%20%0A%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20%2Fetc%2Finit.d%2Frtpproxy%20start”/]

  1. To set to run at startup, type:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual” manual=”%5Broot%40kamailio-cloud%20rtpproxy%5D%23%20chkconfig%20rtpproxy%20on%0A”/]

You are done with the installation. In case of any error, alert us via comment section.