[Live-devel] Get IP address of redirected RTSP servers

Ross Finlayson finlayson at live555.com
Tue May 30 19:03:17 PDT 2023



> On May 30, 2023, at 6:13 PM, Liu, Eric via live-devel <live-devel at us.live555.com> wrote:
> 
> Since I don't see any "Source" or "source=" fields in any of the SETUP responses, would it be accurate to say that in this case the server is not replying with the "source=" parameter properly and we are not able to get the IP address through this method (with this server)?

Unfortunately, that’s correct.  Looking at RFC 2326 (the specification for RTSP), in section 12.39, I see:
    "source:
          If the source address for the stream is different than can be
          derived from the RTSP endpoint address (the server in playback
          or the client in recording), the source MAY be specified."

So yes, the “source” parameter is optional, even if - as in your case - the RTP packets’ source address is different from that of the server.  I would argue that this “MAY” in the specification should have been a “MUST”.

So, I have three possible solutions, in order:
1/ Can you modify your server to include the “source=“ parameter in the “SETUP” response (because it is choosing to send the stream from a different IP address)?
2/ If not, can you not do this redirection at all?
3/ If neither is the case, then unfortunately the only way I can see to get the IP source address of each RTP packet is to modify the LIVE555 library code.  Specifically, you could modify the "MultiFramedRTPSource::networkReadHandler1()” function (at line 248 of “MultiFramedRTPSource.cpp”) to use “fromAddress”.  But because you would be modifying the LIVE555 code, you’re on your own here.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list