On Apr 26, 2024, at 5:17 PM, Pavan Kumar via sr-users
<sr-users(a)lists.kamailio.org> wrote:
Hello everyone,
While going through the WebRTC example configuration (cfg) to better understand and
implement it in my setup, I came across a potential issue in the code block. The code in
question can be found at this link:
https://github.com/kamailio/kamailio/blob/465994de2859c7863b4cef8457be0a207…
In the code, there is an "if else" block, "if(loose_route())" that
seems to be incorrect. It appears that the "if" block will always evaluate to
true, given that "loose_route" never returns 0. According to the documentation,
the return values of "loose_route" are specified as 1, 2, -1, -2, -3.
Therefore, it seems the "if" block is unnecessary, and the "else"
block will never be executed. Could someone please confirm this observation and, if
accurate, suggest a correction for the code?
Thank you for your attention to this matter.
Best regards,
Pavan Kumar
" If there is no Route: header, the function returns FALSE and routing should be done
with normal lookup functions. If a Route: header is found, the function returns 1 and
behaves as described in section 16.12 of RFC 3261. There is only one exception: If the
request is out-of-dialog (no to-tag) and there is only one Route: header indicating the
local proxy, then the Route: header is removed and the function returns FALSE."
Regards,
Fred Posner
p: +1 (352) 664-3733