Skip to main content

Originate call

This service creates a Originate call (Number Masking). The caller can be either internal or a telecommunications number. If the caller is a telecommunications number, the trunk name must also be provided. The time_out value is optional, and if not assigned, it is set to 30 seconds by default.

Important note

In a Originate call, if the first person does not answer and disconnects the call, the call data (CDR) will not be sent to your web service. If this is important for you, you can use the campaign creation APIs along with the autodialer route component to create a Originate call. For more details, please refer to this section.

parameters

DescriptionDefined DataSample DataRequired Parameters[**]/Logical[*]Parameters
(First person in the call) Caller-557**caller
(Second person in the call) Contact Number-552**callee
Specifies the first person's call route (along with the Outgoing_Route component)-main_routing**context
557-557**caller_id
Specifies the second person's call route-*trunk_name
Waiting time for answering-30timeout
Call duration time-30call_limit

Sample Invocation

Show Full Source Code PHP

	<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'http://192.168.51.20/api/v4/call/originate/act',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"caller":"557",
"callee":"552",
"context":"main_routing",
"caller_id":"557",
"trunk_name":"cisco",
"timeout":"30",
"call_limit":"30"
}',
CURLOPT_HTTPHEADER => array(
'X-APIKEY: vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG',
'Authorization: Basic dGVzdDpBYTEyMzQ1Ng==',
'Content-Type: application/json'
),
));

$response = curl_exec($curl);

if (!curl_errno($curl)) {
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
echo 'response code:'.$httpcode, '<br/>';
}

curl_close($curl);
echo $response;
?>

For further familiarity, several examples of use cases for this service are discussed in the practical examples section.