Browse Source

MT#60403 bandwidth: add support of `b=TIAS:` attr

Add RFC compatible TIAS bandwidth attribute.

Change-Id: Id16d39ca0518215833f26195dc841ced31caeb11
rfuchs/test
Donat Zenichev 1 year ago
parent
commit
ea68824d5d
3 changed files with 11 additions and 1 deletions
  1. +2
    -0
      daemon/call.c
  2. +7
    -0
      daemon/sdp.c
  3. +2
    -1
      include/call.h

+ 2
- 0
daemon/call.c View File

@ -2677,6 +2677,8 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct c
ml->sdp_session_bandwidth.rs = flags->session_bandwidth.rs;
if (flags->session_bandwidth.ct >= 0)
ml->sdp_session_bandwidth.ct = flags->session_bandwidth.ct;
if (flags->session_bandwidth.tias >= 0)
ml->sdp_session_bandwidth.tias = flags->session_bandwidth.tias;
}
// reset offer ipv4/ipv6/mixed media stats


+ 7
- 0
daemon/sdp.c View File

@ -1372,6 +1372,9 @@ new_session:
else if (!memcmp(value, "RS:", 3)) {
*(media ? &media->bandwidth.rs : &session->bandwidth.rs) = strtol((value + 3), NULL, 10);
}
else if (!memcmp(value, "TIAS:", 5)) {
*(media ? &media->bandwidth.tias : &session->bandwidth.tias) = strtol((value + 5), NULL, 10);
}
/* CT has only session level */
else if (!memcmp(value, "CT:", 3)) {
session->bandwidth.ct = strtol((value + 3), NULL, 10);
@ -3645,6 +3648,8 @@ static void sdp_out_add_bandwidth(GString *out, struct call_monologue *monologue
g_string_append_printf(out, "b=RR:%ld\r\n", ms->media->sdp_media_bandwidth.rr);
if (ms->media->sdp_media_bandwidth.rs >= 0)
g_string_append_printf(out, "b=RS:%ld\r\n", ms->media->sdp_media_bandwidth.rs);
if (ms->media->sdp_media_bandwidth.tias >= 0)
g_string_append_printf(out, "b=TIAS:%ld\r\n", ms->media->sdp_media_bandwidth.tias);
}
else {
/* sdp bandwidth per session/media level
@ -3660,6 +3665,8 @@ static void sdp_out_add_bandwidth(GString *out, struct call_monologue *monologue
g_string_append_printf(out, "b=RS:%ld\r\n", ms->monologue->sdp_session_bandwidth.rs);
if (ms->monologue->sdp_session_bandwidth.ct >= 0)
g_string_append_printf(out, "b=CT:%ld\r\n", ms->monologue->sdp_session_bandwidth.ct);
if (ms->monologue->sdp_session_bandwidth.tias >= 0)
g_string_append_printf(out, "b=TIAS:%ld\r\n", ms->monologue->sdp_session_bandwidth.tias);
}
}


+ 2
- 1
include/call.h View File

@ -85,6 +85,7 @@ enum message_type {
union_var.rr = value; \
union_var.rs = value; \
union_var.ct = value; \
union_var.tias = value; \
} while(0)
enum call_media_counted {
@ -326,7 +327,7 @@ TYPED_GHASHTABLE(subscription_ht, struct call_media, subscription_list, media_di
NULL, NULL)
struct session_bandwidth {
long as, rr, rs, ct;
long as, rr, rs, ct, tias;
};
struct codec_store {


Loading…
Cancel
Save