Skip to content

Start new call

Start a new call to a destination from a User or Device

DialBack mode: we dial first the targets and once one of those has answered we dial the destination. This allows the user to select which device will be used to start a new call
When no targets are specified we dial all linked device for the user in DialBack mode.
When the source parameter is defined we dial the source number in dial back mode and ignore all the other targets.
When only one target.sip_devices (and no other targets) is specified we try to start the call via the Phone api if this fails we dial the device

HTTP: User Auth in Basic Header

Authenticate using a User account (Pbx.instance_name_User.id (example: pbx20dev_7e6ba1ad-4c3c-43a6-a4b7-8c50e13e730d) is the username and password is sha256 of user.password or user.webrtc_password)

HTTP Authorization Scheme
basic
API Key: User Auth Password inQuery

Authenticate using a User account (Pbx.instance_name_User.id (example: pbx20dev_7e6ba1ad-4c3c-43a6-a4b7-8c50e13e730d) is the username and password is sha256 of user.password or user.webrtc_password) Alternative for HTTP Basic Auth password for clients who don't support Headers'

Parameter name
password
Located in
query
API Key: User Auth Username in Query

Authenticate using a User account (Pbx.instance_name_User.id (example: pbx20dev_7e6ba1ad-4c3c-43a6-a4b7-8c50e13e730d) is the username and password is sha256 of user.password or user.webrtc_password) Alternative for HTTP Basic Auth username for clients who don't support Headers'

Parameter name
username
Located in
query
debugAmiTrace query · boolean
Display the debug trace from asterisk manager
autoAnswer query · boolean
Auto Answer the call on the src device (default: false) (overrides default behaviors)
forceDialBack query · boolean
Forces the pbx to start a call in DialBack mode (default: false) (overrides default behaviors)
anonymous query · boolean
Should the call be anonymous (default: false)

Request body · required

Request schema
targetsobject
Which targets to start the call from - if multiple targets are specified we call each target in dial back mode
sip_devicesarray<uuid>
Src Device id's - if multiple devices are specified we call each device in DialBack mode - if only one device is specified and if the pbx can reach the device we instrukt the device to start a call - if the device is not accessible via the pbx we send a call to the device in DialBack mode
[]uuid
sip_device.id
items: 1–∞
example: a469de67-b79a-4dea-87d2-9a15858f10cd
webrtcboolean
Include the webrtc devices (Voxbi Web)
enum: 1
example: 1
twinningboolean
Include the twinning devices
enum: 1
example: 1
teamsboolean
Include the teams devices
enum: 1
example: 1
flipChannelstring
Specify which channel to flip, When the flipChannel is defined we always use the DialBack mode
example: Local/905a334f-5bf6-4ebc-85d3-2d5411187f68@C-TW-pbx16dev-00000057;2
destination*string
Destination to Call. - Allowed characters are 0-9 and + or * at the first position or a UUID of a user or ### (flip call) - If the starts with * we try to perform a pickup of the extension or the UUID of the user - If the destination is ### (flip call) you can add the flipChannel Parameter
example: 0035220333300
sourcestring
Specify the source number of the call (optional, forces dial back mode and ignores all `targets`) When the source parameter is defined we first dial the source number and then when the number answered the call we dial the destination. - Allowed characters are 0-9 and + or a UUID of a user - When using tts this parameter defines the where we route the call to once the `destination` answered the call
example: 2017
caller_identitystring
Specify the caller identity of the call
example: 905a334f-5bf6-4ebc-85d3-2d5411187f68
ttsarray<object>
Text to speach messages to play. - When the tts is defined and the `source` we go to the `source` and execute the call flow attached to it after the `destination` answered the call - When the tts is defined but no `source` is defined we play the tts messages to the `destination` and then we hangup the call
items: 1–∞
Each item — Text to speach message with tag
tag*string
example: welcome_message
message*string
example: Hello World
optionsobject
Additional options for the call (tts only)
dialed_user_idstring
Set the User UUID for dynamic dialing (Overwrites `dialed_extension_number`)
dialed_extension_numberstring
Set the Extension number for dynamic dialing

Responses

Call Started
Response schema
statusstring
Status of the call
enum: ok
example: ok
dialBackboolean
Did we used the dialBack Method to place the call
enum: 1
example: 1
destinationstring
Destination to Call
example: 0035220333000
targetsobject
Targets the pbx tried to DialBack to
sip_devicesarray<uuid>
Dialed SipDevices
[]uuid
sip_device.id
items: 1–∞
example: a469de67-b79a-4dea-87d2-9a15858f10cd
webrtcboolean
Did we dialed the webrtc devices (Voxbi Web)
enum: 1
example: 1
twinningboolean
Did we dialed the twinning devices
enum: 1
example: 1
teamsboolean
Did we dialed the teams devices
enum: 1
example: 1
click2dial_idstring
Click2Dial Call ID
example: 936a90653194073f7ce14f80b067186f68ab32749e1f1b8840d49bf6cd5c9e75
Bad Request - Request validation failed
Response schema
No response body.
post https://{username}.voxbi.cloud/api/{version}/calls/new
Base URL https://{username}.voxbi.cloud/api/{version}
Request sample
curl -X POST 'https://{username}.voxbi.cloud/api/{version}/calls/new' \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://{username}.voxbi.cloud/api/{version}/calls/new', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${YOUR_TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
import requests

response = requests.post('https://{username}.voxbi.cloud/api/{version}/calls/new',
    headers={'Authorization': f'Bearer {YOUR_TOKEN}'}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
    'http' => [
        'method'  => 'POST',
        'header'  => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
    ],
]);

$response = file_get_contents('https://{username}.voxbi.cloud/api/{version}/calls/new', false, $context);
$data = json_decode($response, true);
print_r($data);
Sample request
No request example provided.
No example for this status.
No example for this status.