Forward a call

Forward a call to another phone number or to a SIP URI. This command will create a new call resource and both calls will be connected (bridged).

Command bridge new call with existing call

Check below the forward call object's properties.

type: object
title: Bridge new call with existing call
additionalProperties: false
properties:
  from:
    type: string
  to:
    type: string
  ringTimeout:
    type: integer
    minimum: 3
    maximum: 120
    default: 30
  maxDuration:
    type: integer
    minimum: 1
    default: 28800
  ringTone:
    $ref: '../properties/RingTone.yml'
  hangupAfterBridge:
    type: boolean
  record:
    type: boolean
  recordStart:
    type: string
    enum:
      - record-from-answer
      - record-from-ringing
  recordStereo:
    type: boolean
  notification:
    $ref: '../properties/Notification.yml'
required:
  - to

Forward call

Creates a new channel call and forward to it

POST/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/bridge
Authorization
Path parameters
workspaceId*string (uuid)

The ID of the workspace

callId*string (uuid)

The ID for a call

channelId*string (uuid)

The ID for a channel

Body
fromstring
to*string
ringTimeoutinteger
maxDurationinteger
ringTonenullable RingTone (enum)
becacncyczdedkdzegfifrhkhuilinjpkopkplrorsrusatrukus
hangupAfterBridgeboolean
recordboolean
recordStartenum
record-from-answerrecord-from-ringing
recordStereoboolean
notificationCallNotification
amdSettingsAmdSettings
Response

Call Command Bridge was accepted for processing

Body
commandCallCommandResponse
bridgedCallChannelCall
Request
const response = await fetch('/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/bridge', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer jwt",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "to": "text"
    }),
});
const data = await response.json();
Response
{
  "command": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "callId": "123e4567-e89b-12d3-a456-426614174000",
    "callFlowId": "123e4567-e89b-12d3-a456-426614174000",
    "status": "text",
    "command": "text"
  },
  "bridgedCall": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "channelId": "123e4567-e89b-12d3-a456-426614174000",
    "from": "text",
    "to": "text",
    "originator": {
      "contact": {
        "id": "text",
        "identifierKey": "text",
        "identifierValue": "text"
      },
      "number": {
        "type": "pstn",
        "number": "text",
        "anonymous": false,
        "callerIdName": "text",
        "identity": "text",
        "countryIsoCode": "text",
        "pstnNumberType": "text"
      }
    },
    "receiver": {
      "contact": {
        "id": "text",
        "identifierKey": "text",
        "identifierValue": "text"
      },
      "number": {
        "type": "pstn",
        "number": "text",
        "anonymous": false,
        "callerIdName": "text",
        "identity": "text",
        "countryIsoCode": "text",
        "pstnNumberType": "text"
      }
    },
    "parentId": "123e4567-e89b-12d3-a456-426614174000",
    "direction": "incoming",
    "status": "accepted",
    "reason": "text",
    "type": "pstn",
    "hangupSource": "callee",
    "hangupSipCode": "text",
    "createdAt": "2024-11-21T09:14:34.327Z",
    "updatedAt": "2024-11-21T09:14:34.327Z",
    "ringingAt": "2024-11-21T09:14:34.327Z",
    "answeredAt": "2024-11-21T09:14:34.327Z",
    "endedAt": "2024-11-21T09:14:34.327Z",
    "scheduledFor": "2024-11-21T09:14:34.327Z",
    "callFlow": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "commands": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "callId": "123e4567-e89b-12d3-a456-426614174000",
          "callFlowId": "123e4567-e89b-12d3-a456-426614174000",
          "status": "text",
          "command": "text"
        }
      ]
    },
    "notification": {
      "url": "text"
    },
    "qualityInsights": {
      "mos": "text",
      "pdd": "text"
    },
    "sipInsights": {
      "hangupSipCode": "text",
      "edgeRegion": "text",
      "providerName": "text",
      "userAgent": "text",
      "remoteSignallingIp": "text",
      "remoteMediaIp": "text"
    },
    "amdResult": {
      "result": "human",
      "speech": "text",
      "locale": "text"
    },
    "sipType": "elastic",
    "tags": [
      "text"
    ]
  }
}

Example 1: Forward an inbound call to an external number

curl -X POST "https://nest.messagebird.one/workspaces/8bc02f53-87ac-48d2-b4fd-c2cf856a305f/channels/880d8171-cbab-47bb-81b6-b1a0902da136/calls/4fc2edf7-68f5-437a-89eb-3ce0095409d6
/bridge" \
     -H 'Authorization: Bearer {Token}'

Last updated