Skip to content

Commit

Permalink
Merge pull request #9 from rtckit/v0.5.5
Browse files Browse the repository at this point in the history
v0.5.5
  • Loading branch information
cdosoftei committed Aug 30, 2022
2 parents cc899e0 + bfb0799 commit a20ca19
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rtckit/eqivo",
"description": "Telephony API Platform",
"version": "0.5.4",
"version": "0.5.5",
"keywords": [
"telecommunications",
"voip",
Expand Down Expand Up @@ -31,11 +31,11 @@
"ext-libxml": "*",
"ext-pcre": "*",
"ext-simplexml": "*",
"monolog/monolog": "^3.1",
"monolog/monolog": "^3.2",
"nikic/fast-route": "^1.3",
"ramsey/uuid": "^4.3",
"ramsey/uuid": "^4.4",
"react/event-loop": "^1.3",
"react/http": "^1.6",
"react/http": "^1.7",
"react/promise": "^2.9",
"rtckit/esl": "^0.8",
"rtckit/react-esl": "^0.8",
Expand All @@ -46,9 +46,9 @@
},
"require-dev": {
"clue/block-react": "^1.5",
"phpstan/phpstan": "^1.7",
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^9.5",
"vimeo/psalm": "^4.23",
"vimeo/psalm": "^4.26",
"zircote/swagger-php": "^4.4"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class App
/** @var array<string, ScheduledPlay> */
protected array $scheduledPlays = [];

/** @var InfiniteIterator<string, Core> */
/** @var InfiniteIterator */
protected InfiniteIterator $coreIterator;

protected Logger $statsLogger;
Expand Down
27 changes: 13 additions & 14 deletions src/Inbound/Handler/Custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@ public function execute(Core $core, Event $event): void
}

$session->amdMethod = $event->{"variable_{$this->app->config->appPrefix}_amd_method"} ?? Call::DEFAULT_AMD_METHOD;
$session->amdAsync = $event->{"variable_{$this->app->config->appPrefix}_amd_async"} === 'on';
$asyncVar = "variable_{$this->app->config->appPrefix}_amd_async";
$session->amdAsync = isset($event->{$asyncVar}) && ($event->{$asyncVar} === 'on');

if ($session->amdAsync) {
$urlVar = "variable_{$this->app->config->appPrefix}_amd_url";
$urlVar = $session->amdAsync
? "variable_{$this->app->config->appPrefix}_amd_url"
: "variable_{$this->app->config->appPrefix}_amd_target_url";

if (isset($event->{$urlVar})) {
$session->amdUrl = $event->{$urlVar};
}
} else {
$session->amdUrl = $event->{"variable_{$this->app->config->appPrefix}_amd_target_url"};
if (isset($event->{$urlVar})) {
$session->amdUrl = $event->{$urlVar};
}

if ($isMachine && isset($event->{"variable_{$this->app->config->appPrefix}_amd_msg_end"})) {
Expand Down Expand Up @@ -162,14 +161,14 @@ public function execute(Core $core, Event $event): void
'MachineDetectionDuration' => $session->amdDuration,
];

if ($session->amdAsync) {
/* Asynchronous, just fire the callback, if configured */
if (isset($session->amdUrl)) {
if (isset($session->amdUrl)) {
if ($session->amdAsync) {
/* Asynchronous, just fire the callback */
$this->app->inboundServer->controller->fireSessionCallback($session, $session->amdUrl, $session->amdMethod, $params);
} else {
/* Synchronous? Kick off call flow execution */
$this->app->outboundServer->controller->fetchAndExecuteRestXml($session, $session->amdUrl, $session->amdMethod, $params);
}
} else {
/* Synchronous? Kick off call flow execution */
$this->app->outboundServer->controller->fetchAndExecuteRestXml($session, $session->amdUrl, $session->amdMethod, $params);
}

return;
Expand Down

0 comments on commit a20ca19

Please sign in to comment.