vonage 7.34.0 → 7.36.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 +4 -4
- data/README.md +2 -1
- data/lib/vonage/keys.rb +2 -1
- data/lib/vonage/verify2/channels/whats_app.rb +6 -0
- data/lib/vonage/version.rb +1 -1
- data/lib/vonage/video/web_socket.rb +7 -1
- data/lib/vonage/voice/actions/connect.rb +1 -0
- data/lib/vonage/voice/actions/input.rb +7 -0
- data/lib/vonage/voice/actions/talk.rb +17 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 335a760f3d2241f93f26a0a7bfc05a91e6913dfc66311e5f6f5d6c440cbcf63d
|
|
4
|
+
data.tar.gz: 324d0c92e4d9c5b458842ebffd555f48f17a97674662fa63f0442989e057060e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a8c1e57407a7cd8398073b1112ff6e12821832e8c1efe9a6ea02f73ec6b55e41f25533df7c0ea3d8c3503e17a06458083b227a18d2c7f69bbac134276fba303
|
|
7
|
+
data.tar.gz: 991f20b172f058fc50c8e1e3140e8fcb0599ed6d7d1ddbf72938a993bf5960dbb728d1ee32a40ba6c789fef8fb037db328bc519eeebae6b75e38272fc109698b
|
data/README.md
CHANGED
|
@@ -36,8 +36,9 @@ need a Vonage account. Sign up [for free at vonage.com][signup].
|
|
|
36
36
|
|
|
37
37
|
## Requirements
|
|
38
38
|
|
|
39
|
-
Vonage Ruby supports MRI/CRuby (
|
|
39
|
+
Vonage Ruby supports MRI/CRuby (tests in CI are run against 3.3 and newer, but the library will likely still work with any 2.x or newer version).
|
|
40
40
|
|
|
41
|
+
JRuby and Truffleruby are supported in theory, but aren't tested against as part of the CI pipeline.
|
|
41
42
|
|
|
42
43
|
## Installation
|
|
43
44
|
|
data/lib/vonage/keys.rb
CHANGED
|
@@ -24,6 +24,12 @@ module Vonage
|
|
|
24
24
|
@from = from
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
def mode=(mode)
|
|
28
|
+
valid_modes = ['otp_code', 'zero_tap']
|
|
29
|
+
raise ArgumentError, "Invalid 'mode' value #{mode}. Expected to be one of #{valid_modes.join(', ')}" unless valid_modes.include?(mode)
|
|
30
|
+
@mode = mode
|
|
31
|
+
end
|
|
32
|
+
|
|
27
33
|
def to_h
|
|
28
34
|
hash = Hash.new
|
|
29
35
|
self.instance_variables.each do |ivar|
|
data/lib/vonage/version.rb
CHANGED
|
@@ -37,8 +37,14 @@ module Vonage
|
|
|
37
37
|
# - If you omit this property, all streams in the session will be included.
|
|
38
38
|
# @option websocket [optional, Hash] :headers An object of key-value pairs of headers to be sent to your WebSocket server with each message, with a maximum length of 512 bytes.
|
|
39
39
|
# @option websocket [optional, Integer] :audio_rate A number representing the audio sampling rate in Hz
|
|
40
|
-
# - Must be one of: 8000, 16000
|
|
40
|
+
# - Must be one of: 8000, 16000, 24000
|
|
41
41
|
# @option websocket [optional, Boolean] :bidirectional Whether to send audio data from the WebSocket connection to a stream published in the session.
|
|
42
|
+
# @option websocket [optional, Hash] :audio_transport The configuration for the audio transport over the WebSocket connection.
|
|
43
|
+
# @option websocket[:audio_transport] [String] :transport (optional) The transport type for the audio data. Must be one of: "json", "binary".
|
|
44
|
+
# @option websocket[:audio_transport] [String] :encoding (optional) The encoding type for the audio data. Required when transport is "json". Must be one of: "base64".
|
|
45
|
+
# @option websocket[:audio_transport] [String] :audio_field (optional) The JSON key for the outbound audio data. The default value is "audio".
|
|
46
|
+
# @option websocket[:audio_transport] [String] :receive_audio_field (optional) The JSON key for inbound audio data (when bidirectional is enabled). Defaults to the same value as `audio_field`.
|
|
47
|
+
# @option websocket[:audio_transport] [Hash] :static_fields (optional) An optional hash of extra key-value pairs included in every outbound JSON audio message.
|
|
42
48
|
#
|
|
43
49
|
# @return [Response]
|
|
44
50
|
#
|
|
@@ -85,6 +85,13 @@ module Vonage
|
|
|
85
85
|
if self.speech[:maxDuration]
|
|
86
86
|
raise ClientError.new("Expected 'maxDuration' to not be more than 60 seconds") unless self.speech[:maxDuration] <= 60 && self.speech[:maxDuration] >= 0
|
|
87
87
|
end
|
|
88
|
+
|
|
89
|
+
if self.speech[:provider]
|
|
90
|
+
valid_providers = ['google']
|
|
91
|
+
|
|
92
|
+
raise ClientError.new("Invalid 'provider' value, must be one of: #{valid_providers.join(', ')}") unless valid_providers.include?(self.speech[:provider])
|
|
93
|
+
raise ClientError.new("The `providerOptions` parameter is required when specifying a `provider`") unless self.speech[:providerOptions]
|
|
94
|
+
end
|
|
88
95
|
end
|
|
89
96
|
|
|
90
97
|
def validate_event_url
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
module Vonage
|
|
4
4
|
class Voice::Actions::Talk
|
|
5
|
-
attr_accessor :text, :bargeIn, :loop, :level, :language, :style, :premium
|
|
5
|
+
attr_accessor :text, :bargeIn, :loop, :level, :language, :style, :premium, :provider, :providerOptions
|
|
6
6
|
|
|
7
7
|
def initialize(attributes= {})
|
|
8
8
|
@text = attributes.fetch(:text)
|
|
@@ -12,6 +12,8 @@ module Vonage
|
|
|
12
12
|
@language = attributes.fetch(:language, nil)
|
|
13
13
|
@style = attributes.fetch(:style, nil)
|
|
14
14
|
@premium = attributes.fetch(:premium, nil)
|
|
15
|
+
@provider = attributes.fetch(:provider, nil)
|
|
16
|
+
@providerOptions = attributes.fetch(:providerOptions, nil)
|
|
15
17
|
|
|
16
18
|
after_initialize!
|
|
17
19
|
end
|
|
@@ -36,6 +38,10 @@ module Vonage
|
|
|
36
38
|
if self.premium || self.premium == false
|
|
37
39
|
verify_premium
|
|
38
40
|
end
|
|
41
|
+
|
|
42
|
+
if self.provider
|
|
43
|
+
verify_provider
|
|
44
|
+
end
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
def verify_barge_in
|
|
@@ -58,6 +64,13 @@ module Vonage
|
|
|
58
64
|
raise ClientError.new("Expected 'premium' value to be a Boolean") unless self.premium == true || self.premium == false
|
|
59
65
|
end
|
|
60
66
|
|
|
67
|
+
def verify_provider
|
|
68
|
+
valid_providers = ['google']
|
|
69
|
+
|
|
70
|
+
raise ClientError.new("Invalid 'provider' value, must be one of: #{valid_providers.join(', ')}") unless valid_providers.include?(self.provider)
|
|
71
|
+
raise ClientError.new("The `providerOptions` parameter is required when specifying a `provider`") unless self.providerOptions
|
|
72
|
+
end
|
|
73
|
+
|
|
61
74
|
def action
|
|
62
75
|
create_talk!(self)
|
|
63
76
|
end
|
|
@@ -75,7 +88,9 @@ module Vonage
|
|
|
75
88
|
ncco[0].merge!(level: builder.level) if builder.level
|
|
76
89
|
ncco[0].merge!(language: builder.language) if builder.language
|
|
77
90
|
ncco[0].merge!(style: builder.style) if builder.style
|
|
78
|
-
ncco[0].merge!(premium: builder.premium) if (builder.
|
|
91
|
+
ncco[0].merge!(premium: builder.premium) if (builder.premium || builder.premium == false)
|
|
92
|
+
ncco[0].merge!(provider: builder.provider) if builder.provider
|
|
93
|
+
ncco[0].merge!(providerOptions: builder.providerOptions) if builder.providerOptions
|
|
79
94
|
|
|
80
95
|
ncco
|
|
81
96
|
end
|