diff --git a/daemon/call.c b/daemon/call.c index 91d5da86d..d9f60782c 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -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); } diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index b71e9be45..3fb4df250 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -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) { diff --git a/daemon/sdp.c b/daemon/sdp.c index f8f18a484..1e8dd1b7f 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -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); diff --git a/include/call.h b/include/call.h index e895e72ff..1ff01f53f 100644 --- a/include/call.h +++ b/include/call.h @@ -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; diff --git a/include/call_interfaces.h b/include/call_interfaces.h index ebf7f7c5d..aa56d2f4a 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -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 diff --git a/perl/NGCP/Rtpengine/AutoTest.pm b/perl/NGCP/Rtpengine/AutoTest.pm index 4182346c1..1aa9cbae3 100644 --- a/perl/NGCP/Rtpengine/AutoTest.pm +++ b/perl/NGCP/Rtpengine/AutoTest.pm @@ -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; diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index f0b5a9a69..70034e90b 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -20265,7 +20265,7 @@ rtpe_req('delete', "delete", { 'from-tag' => ft() }); new_call; -offer('multiple group attributes (broken)', { ICE => 'force-relay' }, < 'force-relay' }, < 'force-relay' }, < 'force-relay' }, <