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:


1123
1124
1125
1126
1127
1128
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1123

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


1143
1144
1145
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1143

def autopilot(name, **keyword_args)
  append(Autopilot.new(name, **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


1135
1136
1137
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1135

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:


1156
1157
1158
1159
1160
1161
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1156

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, **keyword_args) ⇒ 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

keyword_args

additional attributes


1170
1171
1172
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1170

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