[1]Is it possible to iterate a htable without using "keys" like an array?
[2] Is it possible to search for "keys" using regxp?
Hello,
On 08/09/14 10:50, aft wrote:
[1]Is it possible to iterate a htable without using "keys" like an array?
there is no possibility to iterate the hash table from configuration file. The structure is stored in memory, with locks per slots, to be optimized for parallel processing.
For a consistent iteration, the lock has to be at hash table level, which will impact the performances a lot.
An alternative would be to add iteration still using the locks on slots, but that means new items can be added/removed/updated in other slots while walking on a slot. So it is not like taking a snapshot of hash table content at a specific time.
Also, maybe you can provide more details about what you need to achieve, there could be other options to try.
[2] Is it possible to search for "keys" using regxp?
It is possible to count items by regular expression matching on key or value, see:
- http://www.kamailio.org/wiki/cookbooks/4.1.x/pseudovariables#shtcn_htable_ex...
As well as deleting items:
- http://kamailio.org/docs/modules/stable/modules/htable.html#htable.f.sht_rm_...
Cheers, Daniel
Thanks for the reply. It was very helpful.
On Mon, Sep 8, 2014 at 3:38 PM, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
On 08/09/14 10:50, aft wrote:
[1]Is it possible to iterate a htable without using "keys" like an array?
there is no possibility to iterate the hash table from configuration file. The structure is stored in memory, with locks per slots, to be optimized for parallel processing.
For a consistent iteration, the lock has to be at hash table level, which will impact the performances a lot.
An alternative would be to add iteration still using the locks on slots, but that means new items can be added/removed/updated in other slots while walking on a slot. So it is not like taking a snapshot of hash table content at a specific time.
Also, maybe you can provide more details about what you need to achieve, there could be other options to try.
[2] Is it possible to search for "keys" using regxp?
It is possible to count items by regular expression matching on key or value, see:
http://www.kamailio.org/wiki/cookbooks/4.1.x/pseudovariables#shtcn_htable_ex...
As well as deleting items:
http://kamailio.org/docs/modules/stable/modules/htable.html#htable.f.sht_rm_...
Cheers, Daniel
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users