Skip to content

Commit

Permalink
Merge pull request #1 from rtckit/v0.0.2
Browse files Browse the repository at this point in the history
v0.0.2
  • Loading branch information
cdosoftei committed Feb 2, 2023
2 parents fa4e348 + 03adf19 commit b1ff9e1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rtckit/ficore",
"description": "FreeSWITCH Integration Core",
"version": "0.0.1",
"version": "0.0.2",
"keywords": [
"telecommunications",
"voip",
Expand Down
10 changes: 8 additions & 2 deletions src/Command/Channel/Originate/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
AbstractHandler,
RequestInterface,
};

use RTCKit\FiCore\Exception\CoreException;
use RTCKit\FiCore\Switch\{
Core,
HangupCauseEnum,
Expand All @@ -37,7 +37,13 @@ public function execute(RequestInterface $request): PromiseInterface
$response->originateJobs = [];

if (!isset($request->core)) {
$request->core = $this->app->allocateCore();
try {
$request->core = $this->app->allocateCore();
} catch (CoreException $t) {
$response->successful = false;

return resolve($response);
}
}

if ($enterprise) {
Expand Down
1 change: 1 addition & 0 deletions src/Command/Conference/Record/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function execute(RequestInterface $request): PromiseInterface

$response = new Response();
$response->successful = true;
$response->medium = $request->medium;

return $request->conference->core->client->api(
(new ESL\Request\Api())->setParameters("conference {$request->conference->room} {$request->action->value} {$request->medium}")
Expand Down
4 changes: 2 additions & 2 deletions src/Plan/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@ public function pushToEventQueue(Channel $channel, ?Event $event = null): void
public function consume(Channel $channel, string $sequence, ?AbstractSignal $signal = null): PromiseInterface
{
return $this->app->planProducer->produce($channel, $sequence, $signal)
->then(function (array $elements) use ($channel): PromiseInterface {
->then(function (?array $elements) use ($channel): PromiseInterface {
/** @var list<AbstractElement> $elements */
if (!count($elements)) {
if (empty($elements)) {
return resolve();
}

Expand Down

0 comments on commit b1ff9e1

Please sign in to comment.