when receive BYE sip:xxx@xxxx;alias=ip1;alias=ip2 SIP/2.0, handle_ruri_alias_mode(1) doesn't work as documented You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3863
-- Commit Summary --
* fixed handle_ruri_alias_mode(1) cannot proper handle multi alias
-- File Changes --
M src/modules/nathelper/nathelper.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3863.patch https://github.com/kamailio/kamailio/pull/3863.diff
Thanks for proposing the fix, it will be reviewed. Note that you have to format the commit message as per contributing guidelines:
- https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md#com...
Updated the commit's message to match the guidelines and will be merged soon if no more comments.
@miconda @henningw Indeed the patch seems to resolve the problem. The issue seems to be happening due to the line here. https://github.com/kamailio/kamailio/blob/51dcab019a42e5b1f3b81247ca71ffcaf4...
We use the `rest=start;` to search for the parameters of `alias`, but in the while above `rest` and `rest_len` are changed for `mode=1`. Specifically, the problem is in `rest_len` in 1184 which does not represent the length of `start` anymore , but still used.
Removing the two lines as suggested, fixes the problem since the search is still done correctly.
Also, I believe the `+4` is not needed anymore. https://github.com/kamailio/kamailio/blob/51dcab019a42e5b1f3b81247ca71ffcaf4...
@xkaraman: I am fine to merge it if you reviewed it and fixes it.
@xkaraman pushed 2 commits.
642dd10c3968468a4a1201e5a39f138f5bcf510f nathelper: fixed handle_ruri_alias_mode(1) cannot proper handle multi alias 32c73c34c8eaaa703693de414a72058db8423f23 nathelper: remove magic constant
@miconda Yeap, i did some experiments with the patch and it works as intended now.
Rebased to master, removed the `+4` magic constant and will merge when checks pass.
Merged #3863 into master.