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
[usrloc] Make usrloc keepalive call-id more random #3225
Comments
I didn't care much about randomness of call-id thinking that also from-tag changes (which has internal unique id of the record) and that has to be also used for dialog matching. But makes sense to make it more random from the point of view of analysing the sip traffic and aggregations on call-id. I will look at the code soon and see what can be done. |
If for you is ok to modify the call-id generation in usrloc, I can try to setup a PR. I think that appending a |
crytorand() will produce cryptographic secure numbers, which might be a bit overkill. Using fastrand() is probably enough, this is ISAAC with a really long period. |
I pushed a commit to add a random and the pid to the call id. Maybe in long term will be replaces with a random string, but for the moment should be fine. Feel free to make PRs with other enhancement there and they will be reviewed. The commit will be backported soon. Closing this one. |
Description
Right now, usrloc keepalive method use a somewhat static call-id, built with the prefix
ksrulka-
followed by the number of keepalives sent and the contact index of each AoR pinged.This means that pings to different contacts from different processes (when using timer_procs in usrloc) or when you have multiple proxies each handling a subset of registrar requests, you can have duplicated call-ids.
Basically the following happens:
ksrulka-1.1
)OR
ksrulka-1.1
) from both proxies.While this is not a routing problem, bug or whatever, it can be annoying if traffic is analyzed with tools like sngrep, which group messages by the Call-ID header, and if you run sngrep on the edge proxy you'll see both keepalive messages under the same call.
Can be also annoying if logs from all proxies are aggregated, making a bit problematic filtering by call-id.
Expected behavior
Call-id should be somewhat random.
SIP Traffic
This is an example for same call-id used for pinging two different AoR on same proxy.
and
Possible Solutions
To be 100% honest I don't get why such method of generating call-ids has been chosen. The only useful thing I see is that you can have a clue of how many keepalives ping have been sent by each process / proxy while inspecting sip traces. I don't see any usage of the fixed call-id in handling responses. But I may be wrong, since I'm new to kamailio.
What could be done is to add a random string to the call-id, like nathelper does. If this is acceptable, I can try to create a PR for that.
Additional Information
kamailio -v
Using official docker images of kamailio 5.6.1.
The text was updated successfully, but these errors were encountered: