Skip to contentSkip to navigationSkip to topbar
On this page

TwiML™ Voice: <Connect>


(information)

Info

<Connect><Stream> is now available in the Ireland (IE1) and Australia (AU1) Regions.

Regional support is not available for <Room>, or <VirtualAgent>.

<Connect> is a TwiML verb that works together with nested TwiML nouns to connect Voice calls (over PSTN or SIP) to other Twilio services or external services.


<Connect> attributes

connect-attributes page anchor

<Connect> supports the following attributes that change its behavior:

AttributeAllowed ValuesDefault Value
actionRelative or absolute URLNone
methodGET, POSTPOST

action

action page anchor

The action attribute accepts an absolute or relative URL as a value. When the <Connect> verb ends, Twilio sends an HTTP request to this URL with Twilio's standard request parameters along with some parameters specific to the nested noun.

If you do not provide an action URL, <Connect> will finish and Twilio will move on to the next TwiML verb in the document. If there is no further verb, Twilio will end the phone call.

The method attribute specifies how Twilio will request the action URL: either using HTTP GET or POST. By default, Twilio uses POST.


The nouns that you can nest inside of <Connect> are listed in the table below. Click on a TwiML noun to see its docs page and how to use the noun with <Connect>.

NounDescription
<ConversationRelay><Connect><ConversationRelay> connects a call to a ConversationRelay service
<Room><Connect><Room> connects a call to a Programmable Video Room
<Stream><Connect><Stream> starts a bidirectional MediaStream
<VirtualAgent><Connect><VirtualAgent> connects a call to a Dialogflow VirtualAgent