Make a Call
You can initiate multiple types of call through the interface.
Supported types of call
Caller | Callee |
---|---|
Extension |
|
IVR |
|
Ring Group |
|
Queue |
|
External number |
|
Background information
The API interface is restricted by
the dial permission of the caller.
- Make internal call
- If the callee is an extension number, and the caller is not allowed to view the callee (set in the Client Permission on the PBX), then the call would fail and trigger a (30015) Call Failed event.
- Make external call
- If the callee is an external number, and the caller has no outbound call permission, then the call would fail and trigger a (30015) Call Failed event.
Note: In this case, you can use the
dial_permission
parameter to make the call with
the dial permission of other extensions.Request URL
POST {base_url}/{api_path}/call/dial?access_token={access_token}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
caller | Yes | String | The caller number. |
callee | Yes | String | The callee number. |
dial_permission | No | String | Enter an extension number that has the desired dial
permission. Note:
|
auto_answer | No | String | If
caller is an extension number, you can
decide whether to auto answer the call to
callee.Note: This setting only takes effect on
the IP phones that support auto answer
feature. Valid value:
|
Response parameters
Parameter | Type | Description |
---|---|---|
errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
errmsg | String | Returned message.
|
call_id | String | The unique ID of each call. |
Examples
Request example
Extension 1005 uses the outbound call permission of extension 2002 to call an external number 5503301.
POST /openapi/v1.0/call/dial?access_token=4aR4RzkFGEfIvGDJVbAd4vEWg6NtoWog HTTP/1.1 Host: 192.168.5.150:8088 Content-Type: application/json { "caller": "1005", "callee": "5503301", "dial_permission": "2002", "auto_answer": "yes" }
Response example
HTTP/1.1 200 OK { "errcode": 0, "errmsg": "SUCCESS", "call_id": "1650095575.872" }