New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matching uri == myself fails when request uri has parameter #2482
Comments
This is a topic about using kamailio, not a bug in the source code. If you want discuss further, write to sr-users mailing list. |
I understand perfectly how uri==myself works... or doesn't in this case. This is not about how to use Kamailio, I have only 8 years of experience with Kamailio but I think I can wrangle it a bit. The example.com is not supposed to match myself, I know that. This is beside the point, the point is that my log floods with errors: Looking at the source code in resolve.c this error is generated if str2ip6buf(str* st, ip_addr_t* ipb) is called with a null or zero length string. This is obviously an error somewhere higher up in the processing. And I have isolated that in the config this error is emitted always when I have removed the unnecessary ip:port alias (now there are now no aliases listed on startup) and the situation is the same. Also the same if I add the FQDN of the server there (with port). |
This sounds more like an issue with the resolve.c code or upper parts, as you suggested as well. |
While initially I misunderstood what you reported, it still is a matter of the configuration file, either setting r-uri host part to null via uri2tel or other operations, so here I spent some time to prove it. Next is the diff to master branch default config file:
I run kamailio (master and 5.3 branches) in source code folder with:
Then shoot an OPTIONS with sipsak and all is fine (note in the middle the INFO log message printed by the diff added above to default config, no other errors):
So again, it should be specific to your config. If one wants to silent log errors when using functions that require host part in the uri with values without host, then is another scope, it should be an enhancement at least controlled by a parameter, because such errors are useful to alert when one does wrong config operations. |
Ok thanks for taking the time to recreate this. We are actually using tel2sip in the config so your idea about empty host part may be right. Unfortunately this environment is not something we can easily duplicate in a test setup but we'll go through it. I think comparing a null uri, uri with no host or tel: URI to |
Actually I expect an error message, because after converting to tel uri in config, one is aware of no-host part and can avoid testing conditions that need the host part. But if an operation fails to set the host part when it should, then is good to have error logs on these kind of conditions. Anyhow, if one wants to tune this behaviour, just make a pull request. Closing one more time this issue, proved not to be in the code. Further discussions can be done on mailing list. |
Description
If the SIP request URI has a parameter ;user=phone, then the match with
myself
fails with error in log.Troubleshooting
Sending an OPTIONS request through the proxy:
Note: The R-URI does NOT match myself. It never does in my case unless it's an attacker.
Reproduction
My config is very simple in terms of aliases:
and in routing block:
if (uri==myself) return;
Log shows:
Possible Solutions
Sorry, I couldn't figure out where in the source this call to resolve.c functions happens.
Additional Information
kamailio -v
The text was updated successfully, but these errors were encountered: