Skip to content

Commit 413d6a8

Browse files
author
Adam Kalsey
committed
Merge branch 'master' of github.com:tropo/tropo-webapi-php
2 parents c4fb395 + 611c82a commit 413d6a8

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

tropo.class.php

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ public function record($record) {
237237
} else {
238238
$transcription = $params["transcription"];
239239
}
240-
$p = array('attempts', 'bargein', 'beep', 'format', 'maxTime', 'maxSilence', 'method', 'password', 'required', 'timeout', 'username', 'url', 'allowSignals');
240+
$p = array('attempts', 'allowSignals', 'bargein', 'beep', 'format', 'maxTime', 'maxSilence', 'method', 'password', 'required', 'timeout', 'username', 'url', 'voice');
241241
foreach ($p as $option) {
242242
$$option = null;
243243
if (is_array($params) && array_key_exists($option, $params)) {
244244
$$option = $params[$option];
245245
}
246246
}
247-
$record = new Record($attempts, $bargein, $beep, $choices, $format, $maxSilence, $maxTime, $method, $password, $required, $say, $timeout, $transcription, $username, $url, $allowSignals);
247+
$record = new Record($attempts, $allowSignals, $bargein, $beep, $choices, $format, $maxSilence, $maxTime, $method, $password, $required, $say, $timeout, $transcription, $username, $url, $voice);
248248
}
249249
$this->record = sprintf($record);
250250
}
@@ -1005,6 +1005,7 @@ public function __toString() {
10051005
class Record extends BaseClass {
10061006

10071007
private $_attempts;
1008+
private $_allowSignals;
10081009
private $_bargein;
10091010
private $_beep;
10101011
private $_choices;
@@ -1018,13 +1019,15 @@ class Record extends BaseClass {
10181019
private $_timeout;
10191020
private $_transcription;
10201021
private $_username;
1021-
private $_url;
1022-
private $_allowSignals;
1022+
private $_url;
1023+
private $_voice;
1024+
10231025

10241026
/**
10251027
* Class constructor
10261028
*
10271029
* @param int $attempts
1030+
* @param string|array $allowSignals
10281031
* @param boolean $bargein
10291032
* @param boolean $beep
10301033
* @param Choices $choices
@@ -1037,10 +1040,11 @@ class Record extends BaseClass {
10371040
* @param int $timeout
10381041
* @param string $username
10391042
* @param string $url
1040-
* @param string|array $allowSignals
1043+
* @param string $voice
10411044
*/
1042-
public function __construct($attempts=NULL, $bargein=NULL, $beep=NULL, Choices $choices=NULL, $format=NULL, $maxSilence=NULL, $maxTime=NULL, $method=NULL, $password=NULL, $required=NULL, $say=NULL, $timeout=NULL, Transcription $transcription=NULL, $username=NULL, $url=NULL, $allowSignals=NULL) {
1045+
public function __construct($attempts=NULL, $allowSignals=NULL, $bargein=NULL, $beep=NULL, Choices $choices=NULL, $format=NULL, $maxSilence=NULL, $maxTime=NULL, $method=NULL, $password=NULL, $required=NULL, $say=NULL, $timeout=NULL, Transcription $transcription=NULL, $username=NULL, $url=NULL, $voice=NULL) {
10431046
$this->_attempts = $attempts;
1047+
$this->_allowSignals = $allowSignals;
10441048
$this->_bargein = $bargein;
10451049
$this->_beep = $beep;
10461050
$this->_choices = isset($choices) ? sprintf($choices) : null;
@@ -1057,7 +1061,7 @@ public function __construct($attempts=NULL, $bargein=NULL, $beep=NULL, Choices $
10571061
$this->_transcription = isset($transcription) ? sprintf($transcription) : null;
10581062
$this->_username = $username;
10591063
$this->_url = $url;
1060-
$this->_allowSignals = $allowSignals;
1064+
$this->_voice = $voice;
10611065
}
10621066

10631067
/**
@@ -1066,6 +1070,7 @@ public function __construct($attempts=NULL, $bargein=NULL, $beep=NULL, Choices $
10661070
*/
10671071
public function __toString() {
10681072
if(isset($this->_attempts)) { $this->attempts = $this->_attempts; }
1073+
if(isset($this->_allowSignals)) { $this->allowSignals = $this->_allowSignals; }
10691074
if(isset($this->_bargein)) { $this->bargein = $this->_bargein; }
10701075
if(isset($this->_beep)) { $this->beep = $this->_beep; }
10711076
if(isset($this->_choices)) { $this->choices = $this->_choices; }
@@ -1079,7 +1084,7 @@ public function __toString() {
10791084
if(isset($this->_transcription)) { $this->transcription = $this->_transcription; }
10801085
if(isset($this->_username)) { $this->username = $this->_username; }
10811086
if(isset($this->_url)) { $this->url = $this->_url; }
1082-
if(isset($this->_allowSignals)) { $this->allowSignals = $this->_allowSignals; }
1087+
if(isset($this->_voice)) { $this->voice = $this->_voice; }
10831088
return $this->unescapeJSON(json_encode($this));
10841089
}
10851090
}
@@ -1131,6 +1136,7 @@ class Reject extends EmptyBaseClass { }
11311136
class Result {
11321137

11331138
private $_sessionId;
1139+
private $_callId;
11341140
private $_state;
11351141
private $_sessionDuration;
11361142
private $_sequence;
@@ -1165,6 +1171,7 @@ public function __construct($json=NULL) {
11651171
throw new TropoException('Not a result object.');
11661172
}
11671173
$this->_sessionId = $result->result->sessionId;
1174+
$this->_callId = $result->result->callId;
11681175
$this->_state = $result->result->state;
11691176
$this->_sessionDuration = $result->result->sessionDuration;
11701177
$this->_sequence = $result->result->sequence;
@@ -1186,6 +1193,10 @@ function getSessionId() {
11861193
return $this->_sessionId;
11871194
}
11881195

1196+
function getCallId() {
1197+
return $this->_callId;
1198+
}
1199+
11891200
function getState() {
11901201
return $this->_state;
11911202
}

0 commit comments

Comments
 (0)