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

Authorizations
Path parameters
workspaceIdstring · uuidrequired

The ID of the workspace

callIdstring · uuidrequired

The ID for a call

channelIdstring · uuidrequired

The ID for a channel

Body
fromstring
tostringrequired
ringTimeoutinteger · min: 3 · max: 120 · default: 30
maxDurationinteger · min: 1 · default: 28800
ringTonestring · enum | nullable
Options: be, ca, cn, cy, cz, de, dk, dz, eg, fi, fr, hk, hu, il, in, jp, ko, pk, pl, ro, rs, ru, sa, tr, uk, us
hangupAfterBridgeboolean
recordboolean
recordStereoboolean
notificationCallNotification
amdSettingsAmdSettings
recordStartstring · enum
Options: record-from-answer, record-from-ringing
callFlowCallFlowCommand[]
Responses
curl -L \
  --request POST \
  --url '/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/bridge' \
  --header 'Authorization: Bearer jwt' \
  --header 'Content-Type: application/json' \
  --data '{"to":"text","ringTimeout":30,"maxDuration":28800,"ringTone":"be","notification":{},"amdSettings":{"enabled":false,"wordCount":5,"speechTimeout":3,"beepTimeout":30,"speechLocale":"en-US","ifMachineNotifyAfter":"wordCount"},"recordStart":"record-from-answer","callFlow":[{"command":"hangup","conditions":[{"variable":"keys","operator":"eq"}],"options":{"media":[null]}}]}'
{
  "command": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "callId": "123e4567-e89b-12d3-a456-426614174000",
    "callFlowId": "123e4567-e89b-12d3-a456-426614174000",
    "status": "text",
    "command": "text",
    "conditions": [
      {
        "value": "text",
        "variable": "keys",
        "operator": "eq"
      }
    ]
  },
  "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": true,
        "callerIdName": "text",
        "identity": "text",
        "countryIsoCode": "text",
        "pstnNumberType": "text"
      }
    },
    "receiver": {
      "contact": {
        "id": "text",
        "identifierKey": "text",
        "identifierValue": "text"
      },
      "number": {
        "type": "pstn",
        "number": "text",
        "anonymous": true,
        "callerIdName": "text",
        "identity": "text",
        "countryIsoCode": "text",
        "pstnNumberType": "text"
      }
    },
    "parentId": "123e4567-e89b-12d3-a456-426614174000",
    "direction": "incoming",
    "status": "accepted",
    "reason": "text",
    "type": "pstn",
    "duration": 1,
    "hangupCauseCode": 1,
    "hangupSource": "callee",
    "hangupSipCode": "text",
    "createdAt": "2025-02-21T18:07:59.971Z",
    "updatedAt": "2025-02-21T18:07:59.971Z",
    "ringingAt": "2025-02-21T18:07:59.971Z",
    "answeredAt": "2025-02-21T18:07:59.971Z",
    "endedAt": "2025-02-21T18:07:59.971Z",
    "scheduledFor": "2025-02-21T18:07:59.971Z",
    "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",
          "conditions": [
            {
              "value": "text",
              "variable": "keys",
              "operator": "eq"
            }
          ]
        }
      ]
    },
    "notification": {
      "url": "text"
    },
    "qualityInsights": {
      "mos": "text",
      "pdd": "text"
    },
    "sipInsights": {
      "hangupSipCode": "text",
      "edgeRegion": "text",
      "providerName": "text",
      "userAgent": "text",
      "remoteSignallingIp": "text",
      "remoteMediaIp": "text"
    },
    "amdResult": {
      "speech": "text",
      "locale": "text",
      "result": "human"
    },
    "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

Was this helpful?