class Twilio::REST::Voice::V1::ByocTrunkContext
Public Class Methods
Initialize the ByocTrunkContext
@param [Version] version Version
that contains the resource @param [String] sid The Twilio-provided string that uniquely identifies the BYOC
Trunk resource to fetch.
@return [ByocTrunkContext] ByocTrunkContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb 198 def initialize(version, sid) 199 super(version) 200 201 # Path Solution 202 @solution = {sid: sid, } 203 @uri = "/ByocTrunks/#{@solution[:sid]}" 204 end
Public Instance Methods
Delete the ByocTrunkInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb 266 def delete 267 @version.delete('DELETE', @uri) 268 end
Fetch the ByocTrunkInstance
@return [ByocTrunkInstance] Fetched ByocTrunkInstance
# File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb 209 def fetch 210 payload = @version.fetch('GET', @uri) 211 212 ByocTrunkInstance.new(@version, payload, sid: @solution[:sid], ) 213 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb 279 def inspect 280 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 281 "#<Twilio.Voice.V1.ByocTrunkContext #{context}>" 282 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb 272 def to_s 273 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 274 "#<Twilio.Voice.V1.ByocTrunkContext #{context}>" 275 end
Update the ByocTrunkInstance
@param [String] friendly_name A descriptive string that you create to describe
the resource. It is not unique and can be up to 255 characters long.
@param [String] voice_url The URL we should call when the BYOC Trunk receives a
call.
@param [String] voice_method The HTTP
method we should use to call `voice_url` @param [String] voice_fallback_url The URL that we should call when an error
occurs while retrieving or executing the TwiML requested by `voice_url`.
@param [String] voice_fallback_method The HTTP
method we should use to call
`voice_fallback_url`. Can be: `GET` or `POST`.
@param [String] status_callback_url The URL that we should call to pass status
parameters (such as call ended) to your application.
@param [String] status_callback_method The HTTP
method we should use to call
`status_callback_url`. Can be: `GET` or `POST`.
@param [Boolean] cnam_lookup_enabled Whether Caller ID Name (CNAM) lookup is
enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See {CNAM Lookups}[https://www.twilio.com/docs/sip-trunking#CNAM] for more information.
@param [String] connection_policy_sid The SID of the Connection Policy that
Twilio will use when routing traffic to your communications infrastructure.
@param [String] from_domain_sid The SID of the SIP Domain
that should be used in
the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a {SIP Domain}[https://www.twilio.com/docs/voice/api/sending-sip] to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
@return [ByocTrunkInstance] Updated ByocTrunkInstance
# File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb 244 def update(friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset) 245 data = Twilio::Values.of({ 246 'FriendlyName' => friendly_name, 247 'VoiceUrl' => voice_url, 248 'VoiceMethod' => voice_method, 249 'VoiceFallbackUrl' => voice_fallback_url, 250 'VoiceFallbackMethod' => voice_fallback_method, 251 'StatusCallbackUrl' => status_callback_url, 252 'StatusCallbackMethod' => status_callback_method, 253 'CnamLookupEnabled' => cnam_lookup_enabled, 254 'ConnectionPolicySid' => connection_policy_sid, 255 'FromDomainSid' => from_domain_sid, 256 }) 257 258 payload = @version.update('POST', @uri, data: data) 259 260 ByocTrunkInstance.new(@version, payload, sid: @solution[:sid], ) 261 end