Installing mediaproxy-ng

This is a small guide on how to install mediaproxy-ng from sources on RPM based systems like CentOS.

Naming convention

All these “ng” stuff are really confusing and sometimes it’s hard to distinguish the pieces among them.

  • rtpproxy: it’s a media relaying software for RTP packets. It runs as a service and needs to be controlled and instructed using it’s own protocol.
  • rtpproxy module: it’s the Kamailio module that controls the rtpproxy service, from the configuration scripts.
  • rtpproxy-ng module: it’s the next generation (ng) module for Kamailio, based on the rtpproxy module. It serves as a replacement for that old module on newer systems.
  • mediaproxy: it’s another media relaying software, similar to rtpproxy, but older.
  • mediaproxy-ng: despite of its name, it is not the next-generation mediaproxy, but instead, the next generation of the rtpproxy (the service, not the module). From Kamailio, it can be controlled from both the rtpproxy and the rtpproxy-ng modules.

Before you begin: I’m using a x86 virtual machine. This means that you have to change the package names from i686 to x86_64 when necessary.

1. Kernel upgrade: you may not need to do this, so I recommend skipping this step unless you end up with an error like “undefined symbol” when trying to load the kernel module in the last step. In my particular case, I had to do it with my CentOS 6.0 VM.

yum upgrade kernel -y && reboot

2. Install development tools: several tools are needed to perform this step. Instead of manually listing them one by one, I would rather save some typing time by just installing the whole package 😉

yum groupinstall 'Development Tools'

3. Download the sources: from github

git clone https://github.com/sipwise/mediaproxy-ng.git

4. Install kernel development headers: this is going to be a kernel module, we need them.

yum install kernel-devel-$(uname -r)

5. A few other dependencies

yum install glib2-devel.i686 pcre-devel.i686 libcurl-devel.i686 libcurl.i686 xmlrpc-c.i686 zlib-devel.i686 iptables-devel.i686

6. Install mediaproxy-ng

cd /usr/src/mediaproxy-ng/daemon
make

7. Copy the resulting binary to the PATH: the Makefile doesn’t provide a rule for installing the binary.

cp mediaproxy-ng /usr/bin/

8. Compile and install the iptables extension

cd ../iptables-extension
make
cp libxt_MEDIAPROXY.so /lib/xtables/

9. Compile and install the kernel module

cd ../kernel-module/
make
cp xt_MEDIAPROXY.ko /lib/modules/$(uname -r)/updates/
depmod -a
modprobe xt_MEDIAPROXY

10. Finally, if everything went fine, you should be able to see something like this:

# lsmod | grep -i mediaproxy
xt_MEDIAPROXY 16512 0
ipv6 264702 39 xt_MEDIAPROXY,ip6t_REJECT,nf_conntrack_ipv6

Click to Call application using webrtc2sip + asterisk

I’ve been working on this for the last few days and I pleased to say that I managed to get through the series of problems that the learning curve entails and now the app is finally working.

My intention was to learn the fundamentals of webRTC and SIP over websockets and I haven’t found a better solution than the one offered by Doubango Telecom. Their impressive job is transforming the way we communicate and I want to be part of that transformation when it finally hit the “standard technology” label.

The purpose of the application is to demonstrate a new way of doing a click to call service. There are a variety of similar solutions with different approaches being the Java applet the most commonly used amongst them.

Well, although this app doesn’t bring any new thing into the world, it certainly serves the purpose of demonstrating a new way of making things. It’s entirely made using HTML5 with the javascript library that made SIPML5 possible.

The app connects to my lab’s Asterisk, via webrtc2sip which deals with the SIP over WS on one side, and SIP over UDP in the other part. The media is also handled by webrtc2sip by translating the SDP profiles and making transcoding on demand.

You can try it here. It is necessary the latest version of Chrome stable or Firefox Nightly. If you don’t meet the minimum needs, the page will just stay there doing nothing. In case you get an error message it’s probably because my server crashed. Please let me know if that happen.

You can browse the javascript code to see how simple it is. I’m planning to turn the project into something more elaborated and then publish the code. By now, it’s too simple to bother 😉

UPDATE:

For some reason, behind very restrictive firewalls the audio is not working properly. I’m working on this to fix it ASAP. Please let me know if that’s your case.

UPDATE 2:

I temporarily deactivated the demo because my server suffered large amounts of hacking attempts. I knew this was possible but I wasn’t expecting this volume.