JSON API » calls » calls/hangup
Hangs up a call. The call is specified by either the callid or uniqueid fields. The actual hanging up is asynchronous, and may take a second or two after the function returns.
Input parameters
Requires authentication and the administrator role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
callid | String | Callid of call. | Yes, unless uniqueid is specified. | Empty string. |
uniqueid | String | Uniqueid of call. | Yes, unless callid is specified. | Empty string. |
Either the callid or the uniqueid must be specified, but not both.
Responses
Code | Description |
---|---|
204 | Hang up successfully requested. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
404 | The call does not exist, or you do not have permission to view it. |
Data returned
No data is returned.
Example: With callid
http://enswitch.example.com/api/json/calls/hangup/?auth_username=user;auth_password=password;callid=1234567890.123456{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Example: With uniqueid
http://enswitch.example.com/api/json/calls/hangup/?auth_username=user;auth_password=password;uniqueid=1234567890.123456{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
3.13 | Function added. |