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: cnxcc.caruizdiaz.com:5070
* 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.

linphone-cnxcccnxcc-csipsimple

 

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: http://tryit.jssip.net/
  • 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

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

2. Install compilation dependencies

apt-get install build-essential iptables-dev debhelper libcurl4-openssl-dev libglib2.0-dev libglib2.0-0 libxmlrpc-c++4 libxmlrpc-c++4-dev linux-kbuild-3.2 linux-headers-3.2.0-4-common linux-headers-$(uname -r) module-assistant

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

cd mediaproxy-ng/ && dpkg-buildpackage -d

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

dpkg -i *.deb

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

DKMS: install completed.
mediaproxy-ng not yet configured. Edit /etc/default/ngcp-mediaproxy-ng-daemon first.
Setting up ngcp-mediaproxy-ng-kernel-source (2.3.5) ...
Setting up ngcp-mediaproxy-ng (2.3.5) ...
Setting up ngcp-mediaproxy-ng-dbg (2.3.5) ...

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