Skip to main content

Bridge

The Bridge verb is used to bridge another party (target call) onto the current call.

When the target call is bridged, any BXML being executed in it will be cancelled.

The bridge ends when one of the calls leaves the bridge. A call leaves the bridge when it is hung up or when it gets redirected to another BXML.

One of the Bridge Complete or Bridge Target Complete webhooks is sent when the bridge ends, to allow the call that remained in the bridge to execute new BXML. For example, if the call that executed the Bridge verb hangs up or is redirected first, the Bridge Target Complete webhook is sent and the BXML returned from that will be executed on the bridge target. In this case, the Bridge Complete webhook is NOT sent. Similarly, if the target of the Bridge verb hangs up or is redirected first, the Bridge Complete webhook is sent and the BXML returned from that will be executed on the call that executed the Bridge. In this case, the Bridge Target Complete webhook is not sent.

There are certain circumstances in which calls cannot be bridged, such as when the target call:

  • is outbound and is still not answered
  • is executing Forward
  • is already hung up

In any of those cases a Bridge Complete event is sent with an error message.

Text Content

NameDescription
Target callString containing the callId of the call to be bridged.

Attributes

AttributeDescription
bridgeCompleteUrl(optional) URL to send the Bridge Complete event to and request new BXML.
If this attribute is specified, then Verbs following the <Bridge> verb will be ignored and the BXML returned in this webhook is executed on the call.
If this attribute is not specified then no webhook will be sent, and execution of the verbs following the <Bridge> verb continues. May be a relative URL.
bridgeCompleteMethod(optional) The HTTP method to use for the request to bridgeCompleteUrl. GET or POST. Default value is POST.
bridgeCompleteFallbackUrl(optional) A fallback url which, if provided, will be used to retry the Bridge Complete webhook delivery in case bridgeCompleteUrl fails to respond.
bridgeCompleteFallbackMethod(optional) The HTTP method to use to deliver the Bridge Complete webhook to bridgeCompleteFallbackUrl. GET or POST. Default value is POST.
bridgeTargetCompleteUrl(optional) URL to send the Bridge Target Complete event to and request new BXML.
If this attribute is specified, then the BXML returned in this webhook is executed on the target call.
If this attribute is not specified then no webhook will be sent, and the target call will be hung up. May be a relative URL.
bridgeTargetCompleteMethod(optional) The HTTP method to use for the request to bridgeTargetCompleteUrl. GET or POST. Default value is POST.
bridgeTargetCompleteFallbackUrl(optional) A fallback url which, if provided, will be used to retry the Bridge Target Complete webhook delivery in case bridgeTargetCompleteUrl fails to respond.
bridgeTargetCompleteFallbackMethod(optional) The HTTP method to use to deliver the Bridge Target Complete webhook to bridgeTargetCompleteFallbackUrl. GET or POST. Default value is POST.
username(optional) The username to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl.
password(optional) The password to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl.
fallbackUsername(optional) The username to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl.
fallbackPassword(optional) The password to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl.
tag(optional) A custom string that will be sent with the bridgeComplete webhook and all future webhooks of the call unless overwritten by a future tag attribute or <Tag> verb, or cleared.

May be cleared by setting tag=""

Max length 256 characters.

Webhooks Received

WebhooksCan reply with more BXML
Bridge CompleteYes
Bridge Target CompleteYes

Examples

Bridge Two Calls

First call (c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d):

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<SpeakSentence>Wait until the second call answers.</SpeakSentence>
<Pause duration="60" />
</Response>

Second call:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<SpeakSentence>The bridge will start now.</SpeakSentence>
<Bridge bridgeCompleteUrl="https://bridge.url/nextBXMLForSecondCall" bridgeTargetCompleteUrl="https://bridge.url/nextBXMLForFirstCall">
c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d
</Bridge>
</Response>