[SR-Users] DB select htable:mod-init doesn't work

Sebastian Damm damm at sipgate.de
Thu May 15 11:34:25 CEST 2014


I'm trying to fill a hash table on startup in the htable:mod-init event
route. But it doesn't work. Kamailio doesn't start at all, but doesn't
print out an error in the log.

This is what the route looks like:

event_route[htable:mod-init] {
        xlog("L_NOTICE", "Loading Carrier domains into Hash table.\n");
        sql_query("ser", "select domain_name from carrier_domains",
        xlog("L_NOTICE", "Loaded from database...\n");
        while($var(i)<$dbr(domains=>cols)) {
                xlog("L_NOTICE", "Entry: $dbr(domains=>[$var(i),0])\n");
                $sht(carrierips=>$var(i)) = $dbr(domains=>[$var(i),0]);
                $var(i) = $var(i) + 1;

Of course, the necessary parameters are set.
modparam("htable", "htable", "carrierips=>size=6")

In the log I see the following:
May 15 11:25:33 linux /usr/sbin/kamailio[20872]: NOTICE: <script>: Loading
Carrier domains into Hash table.

As you can see, there should be a lot more output, but nothing happens
anymore after that. In ngrep I see other queries going to the same database
from other modules, but my query from the event route is never executed.

Am I missing something?

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140515/611efc88/attachment.html>

More information about the sr-users mailing list