Search code examples
phpmysqlsmskannel

Implementing Priority Queue in Kannel


I would like someone experience with kannel to enlighten me please.

I currently run a little site that revolves around sending and receiving SMS. I am using Kannel as SMS Gateway, One feature that I like to have in it is Priority based Queuing of my SMS to be sent.

The work around that me and my colleague have come up with is to write an intermediary program, to which we will send our SMS to be sent, it will manage it's own queue and will in turn handle them to kannel Priority wise.

It will store SMS to MySQL database for persistence and would be done in PHP.

I just want to be sure that this is a good way to solve our problem and I want to open source it so other peoples can benefit.

Many thanks.


Solution

  • Kannel itself does not support message priority in internal queue.

    However you can use sqlbox addon (included in Kannel 1.5.0 release - see "addons/sqlbox" catalog).

    This case you can make simple changes in the following way:

    1. Add "my_prio" field to table structure.
    2. Change original fetching SQL query to order messages by this field (SELECT ... ORDER BY my_prio).
    3. Insert MT messages with appropriate value of this "my_prio" field.

    All mentioned changes may be done in "addons/sqlbox/gw/sqlbox_mysql.h" file.