Skip to content

Commit

Permalink
MT#55283 allow rejection of first m=
Browse files Browse the repository at this point in the history
Fix zero c= line when first m= line has a zero port.

Add matching tests.

Change-Id: I1472b8101ffb3647e6aa092995672788510ee117
(cherry picked from commit 5b69e41)
  • Loading branch information
rfuchs committed Sep 23, 2024
1 parent 77782d6 commit 28a2f02
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daemon/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3263,7 +3263,9 @@ int sdp_replace(struct sdp_chopper *chop, sdp_sessions_q *sessions,
if (!call_media->streams.head)
continue;
ps = call_media->streams.head->data;
break;
if (ps->selected_sfd)
break;
ps = NULL;
}

err = "no usable session media stream";
Expand Down
106 changes: 106 additions & 0 deletions t/auto-daemon-tests.pl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,112 @@ sub stun_succ {



new_call;

offer('reject first stream, session c=', { }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
c=IN IP4 198.51.100.50
t=0 0
m=audio 3000 RTP/AVP 8
a=sendrecv
m=audio 4000 RTP/AVP 8
a=sendrecv
----------------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
m=audio PORT RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP

answer('reject first stream, session c=', { }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
c=IN IP4 198.51.100.50
t=0 0
m=audio 0 RTP/AVP 8
a=sendrecv
m=audio 5000 RTP/AVP 8
a=sendrecv
----------------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
c=IN IP4 203.0.113.1
t=0 0
m=audio 0 RTP/AVP 8
m=audio PORT RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP

offer('reject first stream, media c=', { }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio 3000 RTP/AVP 8
c=IN IP4 198.51.100.50
a=sendrecv
m=audio 4000 RTP/AVP 8
c=IN IP4 198.51.100.50
a=sendrecv
----------------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio PORT RTP/AVP 8
c=IN IP4 203.0.113.1
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
m=audio PORT RTP/AVP 8
c=IN IP4 203.0.113.1
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP

answer('reject first stream, media c=', { }, <<SDP);
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio 0 RTP/AVP 8
c=IN IP4 198.51.100.50
a=sendrecv
m=audio 5000 RTP/AVP 8
c=IN IP4 198.51.100.50
a=sendrecv
----------------------------------------
v=0
o=- 1545997027 1 IN IP4 198.51.100.11
s=tester
t=0 0
m=audio 0 RTP/AVP 8
c=IN IP4 0.0.0.0
m=audio PORT RTP/AVP 8
c=IN IP4 203.0.113.1
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:PORT
SDP



new_call;

offer('mismatched t-e control', { }, <<SDP);
Expand Down

0 comments on commit 28a2f02

Please sign in to comment.