Class: Twilio::REST::Api::V2010::AccountContext::CallInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::CallInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/call.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this Call resource.
-
#answered_by ⇒ String
Either
humanormachineif this call was initiated with answering machine detection. -
#api_version ⇒ String
The API version used to create the call.
-
#caller_name ⇒ String
The caller’s name if this call was an incoming call to a phone number with caller ID Lookup enabled.
-
#context ⇒ CallContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in UTC that this resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in UTC that this resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the CallInstance.
-
#direction ⇒ String
A string describing the direction of the call.
-
#duration ⇒ String
The length of the call in seconds.
-
#end_time ⇒ Time
The time the call ended, given as UTC in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
-
#events ⇒ events
Access the events.
-
#fetch ⇒ CallInstance
Fetch the CallInstance.
-
#forwarded_from ⇒ String
The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding).
-
#from ⇒ String
The phone number, SIP address, Client identifier or SIM SID that made this call.
-
#from_formatted ⇒ String
The calling phone number, SIP address, or Client identifier formatted for display.
-
#group_sid ⇒ String
The Group SID associated with this call.
-
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ CallInstance
constructor
Initialize the CallInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#notifications ⇒ notifications
Access the notifications.
-
#parent_call_sid ⇒ String
The SID that identifies the call that created this leg.
-
#payments ⇒ payments
Access the payments.
-
#phone_number_sid ⇒ String
If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call.
-
#price ⇒ String
The charge for this call, in the currency associated with the account.
-
#price_unit ⇒ String
The currency in which
Priceis measured, in [ISO 4127](www.iso.org/iso/home/standards/currency_codes.htm) format (e.g.,USD,EUR,JPY). -
#queue_time ⇒ String
The wait time in milliseconds before the call is placed.
-
#recordings ⇒ recordings
Access the recordings.
-
#sid ⇒ String
The unique string that we created to identify this Call resource.
-
#siprec ⇒ siprec
Access the siprec.
-
#start_time ⇒ Time
The start time of the call, given as UTC in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.
- #status ⇒ Status
-
#streams ⇒ streams
Access the streams.
-
#subresource_uris ⇒ Hash
A list of subresources available to this call, identified by their URIs relative to
https://api.twilio.com. -
#to ⇒ String
The phone number, SIP address, Client identifier or SIM SID that received this call.
-
#to_formatted ⇒ String
The phone number, SIP address or Client identifier that received this call.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transcriptions ⇒ transcriptions
Access the transcriptions.
-
#trunk_sid ⇒ String
The unique identifier of the trunk resource that was used for this call.
-
#update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset) ⇒ CallInstance
Update the CallInstance.
-
#uri ⇒ String
The URI of this resource, relative to
https://api.twilio.com. -
#user_defined_message_subscriptions ⇒ user_defined_message_subscriptions
Access the user_defined_message_subscriptions.
-
#user_defined_messages ⇒ user_defined_messages
Access the user_defined_messages.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ CallInstance
Initialize the CallInstance
1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1032 def initialize(version, payload , account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'parent_call_sid' => payload['parent_call_sid'], 'account_sid' => payload['account_sid'], 'to' => payload['to'], 'to_formatted' => payload['to_formatted'], 'from' => payload['from'], 'from_formatted' => payload['from_formatted'], 'phone_number_sid' => payload['phone_number_sid'], 'status' => payload['status'], 'start_time' => Twilio.deserialize_rfc2822(payload['start_time']), 'end_time' => Twilio.deserialize_rfc2822(payload['end_time']), 'duration' => payload['duration'], 'price' => payload['price'], 'price_unit' => payload['price_unit'], 'direction' => payload['direction'], 'answered_by' => payload['answered_by'], 'api_version' => payload['api_version'], 'forwarded_from' => payload['forwarded_from'], 'group_sid' => payload['group_sid'], 'caller_name' => payload['caller_name'], 'queue_time' => payload['queue_time'], 'trunk_sid' => payload['trunk_sid'], 'uri' => payload['uri'], 'subresource_uris' => payload['subresource_uris'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this Call resource.
1108 1109 1110 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1108 def account_sid @properties['account_sid'] end |
#answered_by ⇒ String
Returns Either human or machine if this call was initiated with answering machine detection. Empty otherwise.
1186 1187 1188 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1186 def answered_by @properties['answered_by'] end |
#api_version ⇒ String
Returns The API version used to create the call.
1192 1193 1194 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1192 def api_version @properties['api_version'] end |
#caller_name ⇒ String
Returns The caller’s name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty.
1210 1211 1212 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1210 def caller_name @properties['caller_name'] end |
#context ⇒ CallContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
1075 1076 1077 1078 1079 1080 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1075 def context unless @instance_context @instance_context = CallContext.new(@version , @params['account_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in UTC that this resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
1090 1091 1092 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1090 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in UTC that this resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
1096 1097 1098 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1096 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CallInstance
1241 1242 1243 1244 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1241 def delete context.delete end |
#direction ⇒ String
Returns A string describing the direction of the call. Can be: inbound for inbound calls, outbound-api for calls initiated via the REST API or outbound-dial for calls initiated by a ‘<Dial>` verb. Using [Elastic SIP Trunking](www.twilio.com/docs/sip-trunking), the values can be [trunking-terminating](www.twilio.com/docs/sip-trunking#termination) for outgoing calls from your communications infrastructure to the PSTN or [trunking-originating](www.twilio.com/docs/sip-trunking#origination) for incoming calls to your communications infrastructure from the PSTN.
1180 1181 1182 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1180 def direction @properties['direction'] end |
#duration ⇒ String
Returns The length of the call in seconds. This value is empty for busy, failed, unanswered, or ongoing calls.
1162 1163 1164 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1162 def duration @properties['duration'] end |
#end_time ⇒ Time
Returns The time the call ended, given as UTC in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call did not complete successfully.
1156 1157 1158 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1156 def end_time @properties['end_time'] end |
#events ⇒ events
Access the events
1294 1295 1296 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1294 def events context.events end |
#fetch ⇒ CallInstance
Fetch the CallInstance
1249 1250 1251 1252 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1249 def fetch context.fetch end |
#forwarded_from ⇒ String
Returns The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty.
1198 1199 1200 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1198 def forwarded_from @properties['forwarded_from'] end |
#from ⇒ String
Returns The phone number, SIP address, Client identifier or SIM SID that made this call. Phone numbers are in [E.164](www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as ‘[email protected]`. Client identifiers are formatted client:name. SIM SIDs are formatted as sim:sid.
1126 1127 1128 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1126 def from @properties['from'] end |
#from_formatted ⇒ String
Returns The calling phone number, SIP address, or Client identifier formatted for display. Non-North American phone numbers are in [E.164](www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750).
1132 1133 1134 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1132 def from_formatted @properties['from_formatted'] end |
#group_sid ⇒ String
Returns The Group SID associated with this call. If no Group is associated with the call, the field is empty.
1204 1205 1206 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1204 def group_sid @properties['group_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
1363 1364 1365 1366 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1363 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.CallInstance #{values}>" end |
#notifications ⇒ notifications
Access the notifications
1343 1344 1345 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1343 def notifications context.notifications end |
#parent_call_sid ⇒ String
Returns The SID that identifies the call that created this leg.
1102 1103 1104 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1102 def parent_call_sid @properties['parent_call_sid'] end |
#payments ⇒ payments
Access the payments
1329 1330 1331 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1329 def payments context.payments end |
#phone_number_sid ⇒ String
Returns 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.
1138 1139 1140 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1138 def phone_number_sid @properties['phone_number_sid'] end |
#price ⇒ String
Returns The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. The price associated with a call only reflects the charge for connectivity. Charges for other call-related features such as Answering Machine Detection, Text-To-Speech, and SIP REFER are not included in this value.
1168 1169 1170 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1168 def price @properties['price'] end |
#price_unit ⇒ String
Returns The currency in which Price is measured, in [ISO 4127](www.iso.org/iso/home/standards/currency_codes.htm) format (e.g., USD, EUR, JPY). Always capitalized for calls.
1174 1175 1176 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1174 def price_unit @properties['price_unit'] end |
#queue_time ⇒ String
Returns The wait time in milliseconds before the call is placed.
1216 1217 1218 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1216 def queue_time @properties['queue_time'] end |
#recordings ⇒ recordings
Access the recordings
1336 1337 1338 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1336 def recordings context.recordings end |
#sid ⇒ String
Returns The unique string that we created to identify this Call resource.
1084 1085 1086 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1084 def sid @properties['sid'] end |
#siprec ⇒ siprec
Access the siprec
1315 1316 1317 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1315 def siprec context.siprec end |
#start_time ⇒ Time
Returns The start time of the call, given as UTC in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call has not yet been dialed.
1150 1151 1152 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1150 def start_time @properties['start_time'] end |
#status ⇒ Status
1144 1145 1146 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1144 def status @properties['status'] end |
#streams ⇒ streams
Access the streams
1350 1351 1352 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1350 def streams context.streams end |
#subresource_uris ⇒ Hash
Returns A list of subresources available to this call, identified by their URIs relative to https://api.twilio.com.
1234 1235 1236 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1234 def subresource_uris @properties['subresource_uris'] end |
#to ⇒ String
Returns The phone number, SIP address, Client identifier or SIM SID that received this call. Phone numbers are in [E.164](www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as ‘[email protected]`. Client identifiers are formatted client:name. SIM SIDs are formatted as sim:sid.
1114 1115 1116 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1114 def to @properties['to'] end |
#to_formatted ⇒ String
Returns The phone number, SIP address or Client identifier that received this call. Formatted for display. Non-North American phone numbers are in [E.164](www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750).
1120 1121 1122 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1120 def to_formatted @properties['to_formatted'] end |
#to_s ⇒ Object
Provide a user friendly representation
1356 1357 1358 1359 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1356 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.CallInstance #{values}>" end |
#transcriptions ⇒ transcriptions
Access the transcriptions
1308 1309 1310 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1308 def transcriptions context.transcriptions end |
#trunk_sid ⇒ String
Returns The unique identifier of the trunk resource that was used for this call. The field is empty if the call was not made using a SIP trunk or if the call is not terminated.
1222 1223 1224 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1222 def trunk_sid @properties['trunk_sid'] end |
#update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset) ⇒ CallInstance
Update the CallInstance
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1266 def update( url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset ) context.update( url: url, method: method, status: status, fallback_url: fallback_url, fallback_method: fallback_method, status_callback: status_callback, status_callback_method: status_callback_method, twiml: twiml, time_limit: time_limit, ) end |
#uri ⇒ String
Returns The URI of this resource, relative to https://api.twilio.com.
1228 1229 1230 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1228 def uri @properties['uri'] end |
#user_defined_message_subscriptions ⇒ user_defined_message_subscriptions
Access the user_defined_message_subscriptions
1322 1323 1324 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1322 def context. end |
#user_defined_messages ⇒ user_defined_messages
Access the user_defined_messages
1301 1302 1303 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call.rb', line 1301 def context. end |