Can get pending calls of a user

This commit is contained in:
2019-01-24 18:09:36 +01:00
parent 9d1371fd81
commit 8d004e80f5
2 changed files with 73 additions and 0 deletions

View File

@ -68,6 +68,22 @@ class CallsController {
}
/**
* Get the next pending call
*
* @url POST /calls/nextPending
*/
public function GetNextPendingCall(){
user_login_required();
//Get the next pending call for the user
$call = components()->calls->getNextPendingForUser(userID, TRUE);
if(!$call->isValid())
return array("notice" => "No pending call.");
return self::CallInformationToAPI($call);
}
/**
* Turn a CallsConfig object into an API entry