TT#99621 add option to disable RTCP generation

Change-Id: Ifed6d255dd9d3ec5bc38a79a8f71da59d98243ea
pull/1183/head
Richard Fuchs 4 years ago
parent a19854d23f
commit ae82034dfe

@ -827,10 +827,15 @@ Optionally included keys are:
- `generate RTCP`
With this flag set, received RTCP packets will not simply be passed through as
usual, but instead will be consumed, and instead *rtpengine* will generate its own
RTCP packets to send to the RTP peers. This flag will be effective for both
sides of a call.
Identical to setting `generate RTCP = on`.
* `generate RTCP`
Contains a string, either `on` or `off`. If enabled for a call,
received RTCP packets will not simply be passed through as usual, but
instead will be consumed, and instead *rtpengine* will generate its own
RTCP packets to send to the RTP peers. This flag will be effective for
both sides of a call.
* `replace`

@ -2132,6 +2132,10 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams,
MEDIA_SET(media, RTCP_GEN);
MEDIA_SET(other_media, RTCP_GEN);
}
else if (flags && flags->generate_rtcp_off) {
MEDIA_CLEAR(media, RTCP_GEN);
MEDIA_CLEAR(other_media, RTCP_GEN);
}
__update_media_protocol(media, other_media, sp, flags);
__update_media_id(media, other_media, sp, flags);

@ -1111,6 +1111,13 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *inpu
}
#endif
}
if (bencode_get_alt(input, "generate-RTCP", "generate RTCP", &s)) {
if (!str_cmp(&s, "on"))
out->generate_rtcp = 1;
else if (!str_cmp(&s, "off"))
out->generate_rtcp_off = 1;
}
}
static void call_ng_free_flags(struct sdp_ng_flags *flags) {
if (flags->codec_strip)

@ -1186,9 +1186,11 @@ static void __rtcp_timer_run(struct timerthread_queue *q, void *p) {
log_info_call(rt->call);
if (!rtcp_timer.tv_sec || timeval_diff(&rtpe_now, &rtcp_timer) < 0 || !proto_is_rtp(media->protocol)) {
__rtcp_timer_free(rt);
if (!rtcp_timer.tv_sec || timeval_diff(&rtpe_now, &rtcp_timer) < 0 || !proto_is_rtp(media->protocol)
|| !MEDIA_ISSET(media, RTCP_GEN))
{
rwlock_unlock_w(&rt->call->master_lock);
__rtcp_timer_free(rt);
goto out;
}
timeval_add_usec(&rtcp_timer, 5000000 + (random() % 2000000));

@ -79,6 +79,7 @@ struct sdp_ng_flags {
no_rtcp_attr:1,
full_rtcp_attr:1,
generate_rtcp:1,
generate_rtcp_off:1,
generate_mid:1,
strict_source:1,
media_handover:1,

Loading…
Cancel
Save