[SR-Users] Loading multiple htables from db on startup? (Kamailio 1.5)

Robin Rodriguez rrodriguez at ifbyphone.com
Tue Jul 5 17:46:21 CEST 2011


Hi all,

Currently running on 1.5.4-notls and using a single htable that gets loaded
at startup ala

modparam("htable", "htable",
"local_routes=>size=4;autoexpire=0;dbtable=TABLE_A;")
modparam("htable", "key_name_column", "NAME_1")
modparam("htable", "key_value_column", "VALUE_1")
modparam("htable", "fetch_rows", 512)

This works great, the problem I've run into is attempting to load a second
htable on startup whose data comes from a different table/scheme ala

modparam("htable", "htable",
"inbound_acl=>size=4;autoexpire=0;dbtable=TABLE_B;")
modparam("htable", "key_name_column", "NAME_2")
modparam("htable", "key_value_column", "VALUE_2")
modparam("htable", "fetch_rows", 512)

With both of them in the config file Kamailio fails to start with the error

INFO:core:init_mod: initializing module htable
ERROR:db_mysql:db_mysql_submit_query: driver error on query: Unknown column
'NAME_2' in 'field list'

'NAME_2' does not exist in 'TABLE_1' so that seems to suggest that only the
first dbtable value is used, the SQL side supports this:

select NAME_2,key_type,value_type,VALUE_2 from TABLE_A  order by key_type

So it uses the first defined database table, but then the last defined
key_name and key_value.

Is there any way that I've overlooked in the docs or elsewhere about about
loading multiple htables from different database tables? I'd like to use
this htable in an ACL and would like to avoid database hits though can make
it work with avpops if I have to.

Any suggestions are greatly appreciated.

Thanks, Robin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110705/5b3f7600/attachment.htm>


More information about the sr-users mailing list