diff --git a/lib/grammar.js b/lib/grammar.js index d8178e8..5a20da9 100644 --- a/lib/grammar.js +++ b/lib/grammar.js @@ -159,9 +159,10 @@ var grammar = module.exports = { }, { // a=msid:0c8b064d-d807-43b4-b434-f92a889d8587 98178685-d409-46e0-8e16-7ef0db0db64a - name: 'msid', - reg: /^msid:(.*)/, - format: 'msid:%s' + push: 'msid', + reg: /^msid:([\w-]+)(?: ([\w-]+))?/, + names: ['id', 'appdata'], + format: 'msid:%s %s' }, { // a=ptime:20 diff --git a/test/jsep.sdp b/test/jsep.sdp index b951b48..7dbcfe5 100644 --- a/test/jsep.sdp +++ b/test/jsep.sdp @@ -8,7 +8,7 @@ m=audio 56500 UDP/TLS/RTP/SAVPF 96 0 8 97 98 c=IN IP4 192.0.2.1 a=mid:a1 a=rtcp:56501 IN IP4 192.0.2.1 -a=msid:47017fee-b6c1-4162-929c-a25110252400 f83006c5-a0ff-4e0a-9ed9-d3e6747be7d9 +a=msid:- f83006c5-a0ff-4e0a-9ed9-d3e6747be7d9 a=sendrecv a=rtpmap:96 opus/48000/2 a=rtpmap:0 PCMU/8000 @@ -35,6 +35,7 @@ a=rtcp:56503 IN IP4 192.0.2.1 a=mid:v1 a=bundle-only a=msid:61317484-2ed4-49d7-9eb7-1414322a7aae f30bdb4a-5db8-49b5-bcdc-e0c9a23172e0 +a=msid:93e8b9bb-ad32-417e-9d2d-42c215f50713 f30bdb4a-5db8-49b5-bcdc-e0c9a23172e0 a=sendrecv a=rtpmap:100 VP8/90000 a=rtpmap:101 rtx/90000 diff --git a/test/normal.sdp b/test/normal.sdp index e8a5315..b6db40a 100644 --- a/test/normal.sdp +++ b/test/normal.sdp @@ -6,6 +6,7 @@ c=IN IP4 203.0.113.1 a=ice-ufrag:F7gI a=ice-pwd:x9cml/YzichV2+XlhiMu8g a=fingerprint:sha-1 42:89:c5:c6:55:9d:6e:c8:e8:83:55:2a:39:f9:b6:eb:e9:a3:a9:e7 +a=setup:actpass m=audio 54400 RTP/SAVPF 0 96 a=rtpmap:0 PCMU/8000 a=rtpmap:96 opus/48000 diff --git a/test/parse.test.js b/test/parse.test.js index 47e3ee0..8b21f48 100644 --- a/test/parse.test.js +++ b/test/parse.test.js @@ -365,10 +365,16 @@ test('jsepSdp', function *(t) { 'ssrc-group' ); - t.equal(video.msid, - '61317484-2ed4-49d7-9eb7-1414322a7aae f30bdb4a-5db8-49b5-bcdc-e0c9a23172e0' - , 'msid' - ); + t.equal(video.msid, [ + { + id: '61317484-2ed4-49d7-9eb7-1414322a7aae', + appdata: 'f30bdb4a-5db8-49b5-bcdc-e0c9a23172e0' + }, + { + id: '93e8b9bb-ad32-417e-9d2d-42c215f50713', + appdata: 'f30bdb4a-5db8-49b5-bcdc-e0c9a23172e0' + } + ], 'msid'); t.ok(video.rtcpRsize, 'rtcp-rsize present'); t.ok(video.bundleOnly, 'bundle-only present'); @@ -975,4 +981,4 @@ test('ts-refclk-sess', function *(t) { t.ok(sessTsRefClocks && sessTsRefClocks.length == 1, 'got one TS Ref Clock at Session Level'); t.equal(sessTsRefClocks[0].clksrc, 'ntp', 'NTP Clock Source'); t.equal(sessTsRefClocks[0].clksrcExt, '/traceable/', 'traceable Clock Source'); -}); \ No newline at end of file +});