sdp 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog.rdoc +13 -0
- data/LICENSE.rdoc +1 -1
- data/README.rdoc +31 -11
- data/Rakefile +3 -10
- data/lib/sdp/description.rb +132 -16
- data/lib/sdp/parser.rb +4 -4
- data/lib/sdp/version.rb +1 -1
- data/sdp.gemspec +15 -15
- data/spec/integration/builds_descriptions_spec.rb +39 -0
- data/spec/integration/coverage/assets/0.7.1/application.css +1110 -0
- data/spec/integration/coverage/assets/0.7.1/application.js +626 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/favicon_green.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/favicon_red.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/favicon_yellow.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/loading.gif +0 -0
- data/spec/integration/coverage/assets/0.7.1/magnify.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/spec/integration/coverage/index.html +72 -0
- data/spec/integration/parses_descriptions_spec.rb +129 -0
- data/spec/spec_helper.rb +2 -1
- data/spec/support/parser_matcher.rb +33 -0
- data/{features → spec}/support/sdp_file.txt +0 -0
- data/spec/support/test_descriptions.rb +137 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/application.css +1110 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/application.js +626 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/favicon_green.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/favicon_red.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/favicon_yellow.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/loading.gif +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/magnify.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/spec/unit/sdp/coverage/index.html +72 -0
- data/spec/unit/sdp/description_spec.rb +321 -0
- data/spec/unit/sdp/parser_spec.rb +154 -0
- data/spec/{sdp_spec.rb → unit/sdp_spec.rb} +2 -2
- metadata +189 -43
- data/features/accepts_description_text.feature +0 -12
- data/features/sdp_create.feature +0 -15
- data/features/sdp_get.feature +0 -37
- data/features/step_definitions/accepts_description_text_steps.rb +0 -15
- data/features/step_definitions/sdp_create_steps.rb +0 -48
- data/features/step_definitions/sdp_get_steps.rb +0 -23
- data/features/support/env.rb +0 -3
- data/lib/sdp/session_template.erb +0 -46
- data/spec/sdp/description_spec.rb +0 -392
- data/spec/sdp/parser_spec.rb +0 -207
data/spec/sdp/parser_spec.rb
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
require 'sdp/parser'
|
|
3
|
-
require 'base64'
|
|
4
|
-
|
|
5
|
-
describe SDP::Parser do
|
|
6
|
-
before :each do
|
|
7
|
-
@parser = SDP::Parser.new
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
it "handles descriptions missing time zone field" do
|
|
11
|
-
lambda do
|
|
12
|
-
@parser.parse SDP_MISSING_TIME
|
|
13
|
-
end.should_not raise_error Parslet::ParseFailed
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
context "does NOT raise when missing required values" do
|
|
17
|
-
it "version" do
|
|
18
|
-
lambda do
|
|
19
|
-
@parser.parse "o=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\nt=11111 22222\n"
|
|
20
|
-
end.should_not raise_error Parslet::ParseFailed
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it "origin" do
|
|
24
|
-
lambda do
|
|
25
|
-
@parser.parse "v=0\ns=This is a test session\nt=11111 22222\n"
|
|
26
|
-
end.should_not raise_error Parslet::ParseFailed
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "name" do
|
|
30
|
-
lambda do
|
|
31
|
-
@parser.parse "v=0\no=steve 1234 5555 IN IP4 123.33.22.123\nt=11111 22222\n"
|
|
32
|
-
end.should_not raise_error Parslet::ParseFailed
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
it "timing" do
|
|
36
|
-
lambda do
|
|
37
|
-
@parser.parse "v=0\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\n"
|
|
38
|
-
end.should_not raise_error Parslet::ParseFailed
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
context "parses" do
|
|
43
|
-
it "required values" do
|
|
44
|
-
sdp = "v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\nt=11111 22222\nm=audio 49170 RTP/AVP 0\n"
|
|
45
|
-
lambda { @parser.parse sdp }.should_not raise_error
|
|
46
|
-
sdp_hash = @parser.parse sdp
|
|
47
|
-
sdp_hash.should == {
|
|
48
|
-
:session_section => {
|
|
49
|
-
:protocol_version=>"1",
|
|
50
|
-
:username=>"steve",
|
|
51
|
-
:id=>"1234",
|
|
52
|
-
:version=>"5555",
|
|
53
|
-
:network_type=>"IN",
|
|
54
|
-
:address_type=>"IP4",
|
|
55
|
-
:unicast_address=>"123.33.22.123",
|
|
56
|
-
:name=>"This is a test session",
|
|
57
|
-
:start_time=>"11111",
|
|
58
|
-
:stop_time=>"22222"
|
|
59
|
-
},
|
|
60
|
-
:media_sections=>[
|
|
61
|
-
{ :media=>"audio", :port=>"49170", :protocol=>"RTP/AVP", :format=>"0" }
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it "other combinations" do
|
|
67
|
-
sdps = [
|
|
68
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n\k=prompt\na=recvonly\na=bobo:the clown\nm=video 49170/2 RTP/AVP 31\na=hotness\na=attribute2:do stuff\nm=audio 12335 RTP/AVP 99\na=make:it now\n",
|
|
69
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n\k=prompt\na=recvonly\na=bobo:the clown\n",
|
|
70
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n\k=prompt\n",
|
|
71
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n\k=clear:password\n",
|
|
72
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n",
|
|
73
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h\n",
|
|
74
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\n",
|
|
75
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\n",
|
|
76
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\n",
|
|
77
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\n",
|
|
78
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\n",
|
|
79
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\n",
|
|
80
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\n",
|
|
81
|
-
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\n"
|
|
82
|
-
]
|
|
83
|
-
|
|
84
|
-
sdps.each do |sdp|
|
|
85
|
-
lambda { @parser.parse sdp }.should_not raise_error
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it "alternate email address" do
|
|
90
|
-
sdp = "e=Jane Doe <j.doe@example.com>\r\n"
|
|
91
|
-
sdp_hash = @parser.parse sdp
|
|
92
|
-
sdp_hash[:session_section][:email_address].should == "Jane Doe <j.doe@example.com>"
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
it "connection data that uses TTL value" do
|
|
96
|
-
sdp = "c=IN IP4 224.2.36.42/127\r\n"
|
|
97
|
-
sdp_hash = @parser.parse sdp
|
|
98
|
-
sdp_hash[:session_section][:connection_address].should == "224.2.36.42/127"
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
it "connection data that uses IPv6 and address count" do
|
|
102
|
-
sdp = "c=IN IP6 FF15::101/3\r\n"
|
|
103
|
-
sdp_hash = @parser.parse sdp
|
|
104
|
-
sdp_hash[:session_section][:connection_address].should == "FF15::101/3"
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
it "repeat times in seconds" do
|
|
108
|
-
sdp = "r=604800 3600 0 90000\r\n"
|
|
109
|
-
sdp_hash = @parser.parse sdp
|
|
110
|
-
sdp_hash[:session_section][:repeat_interval].should == "604800"
|
|
111
|
-
sdp_hash[:session_section][:active_duration].should == "3600"
|
|
112
|
-
sdp_hash[:session_section][:offsets_from_start_time].should == "0 90000"
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
it "time zones" do
|
|
116
|
-
sdp = "z=2882844526 -1h 2898848070 0\r\n"
|
|
117
|
-
sdp_hash = @parser.parse sdp
|
|
118
|
-
sdp_hash[:session_section][:time_zones].first[:adjustment_time].should == "2882844526"
|
|
119
|
-
sdp_hash[:session_section][:time_zones].first[:offset].should == "-1h"
|
|
120
|
-
sdp_hash[:session_section][:time_zones].last[:adjustment_time].should == "2898848070"
|
|
121
|
-
sdp_hash[:session_section][:time_zones].last[:offset].should == "0"
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
context "encryption keys" do
|
|
125
|
-
it "clear" do
|
|
126
|
-
sdp = "k=clear:password\r\n"
|
|
127
|
-
sdp_hash = @parser.parse sdp
|
|
128
|
-
sdp_hash[:session_section][:encryption_method].should == "clear"
|
|
129
|
-
sdp_hash[:session_section][:encryption_key].should == "password"
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
it "base64" do
|
|
133
|
-
# #encode64 adds newlines every 60 chars; remove them--they're unnecessary
|
|
134
|
-
password = Base64.encode64('password').gsub("\n", '')
|
|
135
|
-
sdp = "k=base64:#{password}\r\n"
|
|
136
|
-
sdp_hash = @parser.parse sdp
|
|
137
|
-
sdp_hash[:session_section][:encryption_method].should == "base64"
|
|
138
|
-
sdp_hash[:session_section][:encryption_key].should == password
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
it "uri" do
|
|
142
|
-
uri = "http://aserver.com/thing.pdf"
|
|
143
|
-
sdp = "k=uri:#{uri}\r\n"
|
|
144
|
-
sdp_hash = @parser.parse sdp
|
|
145
|
-
sdp_hash[:session_section][:encryption_method].should == "uri"
|
|
146
|
-
sdp_hash[:session_section][:encryption_key].should == uri
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
it "prompt" do
|
|
150
|
-
sdp = "k=prompt\r\n"
|
|
151
|
-
sdp_hash = @parser.parse sdp
|
|
152
|
-
sdp_hash[:session_section][:encryption_method].should == "prompt"
|
|
153
|
-
sdp_hash[:session_section][:encryption_key].should be_nil
|
|
154
|
-
end
|
|
155
|
-
end
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
context "attributes" do
|
|
159
|
-
it "attribute" do
|
|
160
|
-
sdp = "a=x-qt-text-cmt:Orban Opticodec-PC\r\n"
|
|
161
|
-
sdp_hash = @parser.parse sdp
|
|
162
|
-
sdp_hash[:session_section][:attributes].first[:attribute].should ==
|
|
163
|
-
"x-qt-text-cmt"
|
|
164
|
-
sdp_hash[:session_section][:attributes].first[:value].should ==
|
|
165
|
-
"Orban Opticodec-PC"
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
context "media sections" do
|
|
170
|
-
it "all possible fields in 1 section" do
|
|
171
|
-
sdp = "m=audio 0 RTP/AVP 96\r\ni=Test info\r\nc=IN IP4 0.0.0.0\r\nb=AS:40\r\nk=prompt\r\na=rtpmap:96 MP4A-LATM/44100/2\r\na=fmtp:96 cpresent=0;config=400027200000\r\n"
|
|
172
|
-
sdp_hash = @parser.parse sdp
|
|
173
|
-
first_media_section = sdp_hash[:media_sections].first
|
|
174
|
-
first_media_section[:media].should == "audio"
|
|
175
|
-
first_media_section[:port].should == "0"
|
|
176
|
-
first_media_section[:protocol].should == "RTP/AVP"
|
|
177
|
-
first_media_section[:format].should == "96"
|
|
178
|
-
first_media_section[:information].should == "Test info"
|
|
179
|
-
first_media_section[:connection_network_type].should == "IN"
|
|
180
|
-
first_media_section[:connection_address_type].should == "IP4"
|
|
181
|
-
first_media_section[:connection_address].should == "0.0.0.0"
|
|
182
|
-
first_media_section[:bandwidth_type].should == "AS"
|
|
183
|
-
first_media_section[:bandwidth].should == "40"
|
|
184
|
-
first_media_section[:encryption_method].should == "prompt"
|
|
185
|
-
first_media_section[:attributes].first[:attribute].should == "rtpmap"
|
|
186
|
-
first_media_section[:attributes].first[:value].should == "96 MP4A-LATM/44100/2"
|
|
187
|
-
first_media_section[:attributes].last[:attribute].should == "fmtp"
|
|
188
|
-
first_media_section[:attributes].last[:value].should == "96 cpresent=0;config=400027200000"
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
context "parses EOLs" do
|
|
193
|
-
it "parses \\r\\n" do
|
|
194
|
-
sdp = "v=123\r\n"
|
|
195
|
-
lambda { @parser.parse sdp }.should_not raise_error
|
|
196
|
-
sdp_hash = @parser.parse sdp
|
|
197
|
-
sdp_hash[:session_section][:protocol_version].should == "123"
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
it "parses \\n" do
|
|
201
|
-
sdp = "v=456\n"
|
|
202
|
-
lambda { @parser.parse sdp }.should_not raise_error
|
|
203
|
-
sdp_hash = @parser.parse sdp
|
|
204
|
-
sdp_hash[:session_section][:protocol_version].should == "456"
|
|
205
|
-
end
|
|
206
|
-
end
|
|
207
|
-
end
|