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..5f11c8c 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..0859585 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,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() {