diff --git a/README.md b/README.md index d9799e6f9..0975f8ace 100644 --- a/README.md +++ b/README.md @@ -790,6 +790,10 @@ Optionally included keys are: Add `a=mid` attributes to the outgoing SDP if they were not already present. + - `strip extmap` + + Remove `a=rtpmap` attributes from the outgoing SDP. + - `original sendrecv` With this flag present, *rtpengine* will leave the media direction attributes diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 89411f809..dfa8e3012 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -815,6 +815,9 @@ static void call_ng_flags_flags(struct sdp_ng_flags *out, str *s, void *dummy) { case CSH_LOOKUP("generate-mid"): out->generate_mid = 1; break; + case CSH_LOOKUP("strip-extmap"): + out->strip_extmap = 1; + break; case CSH_LOOKUP("record-call"): out->record_call = 1; break; diff --git a/daemon/sdp.c b/daemon/sdp.c index d5ed5fab3..72f6f995f 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2061,6 +2061,10 @@ static int process_session_attributes(struct sdp_chopper *chop, struct sdp_attri goto strip; case ATTR_EXTMAP: + if (flags->strip_extmap) + goto strip; + break; + case ATTR_FINGERPRINT: case ATTR_SETUP: case ATTR_IGNORE: @@ -2173,6 +2177,12 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media * break; case ATTR_EXTMAP: + if (MEDIA_ISSET(media, PASSTHRU)) + break; + if (flags->strip_extmap) + goto strip; + break; + case ATTR_CRYPTO: case ATTR_FINGERPRINT: case ATTR_SETUP: diff --git a/include/call_interfaces.h b/include/call_interfaces.h index 428387d14..be19de40e 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -98,6 +98,7 @@ struct sdp_ng_flags { generate_rtcp:1, generate_rtcp_off:1, generate_mid:1, + strip_extmap:1, strict_source:1, media_handover:1, dtls_passive:1, diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 3ebf93387..84a02f84c 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -9786,6 +9786,57 @@ rcv($sock_b, $port_a, rtpm(0, 1022, 5880, $ssrc, "\x00" x 160)); +# extmap stripping + +new_call; + +offer('strip extmap control', { }, < ['strip extmap'] }, <