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:


1701
1702
1703
1704
1705
1706
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1701

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


1721
1722
1723
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1721

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, 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

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


1771
1772
1773
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1771

def conversation(service_instance_sid: nil, inbound_autocreation: nil, routing_assignment_timeout: nil, inbound_timeout: 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, 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


1713
1714
1715
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1713

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:


1734
1735
1736
1737
1738
1739
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1734

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:


1749
1750
1751
1752
1753
1754
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1749

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