Browse Source

MT#63317 support multiple a=group attrs

Change-Id: Icb2c00e1ca46fafbc8862fe6b9cf2aae4a62fbfa
rfuchs/dtls-ice
Richard Fuchs 4 months ago
parent
commit
16780ac17d
7 changed files with 28 additions and 12 deletions
  1. +5
    -1
      daemon/call.c
  2. +1
    -0
      daemon/call_interfaces.c
  3. +10
    -6
      daemon/sdp.c
  4. +1
    -1
      include/call.h
  5. +1
    -1
      include/call_interfaces.h
  6. +1
    -0
      perl/NGCP/Rtpengine/AutoTest.pm
  7. +9
    -3
      t/auto-daemon-tests.pl

+ 5
- 1
daemon/call.c View File

@ -2794,7 +2794,10 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct c
ml->sdp_session_bandwidth.rs = flags->session_bandwidth.rs;
ml->sdp_session_bandwidth.ct = flags->session_bandwidth.ct;
ml->sdp_session_bandwidth.tias = flags->session_bandwidth.tias;
ml->sdp_session_group = call_str_cpy(&flags->session_group);
t_queue_clear(&ml->groups_other);
for (__auto_type ll = flags->groups_other.head; ll; ll = ll->next)
t_queue_push_tail(&ml->groups_other, call_str_dup(ll->data));
ml->sdp_session_uri = call_str_cpy(&flags->session_uri);
ml->sdp_session_email = call_str_cpy(&flags->session_email);
@ -4577,6 +4580,7 @@ void __monologue_free(struct call_monologue *m) {
t_queue_clear_full(&m->all_attributes, sdp_attr_free);
t_queue_clear(&m->tag_aliases);
sdp_streams_clear(&m->last_in_sdp_streams);
t_queue_clear(&m->groups_other);
g_free(m);
}


+ 1
- 0
daemon/call_interfaces.c View File

@ -2427,6 +2427,7 @@ RTPE_NG_FLAGS_STR_CASE_HT_PARAMS
ng_sdp_attr_manipulations_free(flags->sdp_manipulations);
t_queue_clear_full(&flags->medias, ng_media_free);
t_queue_clear(&flags->groups_other);
}
static enum load_limit_reasons call_offer_session_limit(void) {


+ 10
- 6
daemon/sdp.c View File

@ -1941,9 +1941,11 @@ bool sdp_streams(const sdp_sessions_q *sessions, sdp_streams_q *streams, sdp_ng_
flags->session_email = session->email;
flags->session_phone = session->phone;
attr = attr_get_by_id(&session->attributes, ATTR_GROUP);
if (attr)
flags->session_group = attr->strs.value;
__auto_type attrs = attr_list_get_by_id(&session->attributes, ATTR_GROUP);
for (__auto_type ll = attrs ? attrs->head : NULL; ll; ll = ll->next) {
attr = ll->data;
t_queue_push_tail(&flags->groups_other, &attr->strs.value);
}
if (rtpe_config.moh_prevent_double_hold) {
attr = attr_get_by_id(&session->attributes, ATTR_MOH_ATTR_NAME);
@ -2009,7 +2011,7 @@ bool sdp_streams(const sdp_sessions_q *sessions, sdp_streams_q *streams, sdp_ng_
goto error;
/* a=crypto */
attributes_q *attrs = attr_list_get_by_id(&media->attributes, ATTR_CRYPTO);
attrs = attr_list_get_by_id(&media->attributes, ATTR_CRYPTO);
for (__auto_type ll = attrs ? attrs->head : NULL; ll; ll = ll->next) {
attr = ll->data;
struct crypto_params_sdes *cps = g_new0(__typeof(*cps), 1);
@ -3036,8 +3038,10 @@ static void sdp_out_add_other(GString *out, struct call_monologue *monologue,
append_null_attr_to_gstring(out, "ice-lite", flags, media->type_id);
/* group */
if (source_ml && source_ml->sdp_session_group.len && flags->ice_option == ICE_FORCE_RELAY)
append_attr_to_gstring(out, "group", &source_ml->sdp_session_group, flags, media->type_id);
if (source_ml && flags->ice_option == ICE_FORCE_RELAY) {
for (__auto_type ll = source_ml->groups_other.head; ll; ll = ll->next)
append_attr_to_gstring(out, "group", ll->data, flags, media->type_id);
}
/* carry other session level a= attributes to the outgoing SDP */
monologue->sdp_attr_print(out, monologue, flags);


+ 1
- 1
include/call.h View File

@ -621,7 +621,7 @@ struct call_monologue {
str sdp_session_name;
str sdp_session_timing;
str sdp_session_group; /* a=group: e.g. BUNDLE */
str_q groups_other; /* a=group:xxx */
str sdp_session_information;
str sdp_session_uri;
str sdp_session_phone;


+ 1
- 1
include/call_interfaces.h View File

@ -94,7 +94,7 @@ struct sdp_ng_flags {
str session_timing; /* t= line */
struct session_bandwidth session_bandwidth;
str session_group; /* a=group: e.g. BUNDLE */
str_q groups_other; /* a=group:xxx */
str session_information; // i= line
str session_uri; // u= line
str session_email; // e= line


+ 1
- 0
perl/NGCP/Rtpengine/AutoTest.pm View File

@ -169,6 +169,7 @@ sub sdp_match {
$regexp =~ s/SDP_VERSION/\\d+ \\d+/gs;
$regexp =~ s/RTPE_VERSION/rtpengine-\\S+/gs;
$regexp =~ s/TLS_ID/([0-9a-f]{32})/gs;
$regexp =~ s/BGROUPS/([\\d ]+)/gs;
my $crlf = crlf($sdp);
like $crlf, qr/$regexp/s, "$name - output '$cmd' SDP";
my @matches = $crlf =~ qr/$regexp/s;


+ 9
- 3
t/auto-daemon-tests.pl View File

@ -20265,7 +20265,7 @@ rtpe_req('delete', "delete", { 'from-tag' => ft() });
new_call;
offer('multiple group attributes (broken)', { ICE => 'force-relay' }, <<SDP);
offer('multiple group attributes', { ICE => 'force-relay' }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
@ -20281,6 +20281,7 @@ o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
a=group:foobar
a=group:blah 1 2 3
m=audio PORT RTP/AVP 0
c=IN IP4 198.51.100.14
a=sendrecv
@ -20291,7 +20292,7 @@ SDP
new_call;
offer('multiple group attributes w bundle (broken)', { ICE => 'force-relay' }, <<SDP);
my ($bg1, $bg2) = offer('multiple group attributes w bundle', { ICE => 'force-relay' }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
@ -20317,7 +20318,10 @@ v=0
o=- 1545997027 1 IN IP4 198.51.100.1
s=tester
t=0 0
a=group:BUNDLE 1
a=group:BUNDLE BGROUPS
a=group:BUNDLE BGROUPS
a=group:foobar
a=group:blah 1 2 3
m=audio 2000 RTP/AVP 0
c=IN IP4 198.51.100.14
a=sendrecv
@ -20332,6 +20336,8 @@ a=sendrecv
a=mid:3
SDP
ok(($bg1 eq '1' && $bg2 eq '2 3') || ($bg2 eq '1' && $bg1 eq '2 3'), 'groups ok');


Loading…
Cancel
Save