MT#55283 look up remote address via subscriptions

Instead of carrying along an extra entry for the remote address, use the
existing advertised_endpoint, and look up the appropriate peer via media
subscriptions when printing the SDP.

Change-Id: I4c79053ba0fe072562ad71eb62ece3c527008936
pull/1838/head
Richard Fuchs 1 year ago
parent 14b7569b1c
commit 25f966ad44

@ -2881,15 +2881,6 @@ static void __media_init_from_flags(struct call_media *other_media, struct call_
media->desired_family = sp->desired_family;
}
/* desired endpoint's address */
other_media->desired_address = NULL;
if (media)
media->desired_address = NULL;
if (sp->rtp_endpoint.address.family) {
other_media->desired_address = &sp->rtp_endpoint.address;
if (media)
media->desired_address = &sp->rtp_endpoint.address;
}
/* desired bandwidth */
other_media->desired_bandwidth_as = sp->media_session_as;

@ -3508,9 +3508,11 @@ static void sdp_out_add_media_connection(GString *out, struct call_media *media,
const char *media_conn_address_type = rtp_ps->selected_sfd->local_intf->advertised_address.addr.family->rfc_name;
/* we want to keep an original media connection for message / force relay */
if (media->desired_address && (media->type_id == MT_MESSAGE || flags->ice_option == ICE_FORCE_RELAY))
struct media_subscription *ms = media->media_subscriptions.head ? media->media_subscriptions.head->data : NULL;
if (ms && ms->media && ms->media->streams.head && (media->type_id == MT_MESSAGE || flags->ice_option == ICE_FORCE_RELAY))
{
media_conn_address = sockaddr_print_buf(media->desired_address);
__auto_type sub_ps = ms->media->streams.head->data;
media_conn_address = sockaddr_print_buf(&sub_ps->advertised_endpoint.address);
media_conn_address_type = media->desired_family->rfc_name;
}
else {

@ -505,7 +505,6 @@ struct call_media {
const struct transport_protocol *protocol;
str format_str;
sockfamily_t *desired_family;
sockaddr_t *desired_address;
const struct logical_intf *logical_intf;
struct ice_agent *ice_agent;

Loading…
Cancel
Save