Class: Twilio::TwiML::Connect

Inherits:
TwiML
  • Object
show all
Defined in:
lib/twilio-ruby/twiml/voice_response.rb

Overview

<Connect> TwiML Verb

Instance Attribute Summary

Attributes inherited from TwiML

#name

Instance Method Summary collapse

Methods inherited from TwiML

#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml

Constructor Details

#initialize(**keyword_args) {|_self| ... } ⇒ Connect

Returns a new instance of Connect.

Yields:

  • (_self)

Yield Parameters:



1802
1803
1804
1805
1806
1807
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1802

def initialize(**keyword_args)
  super(**keyword_args)
  @name = 'Connect'

  yield(self) if block_given?
end

Instance Method Details

#autopilot(name, **keyword_args) ⇒ Object

Create a new <Autopilot> element

name

Autopilot assistant sid or unique name

keyword_args

additional attributes



1822
1823
1824
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1822

def autopilot(name, **keyword_args)
  append(Autopilot.new(name, **keyword_args))
end

#conversation(service_instance_sid: nil, inbound_autocreation: nil, routing_assignment_timeout: nil, inbound_timeout: nil, url: nil, method: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, status_callback: nil, status_callback_method: nil, status_callback_event: nil, **keyword_args) ⇒ Object

Create a new <Conversation> element

service_instance_sid

Service instance Sid

inbound_autocreation

Inbound autocreation

routing_assignment_timeout

Routing assignment timeout

inbound_timeout

Inbound timeout

url

TwiML URL

method

TwiML URL method

record

Record

trim

Trim

recording_status_callback

Recording status callback URL

recording_status_callback_method

Recording status callback URL method

recording_status_callback_event

Recording status callback events

status_callback

Status callback URL

status_callback_method

Status callback URL method

status_callback_event

Events to call status callback URL

keyword_args

additional attributes



1874
1875
1876
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1874

def conversation(service_instance_sid: nil, inbound_autocreation: nil, routing_assignment_timeout: nil, inbound_timeout: nil, url: nil, method: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, status_callback: nil, status_callback_method: nil, status_callback_event: nil, **keyword_args)
  append(Conversation.new(service_instance_sid: service_instance_sid, inbound_autocreation: inbound_autocreation, routing_assignment_timeout: routing_assignment_timeout, inbound_timeout: inbound_timeout, url: url, method: method, record: record, trim: trim, recording_status_callback: recording_status_callback, recording_status_callback_method: recording_status_callback_method, recording_status_callback_event: recording_status_callback_event, status_callback: status_callback, status_callback_method: status_callback_method, status_callback_event: status_callback_event, **keyword_args))
end

#room(name, participant_identity: nil, **keyword_args) ⇒ Object

Create a new <Room> element

name

Room name

participant_identity

Participant identity when connecting to the Room

keyword_args

additional attributes



1814
1815
1816
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1814

def room(name, participant_identity: nil, **keyword_args)
  append(Room.new(name, participant_identity: participant_identity, **keyword_args))
end

#stream(name: nil, connector_name: nil, url: nil, track: nil, status_callback: nil, status_callback_method: nil, **keyword_args) {|stream| ... } ⇒ Object

Create a new <Stream> element

name

Friendly name given to the Stream

connector_name

Unique name for Stream Connector

url

URL of the remote service where the Stream is routed

track

Track to be streamed to remote service

status_callback

Status Callback URL

status_callback_method

Status Callback URL method

keyword_args

additional attributes

Yields:



1835
1836
1837
1838
1839
1840
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1835

def stream(name: nil, connector_name: nil, url: nil, track: nil, status_callback: nil, status_callback_method: nil, **keyword_args)
  stream = Stream.new(name: name, connector_name: connector_name, url: url, track: track, status_callback: status_callback, status_callback_method: status_callback_method, **keyword_args)

  yield(stream) if block_given?
  append(stream)
end

#virtual_agent(connector_name: nil, language: nil, sentiment_analysis: nil, status_callback: nil, status_callback_method: nil, **keyword_args) {|virtual_agent| ... } ⇒ Object

Create a new <VirtualAgent> element

connector_name

Defines the conversation profile Dialogflow needs to use

language

Language to be used by Dialogflow to transcribe speech

sentiment_analysis

Whether sentiment analysis needs to be enabled or not

status_callback

URL to post status callbacks from Twilio

status_callback_method

HTTP method to use when requesting the status callback URL

keyword_args

additional attributes

Yields:



1850
1851
1852
1853
1854
1855
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1850

def virtual_agent(connector_name: nil, language: nil, sentiment_analysis: nil, status_callback: nil, status_callback_method: nil, **keyword_args)
  virtual_agent = VirtualAgent.new(connector_name: connector_name, language: language, sentiment_analysis: sentiment_analysis, status_callback: status_callback, status_callback_method: status_callback_method, **keyword_args)

  yield(virtual_agent) if block_given?
  append(virtual_agent)
end