Is there some good reason why htable in $sht(htable=>key) cannot be a dynamic string containing pseudo variables?
-- Juha
Hello,
having static name for htable there helped to do the lookup of hash table structure at startup and keep pointer to it for faster access as well as parse the part after => to break it in variables and static strings. Having it a dynamic value didn't seem useful at the time of implementation several years ago.
In the code is possible to lookup the hash table at runtime, being also done by some of the htable cfg functions. It will require some new code to evaluate the name expression every time at at runtime, then parse and lookup the hash table structure...
Cheers, Daniel
On 13.10.20 09:25, Juha Heinanen wrote:
Is there some good reason why htable in $sht(htable=>key) cannot be a dynamic string containing pseudo variables?
-- Juha
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla writes:
In the code is possible to lookup the hash table at runtime, being also done by some of the htable cfg functions. It will require some new code to evaluate the name expression every time at at runtime, then parse and lookup the hash table structure...
A use case where it would be convenient to have htable name in a variable is when there is two hash tables, one of which is active while the other waits new content to be loaded from database. When done, roles of the two hash tables are changed.
So instead of testing, which hash table is currently active and then use its string name as htable name, it would be simpler to use a var where the name of currently active table is stored.
-- Juha