[SR-Users] Loading keys with key_type="1" from database for htable - Module params help needed

George Diamantopoulos georgediam at gmail.com
Wed Aug 30 20:06:42 CEST 2017


Hello all, I'm becoming a regular here now, aren't I?

So I have this table in mysql:
+----------+----------+--------+-----------+---------+
| key_name | key_type | value1 | value2 | value3 |
+----------+----------+--------+--------+--------+
| key1     | 1        | valueA | valueF | valueK |
| key1     | 1        | valueB | valueG | valueL |
| key1     | 1        | valueC | valueH | valueM |
| key2     | 1        | valueD | valueI | valueN |
| key2     | 1        | valueE | valueJ | valueO |

I was hoping I could have all this information available in an sht, where
for example:

$sht(a=>$key1[0]), $sht(a=>$key1[1]), etc

would return:

"valueA,valueF,valueK", "valueB,valueG,valueL" etc

but I can't figure out how to setup htable to import this data on
restart. I have tried various combinations of module parameters such
as:

modparam("htable", "htable",
'my_htable=>size=8;autoexpire=86400;dbtable=my_table;cols="key_name,value1,value2,value3";'

I'm either getting errors, or dumping htable will only show one of the
value sets (key_type is not set to array).

Does anyone have a working config to share? Thanks!

George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170830/263e3fc2/attachment.html>


More information about the sr-users mailing list