When using double route headers the selection of the outgoing socket is only done on IP address if the port is omitted in that route header. This fix defaults the port to 5060 so the correct listen socket is chosen. When no socket is found it will fallback to the current behaviour keeping backwards compatibility.
If backwards compatibility is not required the extra 'if else' could be removed. I'm not sure if `loose_route()` is being used in this way so I opted for keeping backwards compatibility. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/830
-- Commit Summary --
* rr: default to port 5060 if port is omitted in route header
-- File Changes --
M modules/rr/loose.c (5)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/830.patch https://github.com/kamailio/kamailio/pull/830.diff