voiceml 0.9.4 → 0.9.5

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: 2461ad8d4b866368bd017dc88423e319622924fd3e817bab0537d32e4bff3fa7
4
- data.tar.gz: 1fd1404b8b49ef5e606ccff5d8abea8fe350bd424d58fecb096390f1b8005531
3
+ metadata.gz: 181a2c0ecd8fc7bd315849acdeaa78719e2c7948c6fddf4d4ffa29afee19977a
4
+ data.tar.gz: 3bec3722ceeb21a23aebe31af292a6628062df36f3dea24d4b020abbf8d1ca6c
5
5
  SHA512:
6
- metadata.gz: 7f6568c5a12cfef4deb463b2b909bb992fea7188316076d15c66f16d1844c34efac71f9a8a334582cf8626e1896a606196b410f99c31aa4d4dbde9c032916c97
7
- data.tar.gz: 1f970bb3f98ece630c6a3fc0026772b910fd4d6724130f788d25babc7287b723da9a2d915b189163f7754ffbc54949c03c298c842cd1c131fc54c3329cdc16d0
6
+ metadata.gz: fe1941503aed6442b29324c399cb0d95d7827528c91bfc1c2f1033597220f91daac6cce9fa9dc74b4fac52a3d5e5427b0fcdfcd96672085bfd608bd0a74c174a
7
+ data.tar.gz: a0c8055efba2ef75113baa1a0c0c59ac2282c80ff389678ca5b02fd078130473eab1a0b7ed0a89aa6d0ff27b9b9e11a3965527c2e164d2ec6aec8d9221fefb27
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The official Ruby client for the [VoiceML REST API](https://voicetel.com/docs/api/v0.9/voiceml/) — Twilio-compatible outbound voice and answering-machine-detection from VoiceTel, with idiomatic snake_case kwargs, structured errors, and a Twilio-compatible wire format.
4
4
 
5
- ![Version](https://img.shields.io/badge/version-0.9.4-blue)
5
+ ![Version](https://img.shields.io/badge/version-0.9.5-blue)
6
6
  ![Ruby](https://img.shields.io/badge/ruby-3.1%2B-red)
7
7
  ![License](https://img.shields.io/badge/license-MIT-green)
8
8
  ![Tests](https://img.shields.io/badge/tests-227%20examples-brightgreen)
@@ -7,17 +7,22 @@ module VoiceML
7
7
  # Operations on `/Applications` — persistent TwiML+callback bundles.
8
8
  class ApplicationsResource < BaseResource
9
9
  APPLICATION_FIELDS = {
10
- 'FriendlyName' => :friendly_name,
11
- 'VoiceUrl' => :voice_url,
12
- 'VoiceMethod' => :voice_method,
13
- 'VoiceFallbackUrl' => :voice_fallback_url,
14
- 'VoiceFallbackMethod' => :voice_fallback_method,
15
- 'VoiceCallerIdLookup' => :voice_caller_id_lookup,
16
- 'StatusCallback' => :status_callback,
17
- 'StatusCallbackMethod' => :status_callback_method,
18
- 'StatusCallbackEvent' => :status_callback_event,
19
- 'MessageStatusCallback' => :message_status_callback,
20
- 'SmsStatusCallback' => :sms_status_callback
10
+ 'FriendlyName' => :friendly_name,
11
+ 'VoiceUrl' => :voice_url,
12
+ 'VoiceMethod' => :voice_method,
13
+ 'VoiceFallbackUrl' => :voice_fallback_url,
14
+ 'VoiceFallbackMethod' => :voice_fallback_method,
15
+ 'VoiceCallerIdLookup' => :voice_caller_id_lookup,
16
+ 'StatusCallback' => :status_callback,
17
+ 'StatusCallbackMethod' => :status_callback_method,
18
+ 'StatusCallbackEvent' => :status_callback_event,
19
+ 'MessageStatusCallback' => :message_status_callback,
20
+ 'SmsStatusCallback' => :sms_status_callback,
21
+ 'SmsUrl' => :sms_url,
22
+ 'SmsMethod' => :sms_method,
23
+ 'SmsFallbackUrl' => :sms_fallback_url,
24
+ 'SmsFallbackMethod' => :sms_fallback_method,
25
+ 'PublicApplicationConnectEnabled' => :public_application_connect_enabled
21
26
  }.freeze
22
27
 
23
28
  LIST_FIELDS = {
@@ -44,6 +44,7 @@ module VoiceML
44
44
  'RecordingTrack' => :recording_track,
45
45
  'Trim' => :trim,
46
46
  'Timeout' => :timeout,
47
+ 'TimeLimit' => :time_limit,
47
48
  'SendDigits' => :send_digits,
48
49
  'CallerId' => :caller_id,
49
50
  'CallReason' => :call_reason,
@@ -139,16 +140,19 @@ module VoiceML
139
140
  }.freeze
140
141
 
141
142
  START_TRANSCRIPTION_FIELDS = {
142
- 'Name' => :name,
143
- 'Track' => :track,
144
- 'LanguageCode' => :language_code,
145
- 'TranscriptionEngine' => :transcription_engine,
146
- 'ProfanityFilter' => :profanity_filter,
147
- 'PartialResults' => :partial_results,
148
- 'Hints' => :hints,
149
- 'StatusCallback' => :status_callback,
150
- 'StatusCallbackMethod' => :status_callback_method,
151
- 'StatusCallbackEvents' => :status_callback_events
143
+ 'Name' => :name,
144
+ 'Track' => :track,
145
+ 'LanguageCode' => :language_code,
146
+ 'TranscriptionEngine' => :transcription_engine,
147
+ 'ProfanityFilter' => :profanity_filter,
148
+ 'PartialResults' => :partial_results,
149
+ 'Hints' => :hints,
150
+ 'SpeechModel' => :speech_model,
151
+ 'EnableAutomaticPunctuation' => :enable_automatic_punctuation,
152
+ 'IntelligenceService' => :intelligence_service,
153
+ 'StatusCallbackUrl' => :status_callback_url,
154
+ 'StatusCallbackMethod' => :status_callback_method,
155
+ 'StatusCallbackEvents' => :status_callback_events
152
156
  }.freeze
153
157
 
154
158
  START_PAYMENT_FIELDS = {
@@ -210,6 +214,9 @@ module VoiceML
210
214
  # Pass at most one of `url:` / `twiml:` / `application_sid:` (Twiml wins if multiple are set
211
215
  # — Twilio's documented precedence).
212
216
  #
217
+ # `time_limit:` caps the call duration in seconds (max 14400; the server rejects
218
+ # an explicit 0, and a negative value disables the limit).
219
+ #
213
220
  # @return [VoiceML::Call]
214
221
  def create(**kwargs)
215
222
  data = @transport.request(:post, path('Calls'), form: form_params(CREATE_FIELDS, kwargs))
@@ -322,6 +329,11 @@ module VoiceML
322
329
  # (405 / 20004). Stored-recording transcriptions live on
323
330
  # {VoiceML::RecordingsResource} and {VoiceML::TranscriptionsResource}.
324
331
 
332
+ # Start real-time transcription on the live call. The events webhook kwarg is
333
+ # `status_callback_url:` (wire `StatusCallbackUrl`); `status_callback_method:` /
334
+ # `status_callback_events:` keep their plural wire names. `speech_model:`,
335
+ # `enable_automatic_punctuation:` and `intelligence_service:` tune the engine.
336
+ #
325
337
  # @return [VoiceML::CallTranscription]
326
338
  def start_transcription(call_sid, **kwargs)
327
339
  data = @transport.request(:post, path('Calls', call_sid, 'Transcriptions'),
@@ -27,20 +27,24 @@ module VoiceML
27
27
  }.freeze
28
28
 
29
29
  CREATE_PARTICIPANT_FIELDS = {
30
- 'From' => :from,
31
- 'To' => :to,
32
- 'Label' => :label,
33
- 'Muted' => :muted,
34
- 'StartConferenceOnEnter' => :start_conference_on_enter,
35
- 'EndConferenceOnExit' => :end_conference_on_exit,
36
- 'Timeout' => :timeout,
37
- 'StatusCallback' => :status_callback,
38
- 'StatusCallbackMethod' => :status_callback_method,
39
- 'StatusCallbackEvent' => :status_callback_event
30
+ 'From' => :from,
31
+ 'To' => :to,
32
+ 'Label' => :label,
33
+ 'Muted' => :muted,
34
+ 'StartConferenceOnEnter' => :start_conference_on_enter,
35
+ 'EndConferenceOnExit' => :end_conference_on_exit,
36
+ 'Timeout' => :timeout,
37
+ 'StatusCallback' => :status_callback,
38
+ 'StatusCallbackMethod' => :status_callback_method,
39
+ 'StatusCallbackEvent' => :status_callback_event,
40
+ 'ConferenceStatusCallback' => :conference_status_callback,
41
+ 'ConferenceStatusCallbackMethod' => :conference_status_callback_method,
42
+ 'ConferenceStatusCallbackEvent' => :conference_status_callback_event
40
43
  }.freeze
41
44
 
42
45
  UPDATE_RECORDING_FIELDS = {
43
- 'Status' => :status
46
+ 'Status' => :status,
47
+ 'PauseBehavior' => :pause_behavior
44
48
  }.freeze
45
49
 
46
50
  START_RECORDING_FIELDS = {
@@ -137,7 +141,9 @@ module VoiceML
137
141
  nil
138
142
  end
139
143
 
140
- # Dial a leg into a conference.
144
+ # Dial a leg into a conference. `status_callback*:` kwargs fire on participant-leg
145
+ # state changes; `conference_status_callback*:` fire on conference-level state
146
+ # changes (e.g. `conference-status-callback-event: start,end`).
141
147
  # @return [VoiceML::Participant]
142
148
  def create_participant(conference_sid, from:, to:, **kwargs)
143
149
  kwargs = kwargs.merge(from: from, to: to)
@@ -180,12 +186,16 @@ module VoiceML
180
186
  )
181
187
  end
182
188
 
189
+ # @param status [String] one of "in-progress", "paused", "stopped".
190
+ # @param pause_behavior [String, nil] how a paused recording treats silence
191
+ # (e.g. "skip" — see the API docs for `PauseBehavior`).
183
192
  # @return [VoiceML::Recording]
184
- def update_recording(conference_sid, recording_sid, **kwargs)
193
+ def update_recording(conference_sid, recording_sid, status:, pause_behavior: nil)
185
194
  data = @transport.request(
186
195
  :post,
187
196
  path('Conferences', conference_sid, 'Recordings', recording_sid),
188
- form: form_params(UPDATE_RECORDING_FIELDS, kwargs)
197
+ form: form_params(UPDATE_RECORDING_FIELDS,
198
+ { status: status, pause_behavior: pause_behavior })
189
199
  )
190
200
  Recording.from_hash(data)
191
201
  end
@@ -20,7 +20,9 @@ module VoiceML
20
20
  'MessagingServiceSid' => :messaging_service_sid,
21
21
  'ValidityPeriod' => :validity_period,
22
22
  'StatusCallback' => :status_callback,
23
- 'StatusCallbackMethod' => :status_callback_method
23
+ 'StatusCallbackMethod' => :status_callback_method,
24
+ 'SendAt' => :send_at,
25
+ 'ScheduleType' => :schedule_type
24
26
  }.freeze
25
27
 
26
28
  LIST_FIELDS = {
@@ -57,6 +59,9 @@ module VoiceML
57
59
  # repeated keys are sent on the wire). `from:` falls back to the tenant's
58
60
  # configured default sender when omitted.
59
61
  #
62
+ # Scheduling: `send_at:` accepts a `Time`/`DateTime` (serialised ISO 8601 UTC)
63
+ # or an ISO 8601 string; `schedule_type:` is `"fixed"` (the only value today).
64
+ #
60
65
  # @return [VoiceML::Message]
61
66
  def create(**kwargs)
62
67
  form = form_params(CREATE_FIELDS, kwargs)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VoiceML
4
- VERSION = '0.9.4'
4
+ VERSION = '0.9.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voiceml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - VoiceTel