sippy / rtpproxy

The RTPproxy is a high-performance software proxy for RTP streams that can work together with Sippy B2BUA, Kamailio, OpenSIPS and SER.
http://rtpproxy.org
BSD 2-Clause "Simplified" License
408 stars 114 forks source link

socket allocated (SOCKET_REPLY) in technical docs is wrong? #130

Closed vasilakisfil closed 2 years ago

vasilakisfil commented 2 years ago

Hello again,

Another thing that I noticed while building the Rust lib, is that the socket reply that the technical docs describe does not seem to match the human-oriented documentation or the actual response I get from rtpproxy: in both cases I get just the port number, nothing about the IP address.

I assume the technical documentation is out of date ? Or is there any special case that I might get an IP as well?

vasilakisfil commented 2 years ago

I think I found something from Kamailio's code in rtpproxy module. If I read the code right though, I think the docs are wrong. Basically these are the cases:

In practice, in Rust parsing just the IP address using STD is possible to figure out if it's IPv4 or IPv6, but it's nice to have a complete documentation of what RTPProxy returns.

I am closing this ticket, but would be nice to get a confirmation from @sobomax

sobomax commented 2 years ago

@vasilakisfil thanks for your interest and sorry for a delay with the reply. The situation with the "IP" in the response is somewhat convoluted. It stems from the fact that initially both RTPProxy and control protocol had no notion of listening on a specific IP along with the fact that rtpproxy was supposed to run on the same machine as Kamailio/OpenSIPS. In this the most simplistic mode of operation the RTPproxy would use bind(INADDR_ANY) for its RTP/RTCP ports allowing call control component to pick whatever IP it deems the most appropriate.

As the time went on, it became clear that in multi-homed scenarios as well as in cases when RTPproxy is running on a separate node it needs to communicate both IP and port back to the call controller. Perhaps I will have to review this situation and see if the behavior can be collapsed to a single case somehow.