DLR support for MS-SQL and Sybase

Yesterday I’ve published a patch that added Kannel’s DBPool support for MS-SQL and Sybase via the FreeTDS library.

Today’s patch uses that functionality to implement the DLR storage on MS-SQL and Sybase DB Engines.

To use this, you need to:

1. Patch Kannel to support FreeTDS (see yesterday’s link).
2. Patch Kannel using this patch, to add support for DLR’s over FreeTDS.
3. ./configure –with-mssql=[optional path] [–other-switches]
4. make
5. sudo make install
6. Configure dlr-storage = mssql
7. Configure the DB connection (see yesterday’s article for details).
8. Configure the dlr-db group (see the userguide for details).

A simple example:

group = core

dlr-storage = mssql

group = mssql-connection
id = msdlr
username = myuser
password = mypass
server = mssql
database = mydb

#DLR Configuration
group = dlr-db
id = msdlr
table = dlr
field-smsc = smsc
field-timestamp = ts
field-destination = destination
field-source = source
field-service = service
field-url = url
field-mask = mask
field-status = status
field-boxc-id = boxc

Here is the patch: kannel-dlr-mssql

That’s all. Please try it and let me know.

Regards,

Alex

MS-SQL and Sybase support for Kannel via FreeTDS

UPDATE: This patch has been officially accepted into the main tree. Just download the latest CVS and you’re all set.

The following article is now old news:

I’ve been working integrating Kannel with FreeTDS, an open source project that provides a free, open source driver for the tabular data system protocol used on MS-SQL and Sybase DB Engines.

The result is a DBPool module that makes Kannel capable of talking with MS-SQL and Sybase DB’s.

To use this module you need to have FreeTDS installed on your kannel box (either by compiling the source code or installing binary packages). If you’re installing from packages, do not forget to install the development packages as well (otherwise you won’t be able to compile Kannel).

Once you’ve installed FreeTDS, configure the freetds.conf and make sure that everything works properly. Hint: use the tsql command line utility and try connecting to your DB server).

To compile this into Kannel, you need to download and apply this patch. Since it touches the configure template, you need to bootstrap the code afterwards. In short:

1. Download the patch kannel-dbpool-mssql to Kannel’s source root directory
2. Apply the patch: patch -p0 < kannel-dbpool-mssql.patch
3. ./bootstrap.sh (only the first time after applying the patch)
4. ./configure –with-mssql=[optional path] [–other-switches]
5. make
6. sudo make install

Now, to configure the DB-Link, you need to add a dbpool group to kannel’s configuration files. It should look similar to this:

group = mssql-connection
id = mssql-db
username = myuser
password = mypass
server = server_name
database =my_db_name

Note: server_name should match the [server_name] group for the DB link on your freetds.conf file.

Right now, this patch only adds the functionality to make Kannel FreeTDS-capable. I’m adding support for DLR’s and SqlBox soon, so stay tuned!

Here’s the patch: kannel-dbpool-mssql

As usual, please try it and let me know how it goes.

Regards,

Alex

Proud father

My kid Juan (13) did this video along with 3 friends as part of a schoolwork assignment. He wrote the script, did the greenscreen and also did the editing. Watch it, it’s lots of fun!

I don’t have to say how proud of my kids I am. They make life worth it.

Alex

WMC in Barcelona

I’m attending GSMA’s Mobile World Congress in Barcelona. It’ll be a great opportunity to meet fellow developers and companies. If you’re attending and wish to arrange a meeting, just drop me a comment and I’ll answer in private.

Regards,

Alex

DB-Based Store for Kannel

This is a new version from my previous patch to add support for a DB based store.

Fundamental differences with the previous version:

1. The DB table is now created automatically at startup (if it didn’t exist).

2. Cleaned up code aiming at supporting other DB engines apart from MySQL.

3. Added documentation.

Please download the patches here:

kannel-store-db

kannel-store-db-docs

Again, this is far from stable. It needs further testing and confirmation before rolling up into production.

Regards,

Alex

Apple Support Rocks!

I wanted to share a short story about one of the many benefits of buying good hardware from serious companies.

My almost-2-years-old MacBook Pro battery was having serious performance issues: After a full charge, it only lasted about 20 minutes (even with the display dimmed to be barely visible).

Resisting the idea of having to buy a new battery, I’ve googled a little and found an Apple page about problems with MacBook Pro batteries. Turned out that my battery was eligible for a free replacement.

With nothing to lose, and after unsuccessfully asking in-person on a couple of “official” resellers, I’ve been directed to the AppleCare phone number in Spain. After about 15 minutes of music on hold and about 30 of Q&A with a nice and knowledgeable operator, I’ve been told that they’ll mail me a new battery on the next 4-7 days. I’ve also been given specific instructions about  returning my old battery to the same messenger for recycling. Good! 🙂

This was yesterday. Today, an UPS messenger brought my new battery and took away the old one. Right now it’s happily being charged while I’m writing this.

Just one more reason to be a happy owner of a Mac. I’ve no doubts about what I’m going to buy next time.

Alex

Store Tools for Kannel

One of the problems with Kannel’s store formats is that they’re binary packed and it’s not easy to manipulate them. Specially with the store-file format, getting rid of a single message requires editing the binary file and it’s not a trivial task. Converting between file and spool formats it’s not easy, and if you want to export the content to some other format you need to rely on the web interface.

That’s why I’ve created these simple store-manipulation program: store_tools.

What store_tools do is to read the store location and format from your kannel.conf file and allows you to perform a series of commands with it. The available commands are:

list [limit/start] [limit] Allows you to list the content of the store. Optional parameters allows you to list limit records, or start at a given record and also limit the amount returned.
delete <uid> Allows you to delete a message. You can retrieve the uid by using the list command.
export <format> <location> Allows you to export the store into another format. Possible formats are: text, xml, html, spool and file. <location> specifies the path where you want the exported data to be written.

NOTE: Since the delete command modifies the store, you should do it with kannel stopped.

Please download the patch here: kannel_store_tools

Please try it and let me know if it works for you.

-Alex-

Using Maven with NetBeans IDE 6.5

According to Maven’s web site: “Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project’s build, reporting and documentation from a central piece of information”.

I’m pretty impressed on what Maven can do for my projects, I’m sure it would do as well on yours! I’ve assembled this small tutorial on how to use Maven from inside NetBeans 6.5 IDE.

NOTE: The text is somewhat readable only in high-res mode. You may consider using full-screen mode as well.

I hope you enjoy it.

Alex

Living on Barcelona again

So, the day has finally come. I’m living on Barcelona again.

The trip was long and complicated (planes delayed, all my luggage went lost) but this morning my 5 pieces of luggage arrived at home and everything started to fit into place.

I love this city and its people: It boils with art, music, architecture and all sorts of culture expressions. I love people’s open-mindedness as well.

So, new times are coming. I know it will be good times.

Alex

Sqlbox 0.7.1 released

I’ve just commited latest Sqlbox version, 0.7.1 (yes, we’re now using a numbering schema).

The main changes for this version:

* Added support for the LibSDB database abstraction library. DB support is now similar to Kannel’s.
* Extensive code reorganization to move the queries into the header files and allow reusing from the libsdb module.
* Added examples for database connections on sample conf file.

You can download it from here: sqlbox-0.7.1.tar.gz.

You can also checkout from CVS as usual.

Regards,

Alex