MT#55283 support bidirectional publish

Change-Id: I530dbe297e839560055da94911a73e7c14e08dc0
pull/2087/head
Richard Fuchs 3 months ago
parent aa5413d3bb
commit 12f935db9c

@ -4334,8 +4334,11 @@ int monologue_publish(struct call_monologue *ml, sdp_streams_q *streams, sdp_ng_
if (codec_store_accept_one(&media->codecs, &flags->codec_accept, !!flags->accept_any))
return -1;
// the most we can do is receive
// we can definitely receive if needed
bf_copy(&media->media_flags, MEDIA_FLAG_RECV, &sp->sp_flags, SP_FLAG_SEND);
// and also send if so desired
if (flags->bidirectional)
bf_copy(&media->media_flags, MEDIA_FLAG_SEND, &sp->sp_flags, SP_FLAG_RECV);
if (sp->rtp_endpoint.port) {
__dtls_logic(flags, media, sp);

@ -1110,6 +1110,9 @@ void call_ng_flags_flags(str *s, unsigned int idx, helper_arg arg) {
case CSH_LOOKUP("player"):
out->audio_player = AP_TRANSCODING;
break;
case CSH_LOOKUP("bidirectional"):
out->bidirectional = true;
break;
case CSH_LOOKUP("block-dtmf"):
case CSH_LOOKUP("block-DTMF"):
case CSH_LOOKUP("block dtmf"):

@ -1043,6 +1043,11 @@ Spaces in each string may be replaced by hyphens.
Corresponds to the *rtpproxy* `a` flag. Advertises an RTP endpoint which uses asymmetric
RTP, which disables learning of endpoint addresses (see below).
* `bidirectional`
For `publish` messages, support bidirectional media flow, i.e. don't
respond with `recvonly` media but instead respond with `sendrecv`.
* `block DTMF`
Useful in `offer` or `answer` messages to immdiately enable DTMF blocking

@ -298,6 +298,7 @@ RTPE_NG_FLAGS_STR_CASE_HT_PARAMS
nat_wait:1,
pierce_nat:1,
directional:1,
bidirectional:1,
fatal:1,
new_branch:1,
provisional:1,

@ -4339,5 +4339,58 @@ is($resp->{interfaces}[1]{ports}{used}, 2, 'port usage');
new_call;
publish('sendrecv pub control',
{ }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
a=s-dummy
a=s-foo:bar
a=s-baz:quux blah
m=audio 6642 RTP/AVP 0 8 9
c=IN IP4 198.51.100.17
a=sendrecv
----------------------------------
v=0
o=- SDP_VERSION IN IP4 203.0.113.1
s=RTPE_VERSION
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=recvonly
a=rtcp:PORT
SDP
new_call;
publish('sendrecv pub',
{ flags => ['bidirectional'] }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
a=s-dummy
a=s-foo:bar
a=s-baz:quux blah
m=audio 6644 RTP/AVP 0 8 9
c=IN IP4 198.51.100.17
a=sendrecv
----------------------------------
v=0
o=- SDP_VERSION IN IP4 203.0.113.1
s=RTPE_VERSION
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
done_testing();
#done_testing;NGCP::Rtpengine::AutoTest::terminate('f00');exit;

Loading…
Cancel
Save