Can hang up calls

This commit is contained in:
Pierre HUBERT 2019-01-26 08:01:18 +01:00
parent bae155873a
commit f57a57482b

View File

@ -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 * Get safely the ID of a call from the request
* *