Browse Source

MT#55283 add tests for new SDP removal option

and document them

Change-Id: I55914a9e9d0197e9a8c9036685f974d1eb7e8dfd
pull/1786/head
Richard Fuchs 2 years ago
parent
commit
192a7ddf24
2 changed files with 148 additions and 4 deletions
  1. +14
    -4
      docs/ng_control_protocol.md
  2. +134
    -0
      t/auto-daemon-tests.pl

+ 14
- 4
docs/ng_control_protocol.md View File

@ -1312,8 +1312,11 @@ Description:
Removes a specified `a=` line from the concerned attributes list. Removes a specified `a=` line from the concerned attributes list.
If such line hasn't been found, then the attributes list remains untouched. If such line hasn't been found, then the attributes list remains untouched.
The matching is done using the full attribute line (value and the following attribute parameters, if given).
Prefix-based matching is not supported.
The matching can be done using just the attribute name, or the
attribute name plus a tag value, or the full attribute line (value and
the following attribute parameters, if given). For example, the
attribute `a=foo:bar baz quuz` would match any of `foo`, foo:bar`, or
`foo:bar baz quuz`.
Can take multiple values (so multiple attributes can removed per one command). Can take multiple values (so multiple attributes can removed per one command).
@ -1322,8 +1325,15 @@ Description:
Substitutes a specified `a=` line taken from the concerned media attributes list. Substitutes a specified `a=` line taken from the concerned media attributes list.
If such line hasn't been found, then the attributes list remains untouched. If such line hasn't been found, then the attributes list remains untouched.
The matching is done using the full attribute line (value and the following attribute parameters, if given).
Prefix-based matching is not supported.
The matching can be done using just the attribute name, or the
attribute name plus a tag value, or the full attribute line (value and
the following attribute parameters, if given). If the attribute is
generated by *rtpengine* itself and a tag value is present, then the
tag value must also be used in the match pattern. For example, the
attribute `a=foo:bar baz quuz` would match any of `foo`, foo:bar`, or
`foo:bar baz quuz`, but the self-generated attribute `a=fmtp:10 foobar`
could only be substituted using either `fmtp:10` or `fmtp:10 foobar`
but not just `fmtp`.
Substitutes one attribute at a time, so one attribute into another attribute. Substitutes one attribute at a time, so one attribute into another attribute.
Read more about that below in the `<value>` section. Read more about that below in the `<value>` section.


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

@ -18484,6 +18484,34 @@ SDP
new_call; new_call;
offer('SDP attr manipulations - substitute a=fmtp line for media audio', { ICE => 'remove', DTLS => 'off', SDES => [ 'nonew' ], flags => ['sdp-attr-substitute-audio-fmtp:101>fmtp:101..0-15,32,36'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 2000 RTP/SAVP 0 101
c=IN IP4 198.51.100.1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/SAVP 0 101
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15,32,36
a=sendrecv
a=rtcp:PORT
a=ptime:20
SDP
new_call;
offer('SDP attr manipulations - remove a=fmtp line for media audio', { ICE => 'remove', DTLS => 'off', SDES => [ 'nonew' ], flags => ['sdp-attr-remove-audio-fmtp:101..0-16'] }, <<SDP); offer('SDP attr manipulations - remove a=fmtp line for media audio', { ICE => 'remove', DTLS => 'off', SDES => [ 'nonew' ], flags => ['sdp-attr-remove-audio-fmtp:101..0-16'] }, <<SDP);
v=0 v=0
o=- 1545997027 1 IN IP4 198.51.100.1 o=- 1545997027 1 IN IP4 198.51.100.1
@ -18530,6 +18558,112 @@ a=rtcp:PORT
a=ptime:20 a=ptime:20
SDP SDP
new_call;
offer('SDP attr manipulations - remove a=fmtp line for media audio', { ICE => 'remove', DTLS => 'off', SDES => [ 'nonew' ], flags => ['sdp-attr-remove-audio-fmtp:101'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 2000 RTP/SAVP 0 101
c=IN IP4 198.51.100.1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/SAVP 0 101
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv
a=rtcp:PORT
a=ptime:20
SDP
new_call;
offer('SDP attr manipulations - remove a=fmtp line for media audio', { ICE => 'remove', DTLS => 'off', SDES => [ 'nonew' ], flags => ['sdp-attr-remove-audio-fmtp', 'sdp-attr-remove-audio-rtpmap'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 2000 RTP/SAVP 0 101
c=IN IP4 198.51.100.1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/SAVP 0 101
c=IN IP4 203.0.113.1
a=sendrecv
a=rtcp:PORT
a=ptime:20
SDP
new_call;
offer('SDP attr manipulations - remove sendrecv, rtcp, ptime', { ICE => 'remove', DTLS => 'off', SDES => [ 'nonew' ], flags => ['sdp-attr-remove-audio-sendrecv', 'sdp-attr-remove-audio-rtcp', 'sdp-attr-remove-audio-ptime'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio 2000 RTP/SAVP 0 101
c=IN IP4 198.51.100.1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
m=audio PORT RTP/SAVP 0 101
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
SDP
new_call;
offer('SDP attr manipulations - remove global attrs', { ICE => 'remove', DTLS => 'off', SDES => [ 'nonew' ], flags => ['sdp-attr-remove-global-something', 'sdp-attr-remove-global-rather', 'sdp-attr-remove-global-or'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
a=something
a=rather:else
a=or:some such
a=untouched
m=audio 2000 RTP/SAVP 0
c=IN IP4 198.51.100.1
----------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
a=untouched
m=audio PORT RTP/SAVP 0
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
SDP
# codec masking gh#664 # codec masking gh#664
new_call; new_call;


Loading…
Cancel
Save