Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 38 additions & 29 deletions src/Voice/Models/MachineDetectionConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,26 +106,34 @@ class MachineDetectionConfiguration implements \JsonSerializable
*/
public $fallbackPassword;

/**
* When an answering machine is detected, the amount of silence (in seconds)
* before assuming the message has finished playing.
* @var double|null $machineSpeechEndThreshold public property
*/
public $machineSpeechEndThreshold;

/**
* Constructor to set initial or default values of member properties
*/
public function __construct()
{
if (14 == func_num_args()) {
$this->mode = func_get_arg(0);
$this->detectionTimeout = func_get_arg(1);
$this->silenceTimeout = func_get_arg(2);
$this->speechThreshold = func_get_arg(3);
$this->speechEndThreshold = func_get_arg(4);
$this->delayResult = func_get_arg(5);
$this->callbackUrl = func_get_arg(6);
$this->callbackMethod = func_get_arg(7);
$this->fallbackUrl = func_get_arg(8);
$this->fallbackMethod = func_get_arg(9);
$this->username = func_get_arg(10);
$this->password = func_get_arg(11);
$this->fallbackUsername = func_get_arg(12);
$this->fallbackPassword = func_get_arg(13);
if (15 == func_num_args()) {
$this->mode = func_get_arg(0);
$this->detectionTimeout = func_get_arg(1);
$this->silenceTimeout = func_get_arg(2);
$this->speechThreshold = func_get_arg(3);
$this->speechEndThreshold = func_get_arg(4);
$this->delayResult = func_get_arg(5);
$this->callbackUrl = func_get_arg(6);
$this->callbackMethod = func_get_arg(7);
$this->fallbackUrl = func_get_arg(8);
$this->fallbackMethod = func_get_arg(9);
$this->username = func_get_arg(10);
$this->password = func_get_arg(11);
$this->fallbackUsername = func_get_arg(12);
$this->fallbackPassword = func_get_arg(13);
$this->machineSpeechEndThreshold = func_get_arg(14);
}
}

Expand All @@ -135,20 +143,21 @@ public function __construct()
public function jsonSerialize()
{
$json = array();
$json['mode'] = $this->mode;
$json['detectionTimeout'] = $this->detectionTimeout;
$json['silenceTimeout'] = $this->silenceTimeout;
$json['speechThreshold'] = $this->speechThreshold;
$json['speechEndThreshold'] = $this->speechEndThreshold;
$json['delayResult'] = $this->delayResult;
$json['callbackUrl'] = $this->callbackUrl;
$json['callbackMethod'] = $this->callbackMethod;
$json['fallbackUrl'] = $this->fallbackUrl;
$json['fallbackMethod'] = $this->fallbackMethod;
$json['username'] = $this->username;
$json['password'] = $this->password;
$json['fallbackUsername'] = $this->fallbackUsername;
$json['fallbackPassword'] = $this->fallbackPassword;
$json['mode'] = $this->mode;
$json['detectionTimeout'] = $this->detectionTimeout;
$json['silenceTimeout'] = $this->silenceTimeout;
$json['speechThreshold'] = $this->speechThreshold;
$json['speechEndThreshold'] = $this->speechEndThreshold;
$json['delayResult'] = $this->delayResult;
$json['callbackUrl'] = $this->callbackUrl;
$json['callbackMethod'] = $this->callbackMethod;
$json['fallbackUrl'] = $this->fallbackUrl;
$json['fallbackMethod'] = $this->fallbackMethod;
$json['username'] = $this->username;
$json['password'] = $this->password;
$json['fallbackUsername'] = $this->fallbackUsername;
$json['fallbackPassword'] = $this->fallbackPassword;
$json['machineSpeechEndThreshold'] = $this->machineSpeechEndThreshold;

return array_filter($json);
}
Expand Down
1 change: 1 addition & 0 deletions tests/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function testCreateCallWithAmdAndGetCallState() {
$machineDetection->delayResult = true;
$machineDetection->callbackUrl = getenv("BASE_CALLBACK_URL") . "/callbacks/machine-detection";
$machineDetection->callbackMethod = "POST";
$machineDetection->machineSpeechEndThreshold = 3.2;

$body->from = getenv("BW_NUMBER");
$body->to = getenv("USER_NUMBER");
Expand Down