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 actions or panel role privilege. User must also be an administrator, owner of a telephone line involved, or allowed to use any telephone line.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
callidStringCallid of call.Yes, unless uniqueid is specified.Empty string.
uniqueidStringUniqueid of call.Yes, unless callid is specified.Empty string.

Either the callid or the uniqueid must be specified, but not both.

Responses

CodeDescription
204Hang up successfully requested.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
404The 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

VersionChanges
3.15Privileges required changed.
3.13Function added.