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).
POST
/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/bridge
Creates a new channel call and forward to it
Anfrage-Payload
from
string
to
string
erforderlich
ringTimeout
integer
maxDuration
integer
ringTone
string
Possible values: 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
hangupAfterBridge
boolean
record
boolean
recordStart
string
Possible values: record-from-answer, record-from-ringing
recordStereo
boolean
callFlow
array of object
Untergeordnete Parameter anzeigen
callFlow.command
string
Possible values: hangup, playback, say, gather, pause
callFlow.conditions
array of object
Untergeordnete Parameter anzeigen
callFlow.conditions.variable
string
Possible values: keys, speech
callFlow.conditions.operator
string
Possible values: eq, ne, ==, !=, contains
callFlow.conditions.value
string
callFlow.options
object
Untergeordnete Parameter anzeigen
callFlow.options.media
array of string
erforderlich
callFlow.options.loop
integer
callFlow.options.timeout
integer
callFlow.options.pauseMilliseconds
integer
callFlow.options.command
Value: say
callFlow.options.command
Value: gather
callFlow.options.command
Value: hangup
callFlow.options.command
Value: pause
notification
object
Untergeordnete Parameter anzeigen
notification.url
string
amdSettings
object
Untergeordnete Parameter anzeigen
amdSettings.enabled
boolean
erforderlich
amdSettings.wordCount
number
erforderlich
amdSettings.speechTimeout
number
erforderlich
amdSettings.speechLocale
string
erforderlich
Possible values: de-DE, en-AU, en-GB, en-US, es-US, it-IT, ja-JP, ko-KR, pt-BR, th-TH, zh-CN
amdSettings.beepTimeout
number
amdSettings.ifMachineNotifyAfter
string
erforderlich
Possible values: beep, wordCount
Antwort-Payload
command
object
Untergeordnete Attribute anzeigen
command.id
string
command.callId
string
command.callFlowId
string
command.status
string
command.command
string
command.conditions
array of object
Untergeordnete Attribute anzeigen
command.conditions.variable
string
Possible values: keys, speech
command.conditions.operator
string
Possible values: eq, ne, ==, !=, contains
command.conditions.value
string
bridgedCall
object
Untergeordnete Attribute anzeigen
bridgedCall.id
string
erforderlich
bridgedCall.channelId
string
erforderlich
bridgedCall.from
string
erforderlich
bridgedCall.to
string
erforderlich
bridgedCall.originator
object
erforderlich
Untergeordnete Attribute anzeigen
bridgedCall.originator.contact
object
Untergeordnete Attribute anzeigen
bridgedCall.originator.contact.id
string
erforderlich
bridgedCall.originator.contact.identifierKey
string
erforderlich
bridgedCall.originator.contact.identifierValue
string
erforderlich
bridgedCall.originator.number
object
erforderlich
Untergeordnete Attribute anzeigen
bridgedCall.originator.number.type
string
erforderlich
Possible values: pstn, sip, webrtc
bridgedCall.originator.number.number
string
erforderlich
bridgedCall.originator.number.anonymous
boolean
bridgedCall.originator.number.callerIdName
string
bridgedCall.originator.number.identity
string
bridgedCall.originator.number.countryIsoCode
string
bridgedCall.originator.number.pstnNumberType
string
bridgedCall.receiver
object
erforderlich
Untergeordnete Attribute anzeigen
bridgedCall.receiver.contact
object
Untergeordnete Attribute anzeigen
bridgedCall.receiver.contact.id
string
erforderlich
bridgedCall.receiver.contact.identifierKey
string
erforderlich
bridgedCall.receiver.contact.identifierValue
string
erforderlich
bridgedCall.receiver.number
object
erforderlich
Untergeordnete Attribute anzeigen
bridgedCall.receiver.number.type
string
erforderlich
Possible values: pstn, sip, webrtc
bridgedCall.receiver.number.number
string
erforderlich
bridgedCall.receiver.number.anonymous
boolean
bridgedCall.receiver.number.callerIdName
string
bridgedCall.receiver.number.identity
string
bridgedCall.receiver.number.countryIsoCode
string
bridgedCall.receiver.number.pstnNumberType
string
bridgedCall.parentId
string
bridgedCall.direction
string
erforderlich
Possible values: incoming, outgoing
bridgedCall.status
string
erforderlich
Possible values: accepted, starting, ringing, ongoing, completed, busy, no-answer, failed, cancelled, scheduled
bridgedCall.reason
string
bridgedCall.type
string
erforderlich
Possible values: pstn, sip, webrtc
bridgedCall.duration
integer
bridgedCall.hangupCauseCode
integer
bridgedCall.hangupSource
string
Possible values: callee, caller, api, timeout, media-timeout, none
bridgedCall.hangupSipCode
string
bridgedCall.createdAt
string
erforderlich
bridgedCall.updatedAt
string
erforderlich
bridgedCall.ringingAt
string
bridgedCall.answeredAt
string
bridgedCall.endedAt
string
bridgedCall.scheduledFor
string
bridgedCall.callFlow
object
Untergeordnete Attribute anzeigen
bridgedCall.callFlow.id
string
bridgedCall.callFlow.commands
array of object
Untergeordnete Attribute anzeigen
bridgedCall.callFlow.commands.id
string
bridgedCall.callFlow.commands.callId
string
bridgedCall.callFlow.commands.callFlowId
string
bridgedCall.callFlow.commands.status
string
bridgedCall.callFlow.commands.command
string
bridgedCall.callFlow.commands.conditions
array of object
Untergeordnete Attribute anzeigen
bridgedCall.callFlow.commands.conditions.variable
string
Possible values: keys, speech
bridgedCall.callFlow.commands.conditions.operator
string
Possible values: eq, ne, ==, !=, contains
bridgedCall.callFlow.commands.conditions.value
string
bridgedCall.notification
object
Untergeordnete Attribute anzeigen
bridgedCall.notification.url
string
bridgedCall.qualityInsights
object
Untergeordnete Attribute anzeigen
bridgedCall.qualityInsights.mos
string
bridgedCall.qualityInsights.pdd
string
bridgedCall.sipInsights
object
Untergeordnete Attribute anzeigen
bridgedCall.sipInsights.hangupSipCode
string
bridgedCall.sipInsights.edgeRegion
string
bridgedCall.sipInsights.providerName
string
bridgedCall.sipInsights.userAgent
string
bridgedCall.sipInsights.remoteSignallingIp
string
bridgedCall.sipInsights.remoteMediaIp
string
bridgedCall.amdResult
object
Untergeordnete Attribute anzeigen
bridgedCall.amdResult.result
string
Possible values: human, machine, noSpeech, beep, unknown
bridgedCall.amdResult.speech
string
bridgedCall.amdResult.locale
string
bridgedCall.sipType
string
Possible values: elastic, byoc, forward
bridgedCall.tags
array of string
Tags to associate with the call. Tags are converted to lower case and tags
that do not exist are automatically created. You can view your created tags
in the UI. You can specify up to 10 tags per call.
Codebeispiel
curl -X POST 'https://api.bird.com/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/bridge' \
-H 'Authorization: AccessKey YOUR_ACCESS_KEY'Example 1: Forward an inbound call to an external number
Codebeispiel
curl -X POST "https://api.bird.com/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/bridge" \
-H "Authorization: AccessKey YOUR_SECRET_TOKEN"
Codebeispiel
{
"from": "string",
"to": "string",
"ringTimeout": 30,
"maxDuration": 28800,
"record": true,
"recordStart": "record-from-answer",
"recordStereo": true
}
Codebeispiel
{
"command": {
"id": "5982f9a9-759f-48fb-b335-d3ab879f43b5",
"callId": "ea765a11-8cbb-45ac-80d8-f82b931af964",
"command": "bridge",
"status": "accepted"
},
"bridgedCall": {
"id": "e76ab303-f303-49c7-9cc9-64603b3d6a49",
"channelId": "db53c357-92e3-4f3d-babe-159573940a50",
"originator": {
"number": {
"type": "pstn",
"number": "+3197058016589",
"countryIsoCode": "NL"
}
},
"receiver": {
"contact": {
"id": "77571b0f-9b6e-4b5a-a54c-31067e72f989",
"identifierKey": "phonenumber",
"identifierValue": "+351910648517"
},
"number": {
"type": "pstn",
"number": "+351910648517",
"countryIsoCode": "PT"
}
},
"from": "+3197058016589",
"to": "+351910648517",
"parentId": "ea765a11-8cbb-45ac-80d8-f82b931af964",
"direction": "outgoing",
"status": "accepted",
"type": "pstn",
"duration": 0,
"notification": {},
"createdAt": "2024-03-04T11:19:25.852Z",
"updatedAt": "2024-03-04T11:19:25.852Z"
}
}