Add rtcp-mux support

This commit adds support for RFC 5761: Multiplexing RTP Data and Control
Packets on a Single Port. Specifically, it enables the feature when
using chan_pjsip.

A new option, "rtcp_mux" has been added to endpoint configuration in
pjsip.conf. If set, then Asterisk will attempt to use rtcp-mux with
whatever it communicates with. Asterisk follows the rules set forth in
RFC 5761 with regards to falling back to standard RTCP behavior if the
far end does not indicate support for rtcp-mux.

The lion's share of the changes in this commit are in
res_rtp_asterisk.c. This is because it was pretty much hard wired to
have an RTP and an RTCP transport. The strategy used here is that when
rtcp-mux is enabled, the current RTCP transport and its trappings (such
as DTLS SSL session) are freed, and the RTCP session instead just
mooches off the RTP session. This leads to a lot of specialized if
statements throughout.

ASTERISK-26732 #close
Reported by Dan Jenkins

Change-Id: If46a93ba1282418d2803e3fd7869374da8b77ab5
This commit is contained in:
Mark Michelson
2017-03-07 14:13:02 -06:00
parent 947f1ebf86
commit 7bc69753bc
10 changed files with 385 additions and 125 deletions

View File

@@ -944,6 +944,16 @@
to the receiving one.
</para></description>
</configOption>
<configOption name="rtcp_mux" default="no">
<synopsis>Enable RFC 5761 RTCP multiplexing on the RTP port</synopsis>
<description><para>
With this option enabled, Asterisk will attempt to negotiate the use of the "rtcp-mux"
attribute on all media streams. This will result in RTP and RTCP being sent and received
on the same port. This shifts the demultiplexing logic to the application rather than
the transport layer. This option is useful when interoperating with WebRTC endpoints
since they mandate this option's use.
</para></description>
</configOption>
</configObject>
<configObject name="auth">
<synopsis>Authentication type</synopsis>