From 448e200a7273991a731b380e2f8fff3f61384a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Thu, 20 Oct 2022 16:56:21 +0200 Subject: [PATCH] Fix #39 Log error when the PN pusher is not configured --- flexiapi/app/Libraries/FlexisipPusherConnector.php | 14 ++++++++++---- flexisip-account-manager.spec | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/flexiapi/app/Libraries/FlexisipPusherConnector.php b/flexiapi/app/Libraries/FlexisipPusherConnector.php index 6f5be04..3d26bdd 100644 --- a/flexiapi/app/Libraries/FlexisipPusherConnector.php +++ b/flexiapi/app/Libraries/FlexisipPusherConnector.php @@ -19,6 +19,8 @@ namespace App\Libraries; +use Illuminate\Support\Facades\Log; + class FlexisipPusherConnector { private $pusherPath; @@ -38,16 +40,20 @@ class FlexisipPusherConnector { $payload = json_encode(['token' => $token]); - $command = $this->pusherPath + if (!empty($this->pusherPath)) { + $command = $this->pusherPath . " --pn-provider '" . $this->pnProvider . "'" . " --pn-param '" . $this->pnParam . "'" . " --pn-prid " . $this->pnPrid . " --apple-push-type Background" . " --customPayload '" . $payload . "'"; - $output = null; - $retval = null; + $output = null; + $retval = null; - return exec($command, $output, $retval); + return exec($command, $output, $retval); + } + + Log::error('Pusher path not configured'); } } diff --git a/flexisip-account-manager.spec b/flexisip-account-manager.spec index 4c4f130..7d1ef06 100644 --- a/flexisip-account-manager.spec +++ b/flexisip-account-manager.spec @@ -8,7 +8,7 @@ #%define _datadir %{_datarootdir} #%define _docdir %{_datadir}/doc -%define build_number 158 +%define build_number 159 %define var_dir /var/opt/belledonne-communications %define opt_dir /opt/belledonne-communications/share/flexisip-account-manager