mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Can hang up calls
This commit is contained in:
parent
bae155873a
commit
f57a57482b
@ -133,6 +133,26 @@ class CallsController {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hang up a call
|
||||
*
|
||||
* @url POST /calls/hangUp
|
||||
*/
|
||||
public function hangUp(){
|
||||
user_login_required();
|
||||
|
||||
//Get target call ID
|
||||
$call_id = $this->GetSafeCallIDFromRequest("call_id");
|
||||
|
||||
//Make user hang up call
|
||||
if(!components()->calls->setMemberHangUp($call_id, userID))
|
||||
Rest_fatal_error(500, "Could not make user hang up call!");
|
||||
|
||||
return array(
|
||||
"success" => "User successfully hang up call!"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get safely the ID of a call from the request
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user