Starting with Kamailio 4.2.0, you have the possibility to walk through htable content via an iterator, accessing the key and value for all items. Three new functions (to initialise the iterator, go to next item and end iteration) along with two new script variables (to retrieve the key and the value for current item) give the tools for using this functionality. Next snippet presents how to print the items (key, value) for htable h1:
sht_iterator_start("i1", "h1"); while(sht_iterator_next("i1")) { xlog("h1[$shtitkey(i1)] is: $shtitval(i1)\n"); } sht_iterator_end("i1");
More details about this feature can be found in the readme of htable module:
Enjoy it!
No comments:
Post a Comment