Note that the use of the on-hook interface requiresInterface authentication

1 Interface overview

The third-party system calls the on-hook function by sending an HTTP POST request. Through this interface, the function of ending a call can be implemented in the customer's own system.

2 Interface request

  • HTTP request method:POST

  • Request url:{HOST}/v20160818/call/hangup/ACCOUNTID?sig=SIG

  • When requesting, please replace {HOST} with connection data queryDomain name,ACCOUNTID is replaced with the account number, SIG is generated according to the authentication rules, please see the authentication document to see the specific generation rules.

  • Authentication method:Interface authentication

3 Interface parameters

parameter name Is required value Parameter interpretation
CallID CallID and Agent are required. CallID is preferred Call ID This CallID is usually obtained by pushing the call event. You can pay attention to the link event, this parameter will be thrown when the call is connected
Agent CallID and Agent are required. CallID is preferred Agent number Such as 8000, 8001, 8002, etc.
ActionID no Unique string (can be random) Random code, used by the user to identify the requested operation. The Response returned by the server will carry the ActionID of the corresponding Action; this field will be included in the call event; the maximum length of this field is 40 bytes

Note: If there are multiple PBXs, the Agent ID is a required field.

4 System returns

Returns Json object, example:

{
    "Response": “HangUp”,
    "ActionID": "34534jh9i23",
    "Succeed": false,
    "Message": "401PBXnotfound"
}

Return value field description:

Field Name value Description
Response HangUp Name of the corresponding event
ActionID Unique string Unique tag for the operation
Succeed process result Whether the request was successful, and the reason will be given in the Message field when it is unsuccessful
Message Explanation of results 400 Error action:Incorrect request, please check if the parameters passed are valid
401 PBX not found:Account configuration issues
404 Account not found:Account not found, please check Account parameters