lookup function has an optional uri param for looking up based on that param. lookup_to_dset is used if we don't want to overwritte the Request-URI but there is option to lookup based on a uri.
during tests i noticed that the append_branch was being called when i did a lookup_to_dset("location", "$fu") and kamailio exited because of that.
i made the append_branch to depend on the _mode ( 0 = lookup ) which seemed to fixed.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/84
-- Commit Summary --
* registrar : add lookup_to_dset optional uri param as in lookup
-- File Changes --
M modules/registrar/lookup.c (34) M modules/registrar/reg_mod.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/84.patch https://github.com/kamailio/kamailio/pull/84.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/84
I didn't have the time to test the changes, but it seems to me that making append_branch depend on the _mode=0, breaks what the lookup_to_dset function had been thought for, adding new branches to the dset so that new branches can be added to a transaction via t_append_branches (tsilo relies on those two functions to work). Maybe I don't understand what are you trying to achieve calling lookup_to_dset with a ruri, but what's the purpose of calling a lookup without rewriting the r-uri nor appending new branches?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/84#issuecomment-74510087
I second the fact that disabling the append_branch() execution is not clear. More details about what use cases is fixing might sort out the right solution.
Few other remarks: * apparently the indentation was changed (whitespaces instead of tabs?) * if there is a fix + new feature, split the commit in two, because the fix might need to be backported
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/84#issuecomment-74510889
i do agree about the append branch part, i didn't find a way (lack of knowledge) to make it work without it. when using the uri param, $fu in this case,, kamailio exited. i think that there must be a better option instead of _mode. help appreciated.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/84#issuecomment-74511400
If you get a crash, get the backtrace from the core file to see what is the problem. Probably the new parameter is not handled properly.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/84#issuecomment-74516966
Closed #84.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/84#event-237046011
closing this, will make implementation of requirement in lookup registered(uri) function
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/84#issuecomment-74698203