Browse Source

MT#60476 print_sdp_media_section: refactor inactive streams

Refactor inactive streams handling (non-accepted media) so,
that they get also labels being printed.

Change-Id: I6627aba77a5f391f797762202eb4f0977bc0fc4a
pull/1870/head
Donat Zenichev 1 year ago
parent
commit
72416e074a
2 changed files with 11 additions and 16 deletions
  1. +10
    -16
      daemon/sdp.c
  2. +1
    -0
      t/auto-daemon-tests.pl

+ 10
- 16
daemon/sdp.c View File

@ -2630,7 +2630,9 @@ static void print_sdp_media_section(GString *s, struct call_media *media,
struct packet_stream *rtp_ps,
packet_stream_list *rtp_ps_link, sdp_ng_flags *flags)
{
struct call_monologue *monologue = media->monologue;
struct packet_stream *ps_rtcp = NULL;
bool inactive_media = (!address || !address->port || !rtp_ps->selected_sfd); /* audio is accepted? */
if (source_media) {
/* just print out all original values and attributes */
@ -2638,31 +2640,23 @@ static void print_sdp_media_section(GString *s, struct call_media *media,
return;
}
/* add attributes and connection information only when audio is accepted */
if (!address || !address->port || !rtp_ps->selected_sfd) {
/* print zeroed address for the non accepted media, see RFC 3264 */
sdp_out_add_media_connection(s, media, rtp_ps, NULL, flags);
/* just add the mid before finalizing (see #1361 and #1362). */
if (media->media_id.s)
append_attr_to_gstring(s, "mid", &media->media_id, flags, media->type_id);
return;
}
struct call_monologue *monologue = media->monologue;
/* add actual media connection */
sdp_out_add_media_connection(s, media, rtp_ps, &address->address, flags);
/* add actual media connection
* print zeroed address for the non accepted media, see RFC 3264 */
sdp_out_add_media_connection(s, media, rtp_ps, (inactive_media ? NULL : &address->address), flags);
/* add per media bandwidth */
sdp_out_add_bandwidth(s, monologue, media);
/* mid and label must be added even for inactive streams (see #1361 and #1362). */
if (media->media_id.s)
append_attr_to_gstring(s, "mid", &media->media_id, flags, media->type_id);
if (media->label.len && flags->siprec)
append_attr_to_gstring(s, "label", &media->label, flags, media->type_id);
/* nothing more to be printed for inactive stream (non-accepted media session) */
if (inactive_media)
return;
if (proto_is_rtp(media->protocol))
insert_codec_parameters(s, media, flags);


+ 1
- 0
t/auto-daemon-tests.pl View File

@ -648,6 +648,7 @@ a=rtcp:PORT
a=ptime:20
m=video 0 RTP/AVP 99 97 126 123
c=IN IP6 ::
b=TIAS:5952000
a=mid:2
m=application 0 RTP/SAVP 96
c=IN IP4 0.0.0.0


Loading…
Cancel
Save