diff --git a/daemon/call.c b/daemon/call.c index 15545f10a..9f4886f2c 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -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; diff --git a/daemon/sdp.c b/daemon/sdp.c index 871e2f753..a7c7bf55c 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -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 { diff --git a/include/call.h b/include/call.h index 95c5ac2cc..e44030379 100644 --- a/include/call.h +++ b/include/call.h @@ -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;