Skip to content

Commit

Permalink
Add support MRCPv2 proto
Browse files Browse the repository at this point in the history
  • Loading branch information
hateeyan authored and Sean-Der committed Dec 17, 2024
1 parent ca99278 commit d5f4801
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ func unmarshalMediaDescription(l *lexer) (stateFn, error) {
// https://tools.ietf.org/html/rfc4566#section-5.14
// https://tools.ietf.org/html/rfc4975#section-8.1
for _, proto := range strings.Split(field, "/") {
if !anyOf(proto, "UDP", "RTP", "AVP", "SAVP", "SAVPF", "TLS", "DTLS", "SCTP", "AVPF", "TCP", "MSRP", "BFCP", "UDT", "IX") {
if !anyOf(proto, "UDP", "RTP", "AVP", "SAVP", "SAVPF", "TLS", "DTLS", "SCTP", "AVPF", "TCP", "MSRP", "BFCP", "UDT", "IX", "MRCPv2") {
return nil, fmt.Errorf("%w `%v`", errSDPInvalidNumericValue, field)
}
newMediaDesc.MediaName.Protos = append(newMediaDesc.MediaName.Protos, proto)
Expand Down
14 changes: 14 additions & 0 deletions unmarshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ const (
"a=ixmap:0 ping\r\n" +
"a=ixmap:2 xccp\r\n"

MediaTCPMRCPv2 = TimingSDP +
"m=application 1544 TCP/MRCPv2 1\r\n"

MediaTCPTLSMRCPv2 = TimingSDP +
"m=application 1544 TCP/TLS/MRCPv2 1\r\n"

CanonicalUnmarshalSDP = "v=0\r\n" +
"o=jdoe 2890844526 2890842807 IN IP4 10.47.16.5\r\n" +
"s=SDP Seminar\r\n" +
Expand Down Expand Up @@ -320,6 +326,14 @@ func TestRoundTrip(t *testing.T) {
Name: "MediaCubeSDP",
SDP: MediaCubeSDP,
},
{
Name: "MediaTCPMRCPv2",
SDP: MediaTCPMRCPv2,
},
{
Name: "MediaTCPTLSMRCPv2",
SDP: MediaTCPTLSMRCPv2,
},
} {
test := test
t.Run(test.Name, func(t *testing.T) {
Expand Down

0 comments on commit d5f4801

Please sign in to comment.