From d2868da2ec59a042b74c41b429289b26d66c92f8 Mon Sep 17 00:00:00 2001 From: Christopher Carranza Date: Tue, 19 Oct 2021 21:14:44 -0500 Subject: [PATCH 1/5] Added machine detection option to call Signed-off-by: Christopher Carranza --- src/Twilio.php | 1 + src/TwilioCallMessage.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Twilio.php b/src/Twilio.php index 7c47881..3d22b34 100644 --- a/src/Twilio.php +++ b/src/Twilio.php @@ -126,6 +126,7 @@ protected function makeCall(TwilioCallMessage $message, ?string $to): CallInstan 'status', 'fallbackUrl', 'fallbackMethod', + 'machineDetection', ]); if (! $from = $this->getFrom($message)) { diff --git a/src/TwilioCallMessage.php b/src/TwilioCallMessage.php index da4b160..d32e311 100755 --- a/src/TwilioCallMessage.php +++ b/src/TwilioCallMessage.php @@ -27,6 +27,11 @@ class TwilioCallMessage extends TwilioMessage */ public $fallbackMethod; + /** + * @var null|string + */ + public $machineDetection; + /** * Set the message url. * @@ -91,4 +96,17 @@ public function fallbackMethod(string $fallbackMethod): self return $this; } + + /** + * Set the answering machine detection mode. + * + * @param string $machineDetection + * @return $this + */ + public function machineDetection(string $machineDetection): self + { + $this->machineDetection = $machineDetection; + + return $this; + } } From 39129ac6a234fe712f08296ebe7f112e14074a30 Mon Sep 17 00:00:00 2001 From: Christopher Carranza Date: Tue, 19 Oct 2021 21:17:09 -0500 Subject: [PATCH 2/5] Add new machine detection value to tests Signed-off-by: Christopher Carranza --- tests/Unit/TwilioCallMessageTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Unit/TwilioCallMessageTest.php b/tests/Unit/TwilioCallMessageTest.php index 38ee9f7..bbce591 100644 --- a/tests/Unit/TwilioCallMessageTest.php +++ b/tests/Unit/TwilioCallMessageTest.php @@ -50,6 +50,7 @@ public function it_can_set_optional_parameters() $message->statusCallbackMethod('PUT'); $message->fallbackUrl('http://example.com'); $message->fallbackMethod('PUT'); + $message->machineDetection('Enable'); $this->assertEquals(TwilioCallMessage::STATUS_CANCELED, $message->status); $this->assertEquals('PUT', $message->method); @@ -57,5 +58,6 @@ public function it_can_set_optional_parameters() $this->assertEquals('PUT', $message->statusCallbackMethod); $this->assertEquals('http://example.com', $message->fallbackUrl); $this->assertEquals('PUT', $message->fallbackMethod); + $this->assertEquals('Enable', $message->machineDetection); } } From 31f861f036606f2be279322ec0527a4805a79678 Mon Sep 17 00:00:00 2001 From: Christopher Carranza Date: Fri, 11 Feb 2022 18:42:15 -0600 Subject: [PATCH 3/5] Laravel 9 support --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 967861d..df0d4a0 100644 --- a/composer.json +++ b/composer.json @@ -24,14 +24,14 @@ "require": { "php": ">=7.2", "twilio/sdk": "~6.0", - "illuminate/notifications": "^5.8 || ^6.0 || ^7.0 || ^8.0", - "illuminate/support": "^5.8 || ^6.0 || ^7.0 || ^8.0", - "illuminate/events": "^5.8 || ^6.0 || ^7.0 || ^8.0", - "illuminate/queue": "^5.8 || ^6.0 || ^7.0 || ^8.0" + "illuminate/notifications": "^5.8 || ^6.0 || ^7.0 || ^8.0|^9.0", + "illuminate/support": "^5.8 || ^6.0 || ^7.0 || ^8.0|^9.0", + "illuminate/events": "^5.8 || ^6.0 || ^7.0 || ^8.0|^9.0", + "illuminate/queue": "^5.8 || ^6.0 || ^7.0 || ^8.0|^9.0" }, "require-dev": { "mockery/mockery": "^1.3", - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^8.5|^9.5.10" }, "autoload": { "psr-4": { From 312da0958744b6198511374393b26b8d021c8733 Mon Sep 17 00:00:00 2001 From: Christopher Carranza Date: Mon, 18 Mar 2024 16:30:23 -0500 Subject: [PATCH 4/5] Added constants for machine detection options Signed-off-by: Christopher Carranza --- src/TwilioCallMessage.php | 3 +++ tests/Unit/TwilioCallMessageTest.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TwilioCallMessage.php b/src/TwilioCallMessage.php index d32e311..b3a8970 100755 --- a/src/TwilioCallMessage.php +++ b/src/TwilioCallMessage.php @@ -7,6 +7,9 @@ class TwilioCallMessage extends TwilioMessage public const STATUS_CANCELED = 'canceled'; public const STATUS_COMPLETED = 'completed'; + public const MACHINE_DETECTION_ENABLE = 'Enable'; + public const MACHINE_DETECTION_DETECT_MESSAGE_END = 'DetectMessageEnd'; + /** * @var null|string */ diff --git a/tests/Unit/TwilioCallMessageTest.php b/tests/Unit/TwilioCallMessageTest.php index bbce591..ec83a53 100644 --- a/tests/Unit/TwilioCallMessageTest.php +++ b/tests/Unit/TwilioCallMessageTest.php @@ -50,7 +50,7 @@ public function it_can_set_optional_parameters() $message->statusCallbackMethod('PUT'); $message->fallbackUrl('http://example.com'); $message->fallbackMethod('PUT'); - $message->machineDetection('Enable'); + $message->machineDetection(TwilioCallMessage::MACHINE_DETECTION_ENABLE); $this->assertEquals(TwilioCallMessage::STATUS_CANCELED, $message->status); $this->assertEquals('PUT', $message->method); @@ -58,6 +58,6 @@ public function it_can_set_optional_parameters() $this->assertEquals('PUT', $message->statusCallbackMethod); $this->assertEquals('http://example.com', $message->fallbackUrl); $this->assertEquals('PUT', $message->fallbackMethod); - $this->assertEquals('Enable', $message->machineDetection); + $this->assertEquals(TwilioCallMessage::MACHINE_DETECTION_ENABLE, $message->machineDetection); } } From efc42b58c2c1a00898558a411a54ba045cb243b5 Mon Sep 17 00:00:00 2001 From: Christopher Carranza Date: Wed, 26 Feb 2025 20:06:27 -0600 Subject: [PATCH 5/5] Laravel 12 Support --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 2724c12..ebfe783 100644 --- a/composer.json +++ b/composer.json @@ -31,10 +31,10 @@ "require": { "php": ">=7.2|^8.0", "twilio/sdk": "~6.0|^7.16", - "illuminate/notifications": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0", - "illuminate/support": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0", - "illuminate/events": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0", - "illuminate/queue": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0" + "illuminate/notifications": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0|^12.0", + "illuminate/support": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0|^12.0", + "illuminate/events": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0|^12.0", + "illuminate/queue": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0|^12.0" }, "require-dev": { "mockery/mockery": "^1.3",