add rtcp-mux-require option to force rtcp-mux usage for WebRTC

fixes #404

Change-Id: I4a5dbf30a7c02058216ea7e8c8782cf83e214623
pull/416/head
Richard Fuchs 8 years ago
parent 0c6b2cfc22
commit cc056c148f

@ -1018,6 +1018,12 @@ Optionally included keys are:
Instructs *rtpengine* to always offer rtcp-mux, even if the client itself doesn't offer it.
- `require`
Similar to `offer` but pretends that the receiving client has already accepted rtcp-mux.
The effect is that no separate RTCP ports will be advertised, even in an initial offer
(which is against RFC 5761). This option is provided to talk to WebRTC clients.
- `demux`
If the client is offering rtcp-mux, don't offer it to the other side, but accept it back to

@ -1275,7 +1275,7 @@ static void __rtcp_mux_logic(const struct sdp_ng_flags *flags, struct call_media
if (!MEDIA_ISSET(media, RTCP_MUX))
bf_copy_same(&media->media_flags, &other_media->media_flags, MEDIA_FLAG_RTCP_MUX);
/* in our offer, we can override the client's choice */
if (flags->rtcp_mux_offer)
if (flags->rtcp_mux_offer || flags->rtcp_mux_require)
MEDIA_SET(media, RTCP_MUX);
else if (flags->rtcp_mux_demux)
MEDIA_CLEAR(media, RTCP_MUX);

@ -622,6 +622,8 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *inpu
for (it = list->child; it; it = it->sibling) {
if (!bencode_strcmp(it, "offer"))
out->rtcp_mux_offer = 1;
else if (!bencode_strcmp(it, "require"))
out->rtcp_mux_require = 1;
else if (!bencode_strcmp(it, "demux"))
out->rtcp_mux_demux = 1;
else if (!bencode_strcmp(it, "accept"))

@ -43,6 +43,7 @@ struct sdp_ng_flags {
ice_force:1,
ice_force_relay:1,
rtcp_mux_offer:1,
rtcp_mux_require:1,
rtcp_mux_demux:1,
rtcp_mux_accept:1,
rtcp_mux_reject:1,

@ -1993,7 +1993,11 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu
chopper_append_c(chop, "a=inactive\r\n");
if (call_media->protocol && call_media->protocol->rtp) {
if (MEDIA_ISSET(call_media, RTCP_MUX) && flags->opmode == OP_ANSWER) {
if (MEDIA_ISSET(call_media, RTCP_MUX)
&& (flags->opmode == OP_ANSWER
|| (flags->opmode == OP_OFFER
&& flags->rtcp_mux_require)))
{
chopper_append_c(chop, "a=rtcp:");
chopper_append_printf(chop, "%u", ps->selected_sfd->socket.local.port);
chopper_append_c(chop, "\r\na=rtcp-mux\r\n");

Loading…
Cancel
Save