From 10b50d46648343782bfa52eb069bb9801747215e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 25 Jan 2019 09:46:03 +0100 Subject: [PATCH] Can get information about an existing call --- RestControllers/CallsController.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/RestControllers/CallsController.php b/RestControllers/CallsController.php index 4c5ff7f..9825bd5 100644 --- a/RestControllers/CallsController.php +++ b/RestControllers/CallsController.php @@ -68,6 +68,27 @@ class CallsController { } + /** + * Get information about a single call + * + * @url POST /calls/getInfo + */ + public function getInfo(){ + + user_login_required(); + + //Get target call ID + $call_id = $this->GetSafeCallIDFromRequest("call_id"); + + //Get information about the call + $call = components()->calls->get($call_id, true); + + if(!$call->isValid()) + Rest_fatal_error(500, "Could not get information about the call!"); + + return self::CallInformationToAPI($call); + } + /** * Get the next pending call *