. */ namespace App\Libraries; use Illuminate\Support\Facades\Log; class FlexisipPusherConnector { private $pusherPath; private $pnProvider; private $pnParam; private $pnPrid; public function __construct(string $pnProvider, string $pnParam, string $pnPrid) { $this->pusherPath = config('app.flexisip_pusher_path'); $this->pnProvider = $pnProvider; $this->pnParam = $pnParam; $this->pnPrid = $pnPrid; } public function sendToken(string $token) { $payload = json_encode(['token' => $token]); 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; return exec($command, $output, $retval); } Log::error('Pusher path not configured'); } }