Hello!
I'm examining the WebSocket module and I am wondering how it handles multiple connections from the same port.
For context, imagine the following scenario:
UA1 ==> Load Balancer:41914 ==> Kamailio (WS)
UA2 ==> Load Balancer:41914 ==> Kamailio (WS)
Now, imagine Kamailio perceives UA1 from port 41914. What happens if that UA1 suddenly drops and another UA2 comes in from the same port? (before the connection closed event is fired for UA1)
I understand by looking at the source code that `wsconn_add` is called and that this new connection is added to the list. But what happens with the previous UA entry? does it gets overwritten or does it stays there?
The reason for my question is: I am perceiving the above scenario like this:
Let's say UA1 is sip:d3315cf8@9a431b1f90e5.invalid;transport=ws SIP/2.0
and UA2 is sip:asd08a08@555343439666.invalid;transport=ws. If UA2 comes in and takes over the port that UA1 was using, and I send an INVITE to UA1 UA2 ends up receiving the invite (obviously because it now has that port allocated).
So what I am thinking is that both d3315cf8@9a431b1f90e5.invalid and asd08a08@555343439666.invalid are mapped to the same port for a short period of time.
Thoughts?