Hi,
htable module has been enhanced with couple of features that give more flexibility in working as config file cache system.
- auto-expire - to each value stored in hash table can be assigned an expire value. If no update was done in that time interval, the value will be automatically removed. One new pseudo-variable class has been added to manage the expire values: $shtex(htable=>key) - it can be used to get/set the time-out interval. To get this feature on, the hash table definition must include autoexpire attribute greater than 0.
- sht_rm_name_re(htable=>regexp) - delete from hash table all entries that match the name against regexp - sht_rm_value_re(htable=>regexp) - delete from hash table all entries that match the value (string) against regexp
- reload the content of a hash table from database at runtime upon MI command. The hash table definition must include the database table name, then you can issue: 'kamctl fifo sht_reload htname' to reload the hash table with name 'htname'.
Check the documentation at: http://kamailio.org/docs/modules/devel/htable.html
Regards, Ramona
Elena-Ramona Modroiu writes:
- reload the content of a hash table from database at runtime upon MI
command. The hash table definition must include the database table name, then you can issue: 'kamctl fifo sht_reload htname' to reload the hash table with name 'htname'.
elena,
it is possible to cause reload on hash table automatically when kamailio is started, i.e., at module initialization time?
-- juha
Juha Heinanen wrote:
Elena-Ramona Modroiu writes:
- reload the content of a hash table from database at runtime upon MI
command. The hash table definition must include the database table name, then you can issue: 'kamctl fifo sht_reload htname' to reload the hash table with name 'htname'.
elena,
it is possible to cause reload on hash table automatically when kamailio is started, i.e., at module initialization time?
Hi Juha,
that feature is there for quite some time - if a dbtable is given in hash table definition, the content of that table is loaded at startup:
http://www.kamailio.org/docs/modules/devel/htable.html#id2452867
Best regards, Ramona
Elena-Ramona Modroiu writes:
that feature is there for quite some time - if a dbtable is given in hash table definition, the content of that table is loaded at startup:
http://www.kamailio.org/docs/modules/devel/htable.html#id2452867
elena,
very good. i'll start testing the module in order to make configuration of kamailio as much db based as possible.
-- juha