I had trouble finding correct syntax with db_text backend, this patch helped me You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/220
-- Commit Summary --
* modules/htable: improves error message when loading from database
-- File Changes --
M modules/htable/ht_db.c (13)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/220.patch https://github.com/kamailio/kamailio/pull/220.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/220
The check for NULL should be before the one for STRING, because the condition for STRING is printing the value and in case it is NULL will result in crash.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/220#issuecomment-115195400
Umh, yes! Now it is other way around. I forcefully changed history of my branch, updated patch is c91116a5b253c2827f34d99a5597a14fe8f16001 (seen also in this pull request).
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/220#issuecomment-115269541
One more I just noticed: if the .type!=DB1_STRING, it assume is DB1_STR, because it is printing that value, but can be any other type, like DB1_INT and then there will be a crash.
Printing type is ok, but before the second LM_ERR has to be a check on the type before printing some specific fields.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/220#issuecomment-115276701
Thanks for patience... I removed value printing on f39736b276878f0de1e0471311119f12f1878801
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/220#issuecomment-115354418
Merged #220.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/220#event-340464348