Browse Source

TT#94201 add explicit passthrough flags

Change-Id: Ib5015011320490c0bf63b3c8bed9e6caadfa8953
pull/1099/head
Richard Fuchs 5 years ago
parent
commit
e67eb7b57f
3 changed files with 42 additions and 1 deletions
  1. +13
    -0
      daemon/call.c
  2. +26
    -0
      daemon/call_interfaces.c
  3. +3
    -1
      include/call_interfaces.h

+ 13
- 0
daemon/call.c View File

@ -1245,6 +1245,19 @@ static void __ice_offer(const struct sdp_ng_flags *flags, struct call_media *thi
if (flags->ice_remove)
MEDIA_CLEAR(this, ICE);
if (flags->passthrough_on) {
ilog(LOG_DEBUG, "enabling passthrough mode");
MEDIA_SET(this, PASSTHRU);
MEDIA_SET(other, PASSTHRU);
return;
}
if (flags->passthrough_off) {
ilog(LOG_DEBUG, "disabling passthrough mode");
MEDIA_CLEAR(this, PASSTHRU);
MEDIA_CLEAR(other, PASSTHRU);
return;
}
if (!flags->ice_force) {
/* special case: if doing ICE on both sides and ice_force is not set, we cannot
* be sure that media will pass through us, so we have to disable certain features */


+ 26
- 0
daemon/call_interfaces.c View File

@ -825,6 +825,12 @@ static void call_ng_flags_flags(struct sdp_ng_flags *out, str *s, void *dummy) {
case CSH_LOOKUP("pad-crypto"):
out->sdes_pad = 1;
break;
case CSH_LOOKUP("passthrough"):
out->passthrough_on = 1;
break;
case CSH_LOOKUP("no-passthrough"):
out->passthrough_off = 1;
break;
default:
// handle values aliases from other dictionaries
if (call_ng_flags_prefix(out, s, "SDES-no-", call_ng_flags_str_ht, &out->sdes_no))
@ -971,6 +977,26 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *inpu
}
}
if (bencode_dictionary_get_str(input, "passthrough", &s)) {
switch (__csh_lookup(&s)) {
case CSH_LOOKUP("on"):
case CSH_LOOKUP("yes"):
case CSH_LOOKUP("enable"):
case CSH_LOOKUP("enabled"):
out->passthrough_on = 1;
break;
case CSH_LOOKUP("no"):
case CSH_LOOKUP("off"):
case CSH_LOOKUP("disable"):
case CSH_LOOKUP("disabled"):
out->passthrough_off = 1;
break;
default:
ilog(LOG_WARN, "Unknown 'passthrough' flag encountered: '"STR_FORMAT"'",
STR_FMT(&s));
}
}
call_ng_flags_list(out, input, "rtcp-mux", call_ng_flags_rtcp_mux, NULL);
call_ng_flags_list(out, input, "SDES", ng_sdes_option, NULL);
call_ng_flags_list(out, input, "OSRTP", ng_osrtp_option, NULL);


+ 3
- 1
include/call_interfaces.h View File

@ -105,7 +105,9 @@ struct sdp_ng_flags {
sdes_lifetime:1,
sdes_pad:1,
drop_traffic_start:1,
drop_traffic_stop:1;
drop_traffic_stop:1,
passthrough_on:1,
passthrough_off:1;
};


Loading…
Cancel
Save