without this patch nathelper build request-uri from received if it's set and falls back to contact.
Now we have an option to send the Contact (that has the username part) no matter what.
We used this in order to fix problems with FritzBox subscribers but seeing https://www.mail-archive.com/sr-users@lists.sip-router.org/msg13081.html maybe this is useful for everybody
with @sipwise hat on You can merge this Pull Request by running:
git pull https://github.com/linuxmaniac/kamailio vseva/nathelper_contact_only
Or you can view, comment on it, or merge it online at:
https://github.com/kamailio/kamailio/pull/31
-- Commit Summary --
* usrloc: add GAU_OPT_ONLY_CONTACT option and get_all_ucontacts_opt() in order to use it * nathelper: add contact_only option to ignore "received" field from usrloc and use contact info for building the ping message
-- File Changes --
M modules/nathelper/doc/nathelper_admin.xml (20) M modules/nathelper/nathelper.c (12) M modules/usrloc/dlist.c (34) M modules/usrloc/dlist.h (14) M modules/usrloc/usrloc.c (1) M modules/usrloc/usrloc.h (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/31.patch https://github.com/kamailio/kamailio/pull/31.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/31
The rebase just removed the comments here. @miconda I think this works for us because we send the messages through our lb and the contact has the received parameter included so lb sends the message to the proper IP with the proper contact info.
But I'm kind of stuck here, what should be do here in order to get contact and received from usrloc and build the proper message in nathelper?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/31#issuecomment-73484102
You need to extend both usrloc and nathelper. usrloc has to pass both contact and received fields.
The data passed from usrloc to nathelper is done by printing in a buffer the size of the field (as integer, in 4 bytes) followed by the field value. Both modules must use the same order of the fields (usrloc to write, nathelper to read). usrloc must be extended in both functions: the one fetching from database and the one fetching from memory.
In usrloc, you can look at how path is added, same should be done for received. In nathelper, if path is not set, then the destination is taken from received if set, if not from contact.
The new parameter might not be needed afterwards, as the r-uri for options should be always the contact address.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/31#issuecomment-73602347
reworked as @miconda suggested usrloc.get_all_*_ucontacts now sends received and contact fields nathelper.nh_timer reads both and uses received for building the dst but contact for building r-uri
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/31#issuecomment-74679101
Can be merged.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/31#issuecomment-75129139
Merged wrong number on commit fixes :-(
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/31#issuecomment-75200002
Closed #31.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/31#event-238951081