Sigapy: a failed attempt to create a product in Paraguay

A little more than a year ago, I created a service which main intention was to provide my fellow Paraguayans living abroad, an easy way to call home using their smartphones. It was not like Viber or Tango app, you could actually call to land lines and mobile phones, and of course between Sigapy users.

There’s no specialized service like this in Paraguay, and I wanted to fill that void with something new and easy to use, and so Sigapy was born. It was conceived as an academical project but soon it started to appear exploitable as a commercial service, but the environment for this kind of business in Paraguay isn’t the best (actually, it’s horrible) and I had to shut it down for my own juridical sake.

Today, I decided someone else can give it a try, because it’s a more or less mature product and can easily be adapted to someone else’s needs.

Check out the videos and the landing page I created. The videos are in Spanish, but the flow can be understood by anyone.



UPDATE: with this project, I won a place in the 4th generation of startups of Wayra Mexico. More updates to come in the future posts :).

NGS, or Next Generation Support, is a project that I created to participate in the TADHack event. It is about improving the user experience we have when we call to customer support, and it takes advantage of the new telco technologies we have today, to create a product that tries to fix a rather common issue which is the bad quality in customer support systems.

What NGS has to offer?

  1. Everyone has a smartphone, and there’s an app for everything, why not for a specialized customer support?
  2. It’s really annoying to navigate through the IVR menus. It’s easier to directly go to the option you want, with a click.
  3. It can be completely free, the only thing you need is an Internet connection.
  4. The customer would be able to call from literally anywhere in the world, using Internet, no toll-free numbers at all.
  5. Call center agents can know exactly who’s calling, where is he located, and what does he want, and with this info a better customer experience can be offered.
  6. The customer can take advantage of the current technology, with HD voice quality, chatting, video calling, screen sharing, etc.
  7. The customer can know exactly who is behind the phone, with a picture, an email, a full name, and he can rate the experience he had with the agent.
  8. In summary, improved customer experience from every angle you can think of.

Opensource communication technologies I used

  1. Kamailio
  2. rptengine: this one belongs to the Kamailio project but deserves special mention because it powers the media relaying. Extremely important
  3. SIPjs
  4. Freeswitch
  5. CSipSimple: compiled in library mode, it allowed me to use PJLIB to create SIP apps for Android.

I posted below, a few screenshots of the software, and I’m planning to add more and release the code during this month.

This is a work in progress. The project has only 3 weeks of being alive, at the time this post was written.

Screenshot_2014-06-05-20-33-52 Screenshot_2014-06-05-20-34-00 Screenshot_2014-06-05-20-34-17 Screenshot_2014-06-05-20-34-21 Screenshot_2014-06-05-20-34-32 Screenshot_2014-06-05-20-34-39 Screenshot_2014-06-05-20-35-59 Screenshot_2014-06-05-20-36-15 Screenshot Screenshot-1



Cnxcc prepaid module: workshop on Kamailio World

This is a short tutorial on how to test the cnxcc module with live traffic and from any softphone. These are the things that you need:

Register from any softphone:
* server:
* username: anything between 5000-9999. Actually anything will work, but I’d rather use those numbering ranges
* password: anything. It is not required
* credit: you will get 1$ credit every time you register. If you place a call and run out of credit, just register again and you will get +1$ on your account.

Place a call: you can actually call to any number with the following pattern: “^09\d{8}$”. This basically means that you can call to a number starting with “09”, that has 8 digits afterwards. Example: 0981223344

You will run out of credit: after a little more than 10 seconds, you will run out of credit and your call will be terminated. Don’t worry, you will receive a SIP MESSAGE on you UA, if it supports it, telling you what just happened.

Recharge your line: if you want more credit, just re-REGISTER from your UA

Check you credit: by texting “credit” to destination “service“, from your UA that supports SIP MESSAGE.

Check the web: you can actually hang up somebody else’s call, or your call, from the web interface. It looks nice and you can log in using “guest” as username and “123456” password.

Call each other: you have the option to call other registered users, but for this, you have to know the number of the other person, or guess it randomly ūüėČ

Duplicated username: you may have chosen the same username that someone else did. If that’s the case, your call will last less than 10 seconds if you call simultaneously, or not even start if someone already exhausted the credit. In the latter case, you will receive a SIP MESSAGE telling you that you have no credit left ;).

These are the files involved in this project. I hope you find them useful.

The demo has no media relay configured, so, you won’t have audio unless you are calling each other on the same network.



WebRTC with Kamailio

I noticed lots of queries about this subject, and I created a Kamailio sample script that could help those who are in trouble when working on this.

This post is planned to be explanatory, with some level of detail, but I don’t really have time nowadays so I’m gonna throw it in its current state, hoping to find the time to do it properly soon enough.

  • This script is configured to run behind NAT, port TCP 10080 and TCP/UDP 5090 are exposed to the Internet
  • You have to create valid users using, preferably, “kamctl add …”
  • RTP ports should be open in range 30k-35k, inclusive
  • I used jssip as webrtc SIP UA:¬†
  • Always disable video before placing a call from jssip UA
  • Always use Chrome. Firefox won’t work, and I’m not sure about other browsers
  • I tested calls between:
    • jssip to csipsimple
    • csipsimple to jssip
    • csipsimple to csipsimple

This is the link to the script

Install mediaproxy-ng on Debian based systems

This is a variation of my original post on how to install mediaproxy-ng on rpm based operating systems.

This one goes for the Debian/Ubuntu users, which are a plenty out there.

1. Clone the repository

2. Install compilation dependencies

3. Go to mediaproxy-ng directory and build the Debian packages

4. Go back to the parent directory. It should contain a series of .deb files. Install them all

5. If everything went OK, a message similar to this should appear on the console:

That is pretty much it, quick and straightforward, maybe because the Sipwise guys love Debian more than any other Linux distribution ūüėČ

Asterisk as a transcoder for Kamailio

Using Asterisk as a SBC or transcoder may not be the right choice, especially if you follow the saying “use the right tool for the job”, and Asterisk is not precisely the right tool on these cases.

When you have options like FreeSwitch and SEMS, Asterisk seems to be disproportional and awkward to use, but it is so widely known that sacrificing flexibility to avoid investing time in learning a new technology (in case you don’t know FS or SEMS already) seems like a good alternative.

Having said that, let’s assume the following rules for our setup:

  • Our local network only accepts G722 codec between users, because, we enforce HD quality calls and we have lots of bandwidth at our disposal.
  • ¬†We offer a local numbering plan and we can call between users of the network.
  • We also offer external calls to PSTN. For this purpose, we have a gateway that supports only PCMA/PCMU and G729. We don’t have the licence to do G729 in all of our softphones reason why we use PCM to reach our gateway from the softphones.
  • Asterisk will act as a transcoder, translating from G722 to PCMA/PCMU and backwards.
  • Asterisk will only take part of the SIP conversation when Kamailio detects that we are dialing to a number that does not belong to our internal numbering plan.

And from the SIP perspective

  • Kamailio is listening on port 5075 and serving on the net, using the IP
  • Asterisk is listening on port 5080.
  • The PSTN gateway is located at
  • Kamailio is accepting every registration request without any kind of authentication.
  • Username format is not being enforced, so I would recommend that you use something similar to 1000, 1100, etc.
  • I’m from Paraguay, and locally we dial “+5959” to access the mobile network. Change this pattern to your dialing prefix so that it makes sense to your gateway.

Basically, the magic on the Kamailio side happens approximately here:


And, on the Asterisk side we have got two things to modify:

  1. sip.conf: we have to add our Kamailio instance as a trusted peer, with no authentication and with the right codec definition
  2. extensions.ael: yes, I use AEL instead of the common extensions.conf, mostly because I hate extensions.conf syntax. If you chose to use .conf, no problem. It should work using whatever you choose.



The full list of files are available on my github, here.

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.

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 ūüėČ

3. Download the sources: from github

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

5. A few other dependencies

6. Install mediaproxy-ng

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

8. Compile and install the iptables extension

9. Compile and install the kernel module

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

VUC: Kamailio

VUC is a very famous conference for VOIP users that is streamed every week on Friday. Today, a great group of Kamailio developers were gathered together for an update regarding the upcoming release of Kamailio 4.1.

For me, it was the first time meeting most of the guys in the conference although I know them through the interactions in the SR-DEV mailing list. It was a great experience indeed.

My participation was mostly related to the cnxcc module that I contributed some months ago, and that will be released along with some other modules for the 4.1 version.

There’s a video of the session that you can watch. The important part of me talking about the module starts here.

After watching it I noticed my pronunciation needs some major improvements (well, my English in general :D), specially with the words ending with consonants. Bear with me please, English is my third language ;).

I leave you with the video link below, in case you want to watch very smart people talking about Kamailio ūüėČ

Kamailio developer

My module just gained acceptation of the Kamailio management board and now it is part of the development version!

I was also appointed Kamailio developer and got write access to git repository. This was specially awesome and deserved great celebration :D.

I want to give special thanks to Carsten Bock who illuminated the path for me and to Daniel-Constantin Mierla for appointing me as new developer :).