[Users] [Fwd: [Serdev] Contributing new module "prefix_route" to SER]

Klaus Darilion klaus.mailinglists at pernau.at
Mon Apr 30 13:30:06 CEST 2007

FYI: A new ser module which could probably easily ported to openser too 
(if someone needs this feature)


-------- Original Message --------
Subject: [Serdev] Contributing new module "prefix_route" to SER
Date: Wed, 25 Apr 2007 16:52:39 +0200
From: Alfred E. Heggestad <aeh at db.org>
To: serdev at iptel.org


Here is a contribution to the SER community; a new module called
"prefix_route" that does prefix-based routing from rules stored in
the database.

The work was sponsored by my employer, Telio Telecom.

The source code is attached, and can also be downloaded from here:


The module has been tested with ser-0.9.6 and ser-0.9.7-pre8
from CVS. It could also be ported to SER 2.0 if there is any

The idea with this module is to move the logic of selecting
PSTN gateway from ser.cfg to the database. In the database
you will have a table called e.g. "prefix_route" which has
one entry per rule, matching a prefix to a route number:

    prefix     route
    ------     -----

    0045   ->  route 3
    0046   ->  route 4
    0047   ->  route 5

for incoming requests, you can call the prefix_route() function
in your ser.cfg - it will then try to match the username part of
the request-uri to the "best" prefix, i.e. closest match. if there
is a match, it will jump to that routing block in ser.cfg. all
referenced route numbers must be declared in ser.cfg, otherwise
it will not load. The prefix_route table is populated from the DB
at boot or with the "prefix_reload" FIFO command, into a RAM-based
tree that is used in execution time.

For more documentation, please see the README file ;)

I hope that this module will be useful for you, any feedback will
be appreciated!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: prefix_route-20070425.tar.gz
Type: application/x-gzip
Size: 6062 bytes
Desc: not available
Url : http://lists.kamailio.org/pipermail/users/attachments/20070430/cc7530f4/attachment.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: file:///C|/DOKUME%7E1/KLAUS/LOKALE%7E1/TEMP/nsmail-1.txt
Url: http://lists.kamailio.org/pipermail/users/attachments/20070430/cc7530f4/attachment.txt 

More information about the Users mailing list