twilio-ruby 5.18.0 → 5.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +0 -4
- data/CHANGES.md +20 -0
- data/LICENSE.md +1 -1
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/accounts/v1/credential/aws.rb +21 -13
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +80 -70
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +204 -196
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +59 -53
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +69 -61
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +30 -25
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +28 -16
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +31 -20
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +54 -50
- data/lib/twilio-ruby/rest/api.rb +7 -6
- data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
- data/lib/twilio-ruby/rest/authy.rb +8 -8
- data/lib/twilio-ruby/rest/client.rb +14 -6
- data/lib/twilio-ruby/rest/insights/v1/summary.rb +286 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +43 -0
- data/lib/twilio-ruby/rest/insights.rb +46 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +22 -14
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/preview.rb +8 -8
- data/lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb +5 -28
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +5 -9
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +5 -13
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +1 -1
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +4 -2
- data/lib/twilio-ruby/rest/trunking/v1.rb +2 -1
- data/lib/twilio-ruby/rest/verify/v1/service/verification.rb +7 -0
- data/lib/twilio-ruby/rest/verify/v1/service/verification_check.rb +7 -4
- data/lib/twilio-ruby/rest/video/v1/composition.rb +25 -13
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +69 -74
- data/lib/twilio-ruby/rest/video/v1/recording.rb +13 -7
- data/lib/twilio-ruby/rest/video/v1.rb +16 -16
- data/lib/twilio-ruby/rest/video.rb +9 -9
- data/lib/twilio-ruby/rest/voice/v1/voice_permission/bulk_country_update.rb +3 -3
- data/lib/twilio-ruby/rest/voice/v1/voice_permission/country/highrisk_special_prefix.rb +2 -2
- data/lib/twilio-ruby/rest/voice/v1/voice_permission/country.rb +20 -20
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +8 -4
- data/spec/integration/insights/v1/summary_spec.rb +60 -0
- data/spec/integration/proxy/v1/service/phone_number_spec.rb +2 -2
- data/spec/integration/proxy/v1/service/session/interaction_spec.rb +1 -1
- data/spec/integration/proxy/v1/service/session/participant/message_interaction_spec.rb +2 -2
- data/spec/integration/proxy/v1/service/session/participant_spec.rb +66 -4
- data/spec/integration/proxy/v1/service/session_spec.rb +8 -8
- data/spec/integration/proxy/v1/service_spec.rb +3 -3
- data/spec/integration/trunking/v1/trunk_spec.rb +80 -0
- data/spec/integration/verify/v1/service/verification_spec.rb +10 -1
- data/twilio-ruby.gemspec +1 -2
- metadata +16 -6
@@ -15,9 +15,9 @@ module Twilio
|
|
15
15
|
##
|
16
16
|
# Initialize the CallList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
|
-
# @param [String] account_sid The
|
19
|
-
# [Account](https://www.twilio.com/docs/api/rest/account)
|
20
|
-
#
|
18
|
+
# @param [String] account_sid The SID of the
|
19
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that created this Call
|
20
|
+
# resource.
|
21
21
|
# @return [CallList] CallList
|
22
22
|
def initialize(version, account_sid: nil)
|
23
23
|
super(version)
|
@@ -37,94 +37,96 @@ module Twilio
|
|
37
37
|
# @param [String] from The phone number or client identifier to use as the caller
|
38
38
|
# id. If using a phone number, it must be a Twilio number or a Verified [outgoing
|
39
39
|
# caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your
|
40
|
-
# account. If the `
|
40
|
+
# account. If the `to` parameter is a phone number, `From` must also be a phone
|
41
41
|
# number.
|
42
|
-
# @param [String] method The HTTP method
|
43
|
-
#
|
44
|
-
# parameter is present, this parameter is ignored.
|
45
|
-
# @param [String] fallback_url
|
46
|
-
# requesting or executing the TwiML at `
|
47
|
-
# present, this parameter is ignored.
|
48
|
-
# @param [String] fallback_method The HTTP method that
|
49
|
-
#
|
50
|
-
#
|
51
|
-
# @param [String] status_callback
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
42
|
+
# @param [String] method The HTTP method we should use when calling the `url`
|
43
|
+
# parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an
|
44
|
+
# `application_sid` parameter is present, this parameter is ignored.
|
45
|
+
# @param [String] fallback_url The URL that we call using the `fallback_method` if
|
46
|
+
# an error occurs when requesting or executing the TwiML at `url`. If an
|
47
|
+
# `application_sid` parameter is present, this parameter is ignored.
|
48
|
+
# @param [String] fallback_method The HTTP method that we should use to request
|
49
|
+
# the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an
|
50
|
+
# `application_sid` parameter is present, this parameter is ignored.
|
51
|
+
# @param [String] status_callback The URL we should call using the
|
52
|
+
# `status_callback_method` to send status information to your application. If no
|
53
|
+
# `status_callback_event` is specified, we will send the `completed` status. If an
|
54
|
+
# `application_sid` parameter is present, this parameter is ignored. URLs must
|
55
55
|
# contain a valid hostname (underscores are not permitted).
|
56
|
-
# @param [String] status_callback_event The call progress events that will
|
57
|
-
#
|
58
|
-
#
|
59
|
-
# to receive multiple events,
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# parameter is present, this parameter is ignored.
|
56
|
+
# @param [String] status_callback_event The call progress events that we will send
|
57
|
+
# to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and
|
58
|
+
# `completed`. If no event is specified, we send the `completed` status. If you
|
59
|
+
# want to receive multiple events, specify each one in a separate
|
60
|
+
# `status_callback_event` parameter. See the code sample for [monitoring call
|
61
|
+
# progress](https://www.twilio.com/docs/voice/api/call?code-sample=code-create-a-call-and-specify-a-statuscallbackevent). If an `application_sid` is present, this parameter is ignored.
|
62
|
+
# @param [String] status_callback_method The HTTP method we should use when
|
63
|
+
# calling the `status_callback` URL. Can be: `GET` or `POST` and the default is
|
64
|
+
# `POST`. If an `application_sid` parameter is present, this parameter is ignored.
|
66
65
|
# @param [String] send_digits A string of keys to dial after connecting to the
|
67
66
|
# number, maximum of 32 digits. Valid digits in the string include: any digit
|
68
|
-
# (`0`-`9`), '`#`', '`*`' and '`w`'
|
67
|
+
# (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example,
|
69
68
|
# if you connected to a company phone number and wanted to pause for one second,
|
70
|
-
# dial extension 1234
|
71
|
-
# to URL-encode this string, since the
|
72
|
-
# URL. If both `SendDigits` and
|
73
|
-
# `MachineDetection` will be
|
74
|
-
#
|
75
|
-
# @param [String]
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
# @param [
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
# @param [String]
|
95
|
-
#
|
96
|
-
# @param [String]
|
97
|
-
#
|
69
|
+
# and then dial extension 1234 followed by the pound key, the value of this
|
70
|
+
# parameter would be `ww1234#`. Remember to URL-encode this string, since the
|
71
|
+
# '`#`' character has special meaning in a URL. If both `SendDigits` and
|
72
|
+
# `MachineDetection` parameters are provided, then `MachineDetection` will be
|
73
|
+
# ignored.
|
74
|
+
# @param [String] if_machine The action to take if an answering machine is
|
75
|
+
# detected. Can be: `Continue`, `Hangup`, or `False`. `False` disables the
|
76
|
+
# detection of an answering machine.
|
77
|
+
# @param [String] timeout The integer number of seconds that we should allow the
|
78
|
+
# phone to ring before assuming there is no answer. The default is `60` seconds
|
79
|
+
# and the maximum is `600` seconds. For some call flows, we will add a 5-second
|
80
|
+
# buffer to the timeout value you provide. For this reason, a timeout value of 10
|
81
|
+
# seconds could result in an actual timeout closer to 15 seconds. You can set this
|
82
|
+
# to a short time, such as `15` seconds, to hang up before reaching an answering
|
83
|
+
# machine or voicemail.
|
84
|
+
# @param [Boolean] record Set this parameter to `true` to record the phone call.
|
85
|
+
# The `recording_url` will be sent to the `status_callback` URL. The default is
|
86
|
+
# `false`.
|
87
|
+
# @param [String] recording_channels The number of channels in the final
|
88
|
+
# recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both
|
89
|
+
# legs of the call in a single channel of the recording file. `dual` records each
|
90
|
+
# leg to a separate channel of the recording file. The first channel of a
|
91
|
+
# dual-channel recording contains the parent call and the second channel contains
|
92
|
+
# the child call.
|
93
|
+
# @param [String] recording_status_callback The URL that we call when the
|
94
|
+
# recording is available to be accessed.
|
95
|
+
# @param [String] recording_status_callback_method The HTTP method we should use
|
96
|
+
# when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and
|
97
|
+
# the default is `POST`.
|
98
|
+
# @param [String] sip_auth_username The username used to authenticate the caller
|
99
|
+
# making a SIP call.
|
100
|
+
# @param [String] sip_auth_password The password required to authenticate the user
|
101
|
+
# account specified in `sip_auth_username`.
|
98
102
|
# @param [String] machine_detection Detect if a human, answering machine, or fax
|
99
|
-
# has picked up the call.
|
100
|
-
# `AnsweredBy`
|
101
|
-
# to leave a message on an
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
# @param [String] machine_detection_timeout The number of seconds that
|
106
|
-
#
|
107
|
-
#
|
103
|
+
# has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if
|
104
|
+
# you would like us to return `AnsweredBy` as soon as the called party is
|
105
|
+
# identified. Use `DetectMessageEnd`, if you would like to leave a message on an
|
106
|
+
# answering machine. If `send_digits` is provided, this parameter is ignored. For
|
107
|
+
# more information, see [Answering Machine
|
108
|
+
# Detection](https://www.twilio.com/docs/voice/answering-machine-detection).
|
109
|
+
# @param [String] machine_detection_timeout The number of seconds that we should
|
110
|
+
# attempt to detect an answering machine before timing out and sending a voice
|
111
|
+
# request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds.
|
108
112
|
# @param [String] recording_status_callback_event The recording status events that
|
109
|
-
# will trigger
|
110
|
-
# `
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
# Defaults to `trim-silence`.
|
113
|
+
# will trigger calls to the URL specified in `recording_status_callback`. Can be:
|
114
|
+
# `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate
|
115
|
+
# multiple values with a space.
|
116
|
+
# @param [String] trim Whether to trim any leading and trailing silence from the
|
117
|
+
# recording. Can be: `trim-silence` or `do-not-trim` and the default is
|
118
|
+
# `trim-silence`.
|
116
119
|
# @param [String] caller_id The phone number, SIP address, or Client identifier
|
117
|
-
# that made this
|
118
|
-
# format](https://
|
120
|
+
# that made this call. Phone numbers are in [E.164
|
121
|
+
# format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212).
|
119
122
|
# SIP addresses are formatted as `name@company.com`.
|
120
|
-
# @param [String] url The
|
121
|
-
# call.
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# the
|
127
|
-
# Parameter](https://www.twilio.com/docs/voice/make-calls#specify-an-applicationsid-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls) for more details.
|
123
|
+
# @param [String] url The absolute URL that returns the TwiML instructions for the
|
124
|
+
# call. We will call this URL using the `method` when the call connects. For more
|
125
|
+
# information, see the [Url
|
126
|
+
# Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter)
|
127
|
+
# section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
|
128
|
+
# @param [String] application_sid The SID of the Application resource that will
|
129
|
+
# handle the call, if the call will be handled by an application.
|
128
130
|
# @return [CallInstance] Newly created CallInstance
|
129
131
|
def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, if_machine: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, recording_status_callback_event: :unset, trim: :unset, caller_id: :unset, url: :unset, application_sid: :unset)
|
130
132
|
data = Twilio::Values.of({
|
@@ -169,19 +171,19 @@ module Twilio
|
|
169
171
|
# memory before returning.
|
170
172
|
# @param [String] to Only show calls to this phone number, SIP address, Client
|
171
173
|
# identifier or SIM SID.
|
172
|
-
# @param [String] from Only
|
173
|
-
# identifier or SIM SID.
|
174
|
-
# @param [String] parent_call_sid Only
|
174
|
+
# @param [String] from Only include calls from this phone number, SIP address,
|
175
|
+
# Client identifier or SIM SID.
|
176
|
+
# @param [String] parent_call_sid Only include calls spawned by calls with this
|
175
177
|
# SID.
|
176
|
-
# @param [call.Status] status
|
177
|
-
#
|
178
|
-
#
|
179
|
-
# @param [Time] start_time_before
|
180
|
-
# @param [Time] start_time
|
181
|
-
# @param [Time] start_time_after
|
182
|
-
# @param [Time] end_time_before
|
183
|
-
# @param [Time] end_time
|
184
|
-
# @param [Time] end_time_after
|
178
|
+
# @param [call.Status] status The status of the calls to include. Can be:
|
179
|
+
# `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`,
|
180
|
+
# or `no-answer`.
|
181
|
+
# @param [Time] start_time_before Only include calls that started on or after this date
|
182
|
+
# @param [Time] start_time Only include calls that started on or after this date
|
183
|
+
# @param [Time] start_time_after Only include calls that started on or after this date
|
184
|
+
# @param [Time] end_time_before Only include usage that occurred on or before this date
|
185
|
+
# @param [Time] end_time Only include usage that occurred on or before this date
|
186
|
+
# @param [Time] end_time_after Only include usage that occurred on or before this date
|
185
187
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
186
188
|
# guarantees to never return more than limit. Default is no limit
|
187
189
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -212,19 +214,19 @@ module Twilio
|
|
212
214
|
# is reached.
|
213
215
|
# @param [String] to Only show calls to this phone number, SIP address, Client
|
214
216
|
# identifier or SIM SID.
|
215
|
-
# @param [String] from Only
|
216
|
-
# identifier or SIM SID.
|
217
|
-
# @param [String] parent_call_sid Only
|
217
|
+
# @param [String] from Only include calls from this phone number, SIP address,
|
218
|
+
# Client identifier or SIM SID.
|
219
|
+
# @param [String] parent_call_sid Only include calls spawned by calls with this
|
218
220
|
# SID.
|
219
|
-
# @param [call.Status] status
|
220
|
-
#
|
221
|
-
#
|
222
|
-
# @param [Time] start_time_before
|
223
|
-
# @param [Time] start_time
|
224
|
-
# @param [Time] start_time_after
|
225
|
-
# @param [Time] end_time_before
|
226
|
-
# @param [Time] end_time
|
227
|
-
# @param [Time] end_time_after
|
221
|
+
# @param [call.Status] status The status of the calls to include. Can be:
|
222
|
+
# `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`,
|
223
|
+
# or `no-answer`.
|
224
|
+
# @param [Time] start_time_before Only include calls that started on or after this date
|
225
|
+
# @param [Time] start_time Only include calls that started on or after this date
|
226
|
+
# @param [Time] start_time_after Only include calls that started on or after this date
|
227
|
+
# @param [Time] end_time_before Only include usage that occurred on or before this date
|
228
|
+
# @param [Time] end_time Only include usage that occurred on or before this date
|
229
|
+
# @param [Time] end_time_after Only include usage that occurred on or before this date
|
228
230
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
229
231
|
# guarantees to never return more than limit. Default is no limit.
|
230
232
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -271,19 +273,19 @@ module Twilio
|
|
271
273
|
# Request is executed immediately.
|
272
274
|
# @param [String] to Only show calls to this phone number, SIP address, Client
|
273
275
|
# identifier or SIM SID.
|
274
|
-
# @param [String] from Only
|
275
|
-
# identifier or SIM SID.
|
276
|
-
# @param [String] parent_call_sid Only
|
276
|
+
# @param [String] from Only include calls from this phone number, SIP address,
|
277
|
+
# Client identifier or SIM SID.
|
278
|
+
# @param [String] parent_call_sid Only include calls spawned by calls with this
|
277
279
|
# SID.
|
278
|
-
# @param [call.Status] status
|
279
|
-
#
|
280
|
-
#
|
281
|
-
# @param [Time] start_time_before
|
282
|
-
# @param [Time] start_time
|
283
|
-
# @param [Time] start_time_after
|
284
|
-
# @param [Time] end_time_before
|
285
|
-
# @param [Time] end_time
|
286
|
-
# @param [Time] end_time_after
|
280
|
+
# @param [call.Status] status The status of the calls to include. Can be:
|
281
|
+
# `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`,
|
282
|
+
# or `no-answer`.
|
283
|
+
# @param [Time] start_time_before Only include calls that started on or after this date
|
284
|
+
# @param [Time] start_time Only include calls that started on or after this date
|
285
|
+
# @param [Time] start_time_after Only include calls that started on or after this date
|
286
|
+
# @param [Time] end_time_before Only include usage that occurred on or before this date
|
287
|
+
# @param [Time] end_time Only include usage that occurred on or before this date
|
288
|
+
# @param [Time] end_time_after Only include usage that occurred on or before this date
|
287
289
|
# @param [String] page_token PageToken provided by the API
|
288
290
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
289
291
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
@@ -381,8 +383,11 @@ module Twilio
|
|
381
383
|
##
|
382
384
|
# Initialize the CallContext
|
383
385
|
# @param [Version] version Version that contains the resource
|
384
|
-
# @param [String] account_sid The
|
385
|
-
#
|
386
|
+
# @param [String] account_sid The SID of the
|
387
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that created the Call
|
388
|
+
# resource(s) to fetch.
|
389
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the Call
|
390
|
+
# resource to fetch
|
386
391
|
# @return [CallContext] CallContext
|
387
392
|
def initialize(version, account_sid, sid)
|
388
393
|
super(version)
|
@@ -421,32 +426,33 @@ module Twilio
|
|
421
426
|
|
422
427
|
##
|
423
428
|
# Update the CallInstance
|
424
|
-
# @param [String] url
|
425
|
-
# this URL when the call connects.
|
429
|
+
# @param [String] url The absolute URL that returns the TwiML instructions for the
|
430
|
+
# call. We will call this URL using the `method` when the call connects. For more
|
431
|
+
# information, see the [Url
|
426
432
|
# Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter)
|
427
|
-
# section in [Making Calls](https://www.twilio.com/docs/voice/make-calls)
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
432
|
-
#
|
433
|
-
#
|
434
|
-
#
|
435
|
-
#
|
436
|
-
# @param [String] fallback_url
|
437
|
-
# when requesting or executing the TwiML at `
|
438
|
-
# parameter is present, this parameter is ignored.
|
439
|
-
# @param [String] fallback_method The HTTP method that
|
440
|
-
#
|
441
|
-
#
|
442
|
-
# @param [String] status_callback
|
443
|
-
#
|
444
|
-
#
|
445
|
-
#
|
433
|
+
# section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
|
434
|
+
# @param [String] method The HTTP method we should use when calling the `url`. Can
|
435
|
+
# be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter
|
436
|
+
# is present, this parameter is ignored.
|
437
|
+
# @param [call.UpdateStatus] status The new status of the resource. Can be:
|
438
|
+
# `canceled` or `completed`. Specifying `canceled` will attempt to hang up calls
|
439
|
+
# that are queued or ringing; however, it will not affect calls already in
|
440
|
+
# progress. Specifying `completed` will attempt to hang up a call even if it's
|
441
|
+
# already in progress.
|
442
|
+
# @param [String] fallback_url The URL that we call using the `fallback_method` if
|
443
|
+
# an error occurs when requesting or executing the TwiML at `url`. If an
|
444
|
+
# `application_sid` parameter is present, this parameter is ignored.
|
445
|
+
# @param [String] fallback_method The HTTP method that we should use to request
|
446
|
+
# the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an
|
447
|
+
# `application_sid` parameter is present, this parameter is ignored.
|
448
|
+
# @param [String] status_callback The URL we should call using the
|
449
|
+
# `status_callback_method` to send status information to your application. If no
|
450
|
+
# `status_callback_event` is specified, we will send the `completed` status. If an
|
451
|
+
# `application_sid` parameter is present, this parameter is ignored. URLs must
|
446
452
|
# contain a valid hostname (underscores are not permitted).
|
447
|
-
# @param [String] status_callback_method The HTTP method
|
448
|
-
# requesting the `
|
449
|
-
# parameter is present, this parameter is ignored.
|
453
|
+
# @param [String] status_callback_method The HTTP method we should use when
|
454
|
+
# requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is
|
455
|
+
# `POST`. If an `application_sid` parameter is present, this parameter is ignored.
|
450
456
|
# @return [CallInstance] Updated CallInstance
|
451
457
|
def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset)
|
452
458
|
data = Twilio::Values.of({
|
@@ -533,10 +539,11 @@ module Twilio
|
|
533
539
|
# Initialize the CallInstance
|
534
540
|
# @param [Version] version Version that contains the resource
|
535
541
|
# @param [Hash] payload payload that contains response from Twilio
|
536
|
-
# @param [String] account_sid The
|
537
|
-
# [Account](https://www.twilio.com/docs/api/rest/account)
|
538
|
-
#
|
539
|
-
# @param [String] sid The
|
542
|
+
# @param [String] account_sid The SID of the
|
543
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that created this Call
|
544
|
+
# resource.
|
545
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the Call
|
546
|
+
# resource to fetch
|
540
547
|
# @return [CallInstance] CallInstance
|
541
548
|
def initialize(version, payload, account_sid: nil, sid: nil)
|
542
549
|
super(version)
|
@@ -587,103 +594,103 @@ module Twilio
|
|
587
594
|
end
|
588
595
|
|
589
596
|
##
|
590
|
-
# @return [String] The
|
597
|
+
# @return [String] The SID of the Account that created this resource
|
591
598
|
def account_sid
|
592
599
|
@properties['account_sid']
|
593
600
|
end
|
594
601
|
|
595
602
|
##
|
596
|
-
# @return [String] The annotation provided for the
|
603
|
+
# @return [String] The annotation provided for the call
|
597
604
|
def annotation
|
598
605
|
@properties['annotation']
|
599
606
|
end
|
600
607
|
|
601
608
|
##
|
602
|
-
# @return [String] Either `human` or `machine` if this
|
609
|
+
# @return [String] Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise.
|
603
610
|
def answered_by
|
604
611
|
@properties['answered_by']
|
605
612
|
end
|
606
613
|
|
607
614
|
##
|
608
|
-
# @return [String] The API Version used to create the
|
615
|
+
# @return [String] The API Version used to create the call
|
609
616
|
def api_version
|
610
617
|
@properties['api_version']
|
611
618
|
end
|
612
619
|
|
613
620
|
##
|
614
|
-
# @return [String] The caller's name if this
|
621
|
+
# @return [String] The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty.
|
615
622
|
def caller_name
|
616
623
|
@properties['caller_name']
|
617
624
|
end
|
618
625
|
|
619
626
|
##
|
620
|
-
# @return [Time] The date that this resource was created
|
627
|
+
# @return [Time] The RFC 2822 date and time in GMT that this resource was created
|
621
628
|
def date_created
|
622
629
|
@properties['date_created']
|
623
630
|
end
|
624
631
|
|
625
632
|
##
|
626
|
-
# @return [Time] The date that this resource was last updated
|
633
|
+
# @return [Time] The RFC 2822 date and time in GMT that this resource was last updated
|
627
634
|
def date_updated
|
628
635
|
@properties['date_updated']
|
629
636
|
end
|
630
637
|
|
631
638
|
##
|
632
|
-
# @return [String] A string describing the direction of the
|
639
|
+
# @return [String] A string describing the direction of the call. `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `Dial` verb.
|
633
640
|
def direction
|
634
641
|
@properties['direction']
|
635
642
|
end
|
636
643
|
|
637
644
|
##
|
638
|
-
# @return [String] The length of the
|
645
|
+
# @return [String] The length of the call in seconds.
|
639
646
|
def duration
|
640
647
|
@properties['duration']
|
641
648
|
end
|
642
649
|
|
643
650
|
##
|
644
|
-
# @return [Time] The end time of the
|
651
|
+
# @return [Time] The end time of the call. Null if the call did not complete successfully.
|
645
652
|
def end_time
|
646
653
|
@properties['end_time']
|
647
654
|
end
|
648
655
|
|
649
656
|
##
|
650
|
-
# @return [String] The forwarding phone number if this
|
657
|
+
# @return [String] The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty.
|
651
658
|
def forwarded_from
|
652
659
|
@properties['forwarded_from']
|
653
660
|
end
|
654
661
|
|
655
662
|
##
|
656
|
-
# @return [String] The phone number, SIP address or Client identifier that made this
|
663
|
+
# @return [String] The phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`.
|
657
664
|
def from
|
658
665
|
@properties['from']
|
659
666
|
end
|
660
667
|
|
661
668
|
##
|
662
|
-
# @return [String] The phone number, SIP address or Client identifier
|
669
|
+
# @return [String] The calling phone number, SIP address, or Client identifier formatted for display.
|
663
670
|
def from_formatted
|
664
671
|
@properties['from_formatted']
|
665
672
|
end
|
666
673
|
|
667
674
|
##
|
668
|
-
# @return [String]
|
675
|
+
# @return [String] The Group SID associated with this call. If no Group is associated with the call, the field is empty.
|
669
676
|
def group_sid
|
670
677
|
@properties['group_sid']
|
671
678
|
end
|
672
679
|
|
673
680
|
##
|
674
|
-
# @return [String]
|
681
|
+
# @return [String] The SID that identifies the call that created this leg.
|
675
682
|
def parent_call_sid
|
676
683
|
@properties['parent_call_sid']
|
677
684
|
end
|
678
685
|
|
679
686
|
##
|
680
|
-
# @return [String] If the call was inbound, this is the
|
687
|
+
# @return [String] If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed.
|
681
688
|
def phone_number_sid
|
682
689
|
@properties['phone_number_sid']
|
683
690
|
end
|
684
691
|
|
685
692
|
##
|
686
|
-
# @return [String] The charge for this
|
693
|
+
# @return [String] The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
|
687
694
|
def price
|
688
695
|
@properties['price']
|
689
696
|
end
|
@@ -695,43 +702,43 @@ module Twilio
|
|
695
702
|
end
|
696
703
|
|
697
704
|
##
|
698
|
-
# @return [String]
|
705
|
+
# @return [String] The unique string that identifies this resource
|
699
706
|
def sid
|
700
707
|
@properties['sid']
|
701
708
|
end
|
702
709
|
|
703
710
|
##
|
704
|
-
# @return [Time] The start time of the
|
711
|
+
# @return [Time] The start time of the call. Null if the call has not yet been dialed.
|
705
712
|
def start_time
|
706
713
|
@properties['start_time']
|
707
714
|
end
|
708
715
|
|
709
716
|
##
|
710
|
-
# @return [call.Status]
|
717
|
+
# @return [call.Status] The status of this call.
|
711
718
|
def status
|
712
719
|
@properties['status']
|
713
720
|
end
|
714
721
|
|
715
722
|
##
|
716
|
-
# @return [String]
|
723
|
+
# @return [String] A list of related subresources identified by their relative URIs
|
717
724
|
def subresource_uris
|
718
725
|
@properties['subresource_uris']
|
719
726
|
end
|
720
727
|
|
721
728
|
##
|
722
|
-
# @return [String] The phone number, SIP address or Client identifier that received this
|
729
|
+
# @return [String] The phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`.
|
723
730
|
def to
|
724
731
|
@properties['to']
|
725
732
|
end
|
726
733
|
|
727
734
|
##
|
728
|
-
# @return [String] The phone number, SIP address or Client identifier that received this
|
735
|
+
# @return [String] The phone number, SIP address or Client identifier that received this call. Formatted for display.
|
729
736
|
def to_formatted
|
730
737
|
@properties['to_formatted']
|
731
738
|
end
|
732
739
|
|
733
740
|
##
|
734
|
-
# @return [String] The URI
|
741
|
+
# @return [String] The URI of this resource, relative to `https://api.twilio.com`
|
735
742
|
def uri
|
736
743
|
@properties['uri']
|
737
744
|
end
|
@@ -752,32 +759,33 @@ module Twilio
|
|
752
759
|
|
753
760
|
##
|
754
761
|
# Update the CallInstance
|
755
|
-
# @param [String] url
|
756
|
-
# this URL when the call connects.
|
762
|
+
# @param [String] url The absolute URL that returns the TwiML instructions for the
|
763
|
+
# call. We will call this URL using the `method` when the call connects. For more
|
764
|
+
# information, see the [Url
|
757
765
|
# Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter)
|
758
|
-
# section in [Making Calls](https://www.twilio.com/docs/voice/make-calls)
|
759
|
-
#
|
760
|
-
#
|
761
|
-
#
|
762
|
-
#
|
763
|
-
#
|
764
|
-
#
|
765
|
-
#
|
766
|
-
#
|
767
|
-
# @param [String] fallback_url
|
768
|
-
# when requesting or executing the TwiML at `
|
769
|
-
# parameter is present, this parameter is ignored.
|
770
|
-
# @param [String] fallback_method The HTTP method that
|
771
|
-
#
|
772
|
-
#
|
773
|
-
# @param [String] status_callback
|
774
|
-
#
|
775
|
-
#
|
776
|
-
#
|
766
|
+
# section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
|
767
|
+
# @param [String] method The HTTP method we should use when calling the `url`. Can
|
768
|
+
# be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter
|
769
|
+
# is present, this parameter is ignored.
|
770
|
+
# @param [call.UpdateStatus] status The new status of the resource. Can be:
|
771
|
+
# `canceled` or `completed`. Specifying `canceled` will attempt to hang up calls
|
772
|
+
# that are queued or ringing; however, it will not affect calls already in
|
773
|
+
# progress. Specifying `completed` will attempt to hang up a call even if it's
|
774
|
+
# already in progress.
|
775
|
+
# @param [String] fallback_url The URL that we call using the `fallback_method` if
|
776
|
+
# an error occurs when requesting or executing the TwiML at `url`. If an
|
777
|
+
# `application_sid` parameter is present, this parameter is ignored.
|
778
|
+
# @param [String] fallback_method The HTTP method that we should use to request
|
779
|
+
# the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an
|
780
|
+
# `application_sid` parameter is present, this parameter is ignored.
|
781
|
+
# @param [String] status_callback The URL we should call using the
|
782
|
+
# `status_callback_method` to send status information to your application. If no
|
783
|
+
# `status_callback_event` is specified, we will send the `completed` status. If an
|
784
|
+
# `application_sid` parameter is present, this parameter is ignored. URLs must
|
777
785
|
# contain a valid hostname (underscores are not permitted).
|
778
|
-
# @param [String] status_callback_method The HTTP method
|
779
|
-
# requesting the `
|
780
|
-
# parameter is present, this parameter is ignored.
|
786
|
+
# @param [String] status_callback_method The HTTP method we should use when
|
787
|
+
# requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is
|
788
|
+
# `POST`. If an `application_sid` parameter is present, this parameter is ignored.
|
781
789
|
# @return [CallInstance] Updated CallInstance
|
782
790
|
def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset)
|
783
791
|
context.update(
|