Skip to content

Commit 8f4a0d9

Browse files
author
David Stotijn
committed
Add machineTimeout parameter
1 parent 404fc40 commit 8f4a0d9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/MessageBird/Objects/VoiceMessage.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ class VoiceMessage extends Base
8181
*/
8282
public $ifMachine = 'continue';
8383

84+
/**
85+
* The time (in milliseconds) to analyze if a machine has picked up the phone. Used in combination with the delay
86+
* and hangup values of the ifMachine attribute. Minimum: 400, maximum: 10000.
87+
*
88+
* @var int
89+
*/
90+
public $machineTimeout = 7000;
91+
8492
/**
8593
* The scheduled date and time of the message in RFC3339 format (Y-m-d\TH:i:sP)
8694
*

tests/integration/voicemessages/VoiceMessagesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function testVoiceMessageCreate()
1818
$Message->body = 'This is a test message.';
1919
$Message->language = "nl";
2020
$Message->voice = "male";
21-
$this->mockClient->expects($this->once())->method('performHttpRequest')->with("POST", 'voicemessages', null, '{"originator":"MessageBird","body":"This is a test message.","reference":null,"language":"nl","voice":"male","repeat":1,"ifMachine":"continue","scheduledDatetime":null,"recipients":[31612345678],"reportUrl":null}');
21+
$this->mockClient->expects($this->once())->method('performHttpRequest')->with("POST", 'voicemessages', null, '{"originator":"MessageBird","body":"This is a test message.","reference":null,"language":"nl","voice":"male","repeat":1,"ifMachine":"continue","machineTimeout":7000,"scheduledDatetime":null,"recipients":[31612345678],"reportUrl":null}');
2222
$this->client->voicemessages->create($Message);
2323
}
2424

0 commit comments

Comments
 (0)