Bookmark/Search this post

Running Asterisk on NuoDB

You are here

Running Asterisk on NuoDB

Error message

Note: This blog was published over a year ago. Content may be out of date.

You may already be familiar with Asterisk, the widely-deployed open-source telephony framework. If you aren't, you should check it out. It's a pretty cool piece of software. A low-load instance of Asterisk can be deployed to use the filesystem to store things like phone-registration data and voicemails. But if you want to do anything fancy with Asterisk, or if you happen to care about things like fault-tolerance, you might look at pointing Asterisk at a database. And if you happen to have a large Asterisk cluster built to handle significant load, you might look at pointing Asterisk at an elastically-scalable database. In this post, I'll walk you through setting up a minimal Asterisk installation on a single RPM-based Linux machine with NuoDB. You can go much farther with Asterisk installs spanning several data centers, but I'll leave those headaches to the experts. Pairing such an installation with NuoDB will at least take the database pain out of such a setup. Let's dive in.

Setting up ODBC

While there is native support in Asterisk to talk directly to MySQL and PostgreSQL, the more tested and hardened path is to connect to a database through ODBC. Here, we install unixODBC, the ODBC driver manager implementation for Unix-like operating systems.

During make menuselect, check the Call Detail Recording (CDR) to make sure that cdr_odbc is enabled. Press q to leave make menuselect. After that, you can get yourself a coffee and spend a few minutes checking out Dinosaur Comics.

If compilation on your system succeeded and your distribution is recognized by the make install phase, you should be able to start the Asterisk service:

sudo service asterisk start

Connecting Asterisk and NuoDB

Asterisk can utilize a database in various ways. As an example, we'll set up CDR logging.

We force the reload of the configuration files again, and install SIPp:

as root:
service asterisk restart
yum install sipp

If your distribution's repositories don't contain SIPp, it's only a simple make away. To test our installation, we run the following command. You can verify that SIPp is pointed at your Asterisk instance by seeing the logs in the Asterisk console.

sipp -d 2000 -s 123 127.0.0.1 -l 10 -timeout 4s

Now we can confirm that we got call logs by seeing a non-zero number after issuing:

Recap

Since Asterisk is a framework that can run a wide variety of telephony applications, there are arbitrarily-many possible connection points between it and a database. We've tested the CDR functionality, and a few other paths, but we'd love your feedback. Please let us know about your experiences using Asterisk and NuoDB!