From 04b0f1267a51dd02b257c0d4e4a89140068dcf67 Mon Sep 17 00:00:00 2001 From: osaajani <> Date: Thu, 21 Nov 2024 18:04:05 +0100 Subject: [PATCH] Fix simple sms api + add wait on system v queue (see to improve that later) --- controllers/publics/Api.php | 13 ++++++++++++- models/SystemVQueue.php | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/controllers/publics/Api.php b/controllers/publics/Api.php index 7760c7f..6c25da5 100644 --- a/controllers/publics/Api.php +++ b/controllers/publics/Api.php @@ -327,7 +327,18 @@ namespace controllers\publics; } $at = (new \DateTime())->format('Y-m-d H:i:s'); - $scheduled_id = $this->internal_scheduled->create($this->user['id'], $at, $text, $id_phone); + + $scheduled_id = $this->internal_scheduled->create( + $this->user['id'], + $at, + $text, + $id_phone, + null, + false, + false, + null, + [['number' => $to, 'data' => '[]']] + ); if (!$scheduled_id) { $return = self::DEFAULT_RETURN; diff --git a/models/SystemVQueue.php b/models/SystemVQueue.php index 8a9a782..c563577 100644 --- a/models/SystemVQueue.php +++ b/models/SystemVQueue.php @@ -70,7 +70,7 @@ class SystemVQueue implements Queue $this->get_queue(); $error_code = null; - $success = msg_send($this->queue, $tag, $message, true, false, $error_code); + $success = msg_send($this->queue, $tag, $message, true, true, $error_code); if (!$success) { throw new \Exception('Impossible to send the message on system V queue, error code : ' . $error_code);