Browse Source

TT#89352 add option to strip a:extmap

closes #1271

Change-Id: I17e177b96983798f693f162c45643b5a82258278
pull/1346/head
Richard Fuchs 4 years ago
parent
commit
f0b1906809
5 changed files with 69 additions and 0 deletions
  1. +4
    -0
      README.md
  2. +3
    -0
      daemon/call_interfaces.c
  3. +10
    -0
      daemon/sdp.c
  4. +1
    -0
      include/call_interfaces.h
  5. +51
    -0
      t/auto-daemon-tests.pl

+ 4
- 0
README.md View File

@ -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


+ 3
- 0
daemon/call_interfaces.c View File

@ -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;


+ 10
- 0
daemon/sdp.c View File

@ -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:


+ 1
- 0
include/call_interfaces.h View File

@ -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,


+ 51
- 0
t/auto-daemon-tests.pl View File

@ -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', { }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 2000 RTP/AVP 0
c=IN IP4 198.51.100.1
a=extmap:0 foobar
a=sendrecv
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=extmap:0 foobar
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
SDP
new_call;
offer('strip extmap', { flags => ['strip extmap'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 2000 RTP/AVP 0
c=IN IP4 198.51.100.1
a=extmap:0 foobar
a=sendrecv
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
SDP
# SDP in/out tests, various ICE options
new_call;


Loading…
Cancel
Save