dial

View as MarkdownOpen in Claude

Initiate a new outbound call. Provide either a url pointing to a SWML document or an inline swml object to control the call flow.

Request

dialobjectRequired
OR
updateobjectRequired
OR
calling.endobjectRequired
OR
calling.disconnectobjectRequired
OR
calling.ai_holdobjectRequired
OR
calling.ai_unholdobjectRequired
OR
calling.ai_messageobjectRequired
OR
calling.ai.stopobjectRequired
OR
calling.playobjectRequired
OR
calling.play.pauseobjectRequired
OR
calling.play.resumeobjectRequired
OR
calling.play.stopobjectRequired
OR
calling.play.volumeobjectRequired
OR
calling.recordobjectRequired
OR
calling.record.pauseobjectRequired
OR
calling.record.resumeobjectRequired
OR
calling.record.stopobjectRequired
OR
calling.collectobjectRequired
OR
calling.collect.stopobjectRequired
OR
calling.collect.start_input_timersobjectRequired
OR
calling.detectobjectRequired
OR
calling.detect.stopobjectRequired
OR
calling.tapobjectRequired
OR
calling.tap.stopobjectRequired
OR
calling.streamobjectRequired
OR
calling.stream.stopobjectRequired
OR
calling.denoiseobjectRequired
OR
calling.denoise.stopobjectRequired
OR
calling.transcribeobjectRequired
OR
calling.transcribe.stopobjectRequired
OR
calling.live_transcribeobjectRequired
OR
calling.live_translateobjectRequired
OR
calling.transferobjectRequired
OR
calling.send_fax.stopobjectRequired
OR
calling.receive_fax.stopobjectRequired
OR
calling.referobjectRequired
OR
calling.user_eventobjectRequired

Response

Call LegobjectRequired
OR
Fabric Subscriber Device LegobjectRequired

Response Example

Response
1{
2 "id": "0e9c80d7-a149-4917-892d-420043709f45",
3 "from": "+12069708643",
4 "to": "+15550198765",
5 "direction": "outbound-api",
6 "source": "realtime_api",
7 "charge": 0,
8 "created_at": "2024-05-06T12:20:00Z",
9 "charge_details": [
10 {
11 "description": "Outbound Voice",
12 "charge": 0.004
13 }
14 ],
15 "status": "queued",
16 "type": "relay_pstn_call"
17}

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9const result = await client.calling.dial({
10 from: "+15551234567",
11 to: "+15559876543",
12 url: "https://example.com/call-handler",
13});
14console.log(result); // { id: "call-id-xxx", ... }