Skip to main content

Voice Call API - Make a voice call

Make a voice call

Interface Description:

Initiate a call directly to a number, most of which are applicable to calling the interface after clicking "Call" on the web page.

Request method: POST, form-data format

request parameters

parameter name type Is it necessary illustrate
service string App.Sip_Call.MakeCall
token string The token obtained through the authorization interface
extnumber string Ext
destnumber string target number
disnumber string Caller ID, if left blank, a random caller ID will be selected
userid string Custom parameters (employee id)
chengshudu string Custom parameters (maturity)
memberid string Custom parameters (member id)
customuuid string Custom parameters (customer id)

Interface request example(PHP)

<?php
    $apiUrl = 'http://127.0.0.1:8080';
    $postFields = [
        'service'   => 'App.Sip_Call.MakeCall',
        'token'     => 'ABCDEFG',
        'extnumber'  => 'abcdefg',
        'destnumber'  => 'abcdefg',
        'disnumber'  => 'abcdefg',
        'userid'  => 'abcdefg',
        'chengshudu'  => 'abcdefg',
        'memberid'  => 'abcdefg',
        'customuuid'  => 'abcdefg',
    ];
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $apiUrl);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $postFields);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $response = curl_exec($curl);
    $curlError = curl_error($curl);
    curl_close($curl);
    var_dump($response);
?>

return data structure example

{
    "ret": 200,
    "data": {
        "status": 0,
        "desc": "Call command sent successfully",
        "reqtime": 1581389402,
        "rsptime": 1581389402
    },
    "msg": ""
}