From fdf68dbc8dc821634c5043f9cb59f2de395e3e37 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 24 Jun 2022 10:49:13 -0400 Subject: [PATCH 1/7] DX-2650 added enqueuedTime for voice --- src/Voice/Models/CallState.php | 23 +++++++++++++++++------ src/Voice/Models/CreateCallResponse.php | 12 ++++++------ tests/ApiTest.php | 1 + 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/Voice/Models/CallState.php b/src/Voice/Models/CallState.php index 5448892..08e2e54 100644 --- a/src/Voice/Models/CallState.php +++ b/src/Voice/Models/CallState.php @@ -83,6 +83,13 @@ class CallState implements \JsonSerializable */ public $startTime; + /** + * @todo Write general description for this property + * @factory \BandwidthLib\Utils\DateTimeHelper::fromRfc3339DateTime + * @var \DateTime|null $enqueuedTime public property + */ + public $enqueuedTime; + /** * @todo Write general description for this property * @factory \BandwidthLib\Utils\DateTimeHelper::fromRfc3339DateTime @@ -142,12 +149,13 @@ public function __construct() $this->identity = func_get_arg(8); $this->stirShaken = func_get_arg(9); $this->startTime = func_get_arg(10); - $this->answerTime = func_get_arg(11); - $this->endTime = func_get_arg(12); - $this->disconnectCause = func_get_arg(13); - $this->errorMessage = func_get_arg(14); - $this->errorId = func_get_arg(15); - $this->lastUpdate = func_get_arg(16); + $this->enqueuedTime = func_get_arg(11); + $this->answerTime = func_get_arg(12); + $this->endTime = func_get_arg(13); + $this->disconnectCause = func_get_arg(14); + $this->errorMessage = func_get_arg(15); + $this->errorId = func_get_arg(16); + $this->lastUpdate = func_get_arg(17); } } @@ -170,6 +178,9 @@ public function jsonSerialize() $json['startTime'] = isset($this->startTime) ? DateTimeHelper::toRfc3339DateTime($this->startTime) : null; + $json['enqueuedTime'] = + isset($this->enqueuedTime) ? + DateTimeHelper::toRfc3339DateTime($this->enqueuedTime) : null; $json['answerTime'] = isset($this->answerTime) ? DateTimeHelper::toRfc3339DateTime($this->answerTime) : null; diff --git a/src/Voice/Models/CreateCallResponse.php b/src/Voice/Models/CreateCallResponse.php index 3671e9c..ff754ce 100644 --- a/src/Voice/Models/CreateCallResponse.php +++ b/src/Voice/Models/CreateCallResponse.php @@ -52,9 +52,9 @@ class CreateCallResponse implements \JsonSerializable /** * @todo Write general description for this property * @factory \BandwidthLib\Utils\DateTimeHelper::fromRfc3339DateTime - * @var \DateTime|null $startTime public property + * @var \DateTime|null $enqueuedTime public property */ - public $startTime; + public $enqueuedTime; /** * @todo Write general description for this property @@ -161,7 +161,7 @@ public function __construct() $this->applicationId = func_get_arg(2); $this->to = func_get_arg(3); $this->from = func_get_arg(4); - $this->startTime = func_get_arg(5); + $this->enqueuedTime = func_get_arg(5); $this->callUrl = func_get_arg(6); $this->callTimeout = func_get_arg(7); $this->callbackTimeout = func_get_arg(8); @@ -191,9 +191,9 @@ public function jsonSerialize() $json['applicationId'] = $this->applicationId; $json['to'] = $this->to; $json['from'] = $this->from; - $json['startTime'] = - isset($this->startTime) ? - DateTimeHelper::toRfc3339DateTime($this->startTime) : null; + $json['enqueuedTime'] = + isset($this->enqueuedTime) ? + DateTimeHelper::toRfc3339DateTime($this->enqueuedTime) : null; $json['callUrl'] = $this->callUrl; $json['callTimeout'] = $this->callTimeout; $json['callbackTimeout'] = $this->callbackTimeout; diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 192b1c3..b06ca14 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -121,6 +121,7 @@ public function testCreateCallWithAmdAndGetCallState() { //get phone call information $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("BW_ACCOUNT_ID"), $callId); $this->assertTrue(strlen($response->getResult()->state) > 0); + $this->assertTrue(strlen($response->getResult()->enqueuedTime) > 0); } public function testCreateCallWithPriority() { From 791b1c69fba140a93166c408993800a77b915080 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 24 Jun 2022 10:57:31 -0400 Subject: [PATCH 2/7] test fix --- tests/ApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index b06ca14..5acb15c 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -121,7 +121,7 @@ public function testCreateCallWithAmdAndGetCallState() { //get phone call information $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("BW_ACCOUNT_ID"), $callId); $this->assertTrue(strlen($response->getResult()->state) > 0); - $this->assertTrue(strlen($response->getResult()->enqueuedTime) > 0); + $this->assertTrue(is_a($response->getResult()->enqueuedTime), 'DateTime'); } public function testCreateCallWithPriority() { From 90c321e006dbf3a6c21bc2c0a546d8641d20ca93 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 24 Jun 2022 10:59:09 -0400 Subject: [PATCH 3/7] Update ApiTest.php --- tests/ApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 5acb15c..9289f6b 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -121,7 +121,7 @@ public function testCreateCallWithAmdAndGetCallState() { //get phone call information $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("BW_ACCOUNT_ID"), $callId); $this->assertTrue(strlen($response->getResult()->state) > 0); - $this->assertTrue(is_a($response->getResult()->enqueuedTime), 'DateTime'); + $this->assertTrue(is_a($response->getResult()->enqueuedTime, 'DateTime')); } public function testCreateCallWithPriority() { From 09b57c82bb2651172e58761df99bd4bc9dcdd8ef Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 24 Jun 2022 13:29:28 -0400 Subject: [PATCH 4/7] Update ApiTest.php --- tests/ApiTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 9289f6b..b494ffd 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -85,12 +85,15 @@ public function testCreateCallAndGetCallState() { $response = $this->bandwidthClient->getVoice()->getClient()->createCall(getenv("BW_ACCOUNT_ID"), $body); $callId = $response->getResult()->callId; $this->assertTrue(strlen($callId) > 0); - + $this->assertTrue(is_a($response->getResult()->enqueuedTime, 'DateTime')); + sleep(1); //get phone call information $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("BW_ACCOUNT_ID"), $callId); $this->assertTrue(strlen($response->getResult()->state) > 0); + $this->assertTrue(is_a($response->getResult()->enqueuedTime, 'DateTime')); + } public function testCreateCallWithAmdAndGetCallState() { @@ -121,7 +124,6 @@ public function testCreateCallWithAmdAndGetCallState() { //get phone call information $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("BW_ACCOUNT_ID"), $callId); $this->assertTrue(strlen($response->getResult()->state) > 0); - $this->assertTrue(is_a($response->getResult()->enqueuedTime, 'DateTime')); } public function testCreateCallWithPriority() { From 60e26f6f0882b639b80fa0e86f5cdf57da194dfb Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 24 Jun 2022 13:56:50 -0400 Subject: [PATCH 5/7] Update ApiTest.php --- tests/ApiTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index b494ffd..0859585 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -124,6 +124,7 @@ public function testCreateCallWithAmdAndGetCallState() { //get phone call information $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("BW_ACCOUNT_ID"), $callId); $this->assertTrue(strlen($response->getResult()->state) > 0); + $this->assertTrue(is_a($response->getResult()->enqueuedTime, 'DateTime')); } public function testCreateCallWithPriority() { From 0e1b07722940eee3ab4500f264cdaea01915d3ff Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 24 Jun 2022 15:49:03 -0400 Subject: [PATCH 6/7] Update src/Voice/Models/CreateCallResponse.php Co-authored-by: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> --- src/Voice/Models/CreateCallResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Voice/Models/CreateCallResponse.php b/src/Voice/Models/CreateCallResponse.php index ff754ce..3b2f5a9 100644 --- a/src/Voice/Models/CreateCallResponse.php +++ b/src/Voice/Models/CreateCallResponse.php @@ -193,7 +193,7 @@ public function jsonSerialize() $json['from'] = $this->from; $json['enqueuedTime'] = isset($this->enqueuedTime) ? - DateTimeHelper::toRfc3339DateTime($this->enqueuedTime) : null; + DateTimeHelper::toRfc3339DateTime($this->enqueuedTime) : null; $json['callUrl'] = $this->callUrl; $json['callTimeout'] = $this->callTimeout; $json['callbackTimeout'] = $this->callbackTimeout; From f126f5f0c121219bddee40d43b1d2ae2c332fb44 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 24 Jun 2022 15:49:18 -0400 Subject: [PATCH 7/7] Update src/Voice/Models/CreateCallResponse.php Co-authored-by: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> --- src/Voice/Models/CreateCallResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Voice/Models/CreateCallResponse.php b/src/Voice/Models/CreateCallResponse.php index 3b2f5a9..5f11c8c 100644 --- a/src/Voice/Models/CreateCallResponse.php +++ b/src/Voice/Models/CreateCallResponse.php @@ -54,7 +54,7 @@ class CreateCallResponse implements \JsonSerializable * @factory \BandwidthLib\Utils\DateTimeHelper::fromRfc3339DateTime * @var \DateTime|null $enqueuedTime public property */ - public $enqueuedTime; + public $enqueuedTime; /** * @todo Write general description for this property