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
414 stars 114 forks source link

Not reserving RTCP Port #81

Open albertpv opened 5 years ago

albertpv commented 5 years ago

The RTPProxy is performing reservation for two RTP Ports on each session (one for RTP and one for RTCP). Is there any elegant way to disable the reservation of RTCP Port ?

Our solution does not use/announce RTCP hence skipping that port would be appreciated.

albertpv commented 5 years ago

Any feedback? (Is there a mailing list to address the question?¿)

razvancrainea commented 5 years ago

No, unfortunately there is no way to disable reservation of RTCP port. Perhaps you should flag this ticket as a feature request.

albertpv commented 5 years ago

Ok we can flag as feature request and in fact if i understand how to achieve this would have no problem to share with the community (maybe best would be as a define in makefile)

anyway in order to achieve this i tried removing any rtcp references in this file https://github.com/sippy/rtpproxy/blob/master/src/rtpp_session.c and recompile the project.

But still sawing both rtp and rtcp ports reserved when a session is created. What i would be missing to achieve it?

sobomax commented 5 years ago

@albertpv could be easy, indeed. What you are missing here is that the RTCP port reservation is done deep inside the session creation code, so that you cannot decouple it from the RTP at higher level. It is done this way because it's easier: as we needed to allocate a consecutive pair (port, port+1). If we would allocate high-level RTP session and initialize it first, and then do the same for RTCP and the second part fails with EADDRINUSE we would have to tear down first and re-do. It is getting hairy as session initialization plugs into all sorts of places. Not impossible, but bit wasteful and just never occurred to us that somebody might want this.

So you are looking at tweaking create_twinlistener() function in the rtpp_command.c module to actually disable that port allocation.

My approach would be maybe making a dummy class with interface matching the rtpp_socket_ctor(), and construct that instead when i==1 (i.e. RTCP).