Skip to content

Commit

Permalink
Merge pull request #42 from dstotijn/add-machinetimeout-param
Browse files Browse the repository at this point in the history
Add `machineTimeout` parameter
  • Loading branch information
sotoz authored Apr 6, 2017
2 parents 404fc40 + 56e4ca2 commit f3d739d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MessageBird/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Client
const ENDPOINT = 'https://rest.messagebird.com';
const CHATAPI_ENDPOINT = 'https://chat.messagebird.com/1';

const CLIENT_VERSION = '1.6.5';
const CLIENT_VERSION = '1.6.6';

/**
* @var string
Expand Down
8 changes: 8 additions & 0 deletions src/MessageBird/Objects/VoiceMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ class VoiceMessage extends Base
*/
public $ifMachine = 'continue';

/**
* The time (in milliseconds) to analyze if a machine has picked up the phone. Used in combination with the delay
* and hangup values of the ifMachine attribute. Minimum: 400, maximum: 10000.
*
* @var int
*/
public $machineTimeout = 7000;

/**
* The scheduled date and time of the message in RFC3339 format (Y-m-d\TH:i:sP)
*
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/voicemessages/VoiceMessagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function testVoiceMessageCreate()
$Message->body = 'This is a test message.';
$Message->language = "nl";
$Message->voice = "male";
$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}');
$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}');
$this->client->voicemessages->create($Message);
}

Expand Down

0 comments on commit f3d739d

Please sign in to comment.