Skip to content

Commit eb73c22

Browse files
authored
Take out the default for record NCCO. API behaviour is changed if you specify the time, developers need choice on whether to set it (#493)
1 parent 89365d5 commit eb73c22

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/Voice/NCCO/Action/Record.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ class Record implements ActionInterface
4343
*/
4444
protected $endOnKey;
4545

46-
/**
47-
* @var int
48-
*/
49-
protected $timeOut = 7200;
46+
protected ?int $timeOut = null;
5047

5148
/**
5249
* @var bool
@@ -126,7 +123,6 @@ public function toNCCOArray(): array
126123
$data = [
127124
'action' => 'record',
128125
'format' => $this->getFormat(),
129-
'timeOut' => (string)$this->getTimeout(),
130126
'beepStart' => $this->getBeepStart() ? 'true' : 'false',
131127
];
132128

@@ -146,6 +142,10 @@ public function toNCCOArray(): array
146142
$data['split'] = $this->getSplit();
147143
}
148144

145+
if ($this->getTimeout()) {
146+
$data['timeOut'] = (string)$this->getTimeout();
147+
}
148+
149149
if ($this->getEventWebhook()) {
150150
$data['eventUrl'] = [$this->getEventWebhook()->getUrl()];
151151
$data['eventMethod'] = $this->getEventWebhook()->getMethod();
@@ -243,7 +243,7 @@ public function setEndOnSilence(int $endOnSilence): self
243243
return $this;
244244
}
245245

246-
public function getTimeout(): int
246+
public function getTimeout(): ?int
247247
{
248248
return $this->timeOut;
249249
}

test/Voice/NCCO/Action/RecordTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function testJsonSerializeLooksCorrect(): void
2626
$this->assertSame([
2727
'action' => 'record',
2828
'format' => 'mp3',
29-
'timeOut' => '7200',
3029
'beepStart' => 'false'
3130
], (new Record())->jsonSerialize());
3231
}

0 commit comments

Comments
 (0)