Skip to content

Commit f3d739d

Browse files
authored
Merge pull request #42 from dstotijn/add-machinetimeout-param
Add `machineTimeout` parameter
2 parents 404fc40 + 56e4ca2 commit f3d739d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/MessageBird/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Client
1212
const ENDPOINT = 'https://rest.messagebird.com';
1313
const CHATAPI_ENDPOINT = 'https://chat.messagebird.com/1';
1414

15-
const CLIENT_VERSION = '1.6.5';
15+
const CLIENT_VERSION = '1.6.6';
1616

1717
/**
1818
* @var string

src/MessageBird/Objects/VoiceMessage.php

+8
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

+1-1
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)