bandwidth-sdk 10.0.0 → 10.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f647905f7c08b4614b21b7ca9278210ed8ff6f532f4b0cd09f1c705852c5567
4
- data.tar.gz: '00348580d308e3fccd81a42642daed1a3b6a39562feb953d0789cbf750a79f0f'
3
+ metadata.gz: 668cc1c385cbaef57a22692979b253aaf3b19847fb9dbf4edd6e72b655c34da2
4
+ data.tar.gz: a2c3621b86adccbe0f3a114013c4b3aac2b8d03560f22a8aa135c5de4f64e181
5
5
  SHA512:
6
- metadata.gz: c001719da52d9026ea151cb5f95229b0a1ef8b864c7bede8d48c02856f742c0124be304982d350be46ca399cd074170b957cc7a4b887c964f68a41cdf6385ca5
7
- data.tar.gz: 3efb5225670bc0b6cc86088afa4ee45b8e9ecc5f023d33ff33ff6072454f0599474a4d575cfe0db2c2d85d70ca304cde445623f8f25b3f26d03d099da92c545f
6
+ metadata.gz: '09c7e3ef8c10db03d7640272be5085dad7b0aa3a812fc5d40b45082992e01ffd5b1de3ed0c03732f343b178ac26489efbc809996087f007c76c106dd4d429ea9'
7
+ data.tar.gz: 80a97346a1250ad071570f618318f7aeb9ad523946b899f40b20affd2a3c15791bbefa97a89cd60bb1a9041f76bfb63fc2ecebc4ac610b532ee2f2adcc8c59b0
@@ -0,0 +1,22 @@
1
+ require_relative 'xml_verb'
2
+
3
+ module Bandwidth
4
+ module Voice
5
+ # The StartStream verb allows a segment of a call to be sent off to another destination for additional processing
6
+ class StartStream
7
+ include XmlVerb
8
+
9
+ def to_bxml(xml)
10
+ xml.StartStream(compact_hash({
11
+ 'destination' => destination,
12
+ 'name' => name,
13
+ 'tracks' => tracks,
14
+ 'streamEventUrl' => streamEventUrl,
15
+ 'streamEventMethod' => streamEventMethod,
16
+ 'username' => username,
17
+ 'password' => password
18
+ }))
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,16 @@
1
+ require_relative 'xml_verb'
2
+
3
+ module Bandwidth
4
+ module Voice
5
+ # The StopStream verb is used to stop a stream that was started with a previous `<StartStream>` verb
6
+ class StopStream
7
+ include XmlVerb
8
+
9
+ def to_bxml(xml)
10
+ xml.StopStream(compact_hash({
11
+ 'name' => name
12
+ }))
13
+ end
14
+ end
15
+ end
16
+ end
@@ -82,7 +82,7 @@ class IntegrationTest < Test::Unit::TestCase
82
82
  media = "Hello world"
83
83
 
84
84
  #media upload
85
- @bandwidth_client.messaging_client.client.upload_media(BW_ACCOUNT_ID, media_id, media, :content_type => "application/octet-stream", :cache_control => "no-cache")
85
+ @bandwidth_client.messaging_client.client.upload_media(BW_ACCOUNT_ID, media_id, media, :content_type => "text/plain", :cache_control => "no-cache")
86
86
 
87
87
  #media download
88
88
  downloaded_media = @bandwidth_client.messaging_client.client.get_media(BW_ACCOUNT_ID, media_id).data
@@ -688,4 +688,34 @@ class IntegrationTest < Test::Unit::TestCase
688
688
  actual = Bandwidth::WebRtc.generate_transfer_bxml_verb('asdf', 'c-93d6f3c0-be584596-0b74-4fa2-8015-d8ede84bd1a4')
689
689
  assert_equal(expected, actual)
690
690
  end
691
+
692
+ def test_start_stream_bxml_verb
693
+ expected = '<?xml version="1.0" encoding="UTF-8"?><Response><StartStream destination="https://www.test.com/stream" name="test_stream" tracks="inbound" streamEventUrl="https://www.test.com/event" streamEventMethod="POST" username="username" password="password"/></Response>'
694
+ response = Bandwidth::Voice::Response.new()
695
+ start_stream = Bandwidth::Voice::StartStream.new({
696
+ :destination => "https://www.test.com/stream",
697
+ :name => "test_stream",
698
+ :tracks => "inbound",
699
+ :streamEventUrl => "https://www.test.com/event",
700
+ :streamEventMethod => "POST",
701
+ :username => "username",
702
+ :password => "password"
703
+ })
704
+ response.push(start_stream)
705
+ actual = response.to_bxml()
706
+
707
+ assert_equal(expected, actual)
708
+ end
709
+
710
+ def test_stop_stream_bxml_verb
711
+ expected = '<?xml version="1.0" encoding="UTF-8"?><Response><StopStream name="test_stream"/></Response>'
712
+ response = Bandwidth::Voice::Response.new()
713
+ stop_stream = Bandwidth::Voice::StopStream.new({
714
+ :name => "test_stream"
715
+ })
716
+ response.push(stop_stream)
717
+ actual = response.to_bxml()
718
+
719
+ assert_equal(expected, actual)
720
+ end
691
721
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.0
4
+ version: 10.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bandwidth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-05 00:00:00.000000000 Z
11
+ date: 2022-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -281,8 +281,10 @@ files:
281
281
  - lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb
282
282
  - lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb
283
283
  - lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb
284
+ - lib/bandwidth/voice_lib/bxml/verbs/start_stream.rb
284
285
  - lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb
285
286
  - lib/bandwidth/voice_lib/bxml/verbs/stop_recording.rb
287
+ - lib/bandwidth/voice_lib/bxml/verbs/stop_stream.rb
286
288
  - lib/bandwidth/voice_lib/bxml/verbs/tag.rb
287
289
  - lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
288
290
  - lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb