From a7bd86b84aead03d6a435a6154d4d33c3bebdc02 Mon Sep 17 00:00:00 2001 From: dmitry krokhin Date: Thu, 10 Mar 2022 17:50:01 +0300 Subject: [PATCH] Support speech recognition and sms events --- lib/Api.php | 10 ++++++++++ lib/Webhook/AbstractNotify.php | 2 ++ lib/Webhook/NotifySms.php | 23 ++++++++++++++++++++++ lib/Webhook/NotifySpeechRecognition.php | 26 +++++++++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 lib/Webhook/NotifySms.php create mode 100644 lib/Webhook/NotifySpeechRecognition.php diff --git a/lib/Api.php b/lib/Api.php index d187a68..6cbc97a 100644 --- a/lib/Api.php +++ b/lib/Api.php @@ -37,6 +37,8 @@ use Zadarma_API\Webhook\NotifyOutStart; use Zadarma_API\Webhook\NotifyRecord; use Zadarma_API\Webhook\NotifyStart; +use Zadarma_API\Webhook\NotifySpeechRecognition; +use Zadarma_API\Webhook\NotifySms; class Api extends Client { @@ -694,6 +696,14 @@ public function getWebhookEvent($eventFilter = null, $postData = null, $signatur $notify = new NotifyRecord($postData); break; + case AbstractNotify::EVENT_SPEECH_RECOGNITION: + $notify = new NotifySpeechRecognition($postData); + break; + + case AbstractNotify::EVENT_SMS: + $notify = new NotifySms($postData); + break; + default: return null; } diff --git a/lib/Webhook/AbstractNotify.php b/lib/Webhook/AbstractNotify.php index 5c806a1..2fca783 100644 --- a/lib/Webhook/AbstractNotify.php +++ b/lib/Webhook/AbstractNotify.php @@ -12,6 +12,8 @@ abstract class AbstractNotify extends \Zadarma_API\Response\Response const EVENT_OUT_END = 'NOTIFY_OUT_END'; const EVENT_RECORD = 'NOTIFY_RECORD'; const EVENT_IVR = 'NOTIFY_IVR'; + const EVENT_SPEECH_RECOGNITION = 'SPEECH_RECOGNITION'; + const EVENT_SMS = 'SMS'; public $event; diff --git a/lib/Webhook/NotifySms.php b/lib/Webhook/NotifySms.php new file mode 100644 index 0000000..2e598e6 --- /dev/null +++ b/lib/Webhook/NotifySms.php @@ -0,0 +1,23 @@ +result; + } +} \ No newline at end of file diff --git a/lib/Webhook/NotifySpeechRecognition.php b/lib/Webhook/NotifySpeechRecognition.php new file mode 100644 index 0000000..0c25744 --- /dev/null +++ b/lib/Webhook/NotifySpeechRecognition.php @@ -0,0 +1,26 @@ +result; + } +} \ No newline at end of file