Connect
Beta
The Connect verb is currently in Beta and is used to connect calls to Endpoints created via the BRTC APIs. To learn more about BRTC or to get access, please contact support@bandwidth.com.
The Connect verb is used to connect a call to an Endpoint.
Text Content
There is no text content available to be set for the <Connect> verb.
Attributes
| Attribute | Description |
|---|---|
| eventCallbackUrl | (optional) URL to send Connect Status events to during the connection lifecycle. May be a relative URL. |
| eventFallbackUrl | (optional) Fallback URL used by Bandwidth when delivery to eventCallbackUrl fails. May be a relative URL. |
Nestable Verbs
The following verbs may be nested inside of a <Connect> verb to define the connection destination:
| Verb | Description |
|---|---|
| Endpoint | An Endpoint ID to connect the call to. |
Endpoint
The <Endpoint> verb is used within the <Connect> verb to specify an endpoint destination.
Text Content
| Name | Description |
|---|---|
| Endpoint ID | String containing the endpoint ID to connect to. |
Attributes
The <Endpoint> verb has no attributes.
Examples
Connect to an Endpoint
This shows how to use Bandwidth XML to connect a call to an endpoint.
- XML
- Java
- C#
- NodeJS
- Python
- PHP
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Connect eventCallbackUrl="https://example.com/callback" eventFallbackUrl="https://fallback.example.com/callback">
<Endpoint>endpoint-abc123</Endpoint>
</Connect>
</Response>
Endpoint endpoint = new Endpoint("endpoint-abc123");
Connect connect = new Connect().builder()
.eventCallbackUrl("https://example.com/callback")
.eventFallbackUrl("https://fallback.example.com/callback")
.endpoints(List.of(endpoint))
.build();
Response response = new Response()
.withVerbs(connect);
System.out.println(response.toBXML());
Endpoint endpoint = new Endpoint
{
EndpointId = "endpoint-abc123"
};
Connect connect = new Connect
{
EventCallbackUrl = "https://example.com/callback",
EventFallbackUrl = "https://fallback.example.com/callback",
Endpoints = new Endpoint[] { endpoint }
};
Response response = new Response();
response.Add(connect);
Console.WriteLine(response.ToBXML());
const endpoint = new Bxml.Endpoint('endpoint-abc123');
const connect = new Bxml.Connect(
{
eventCallbackUrl: 'https://example.com/callback',
eventFallbackUrl: 'https://fallback.example.com/callback'
},
[endpoint]
);
const response = new Bxml.Response(connect);
console.log(response.toBxml());
endpoint = Endpoint(
endpoint_id="endpoint-abc123"
)
connect = Connect(
event_callback_url="https://example.com/callback",
event_fallback_url="https://fallback.example.com/callback",
endpoints=[endpoint]
)
response = Response()
response.add_verb(connect)
print(response.to_bxml())
$endpoint = new BandwidthLib\Voice\Bxml\Endpoint("endpoint-abc123");
$connect = new BandwidthLib\Voice\Bxml\Connect();
$connect->eventCallbackUrl("https://example.com/callback");
$connect->eventFallbackUrl("https://fallback.example.com/callback");
$connect->endpoints(array($endpoint));
$response = new BandwidthLib\Voice\Bxml\Response();
$response->addVerb($connect);
echo $response->toBxml();