Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

(Fix) Choices on record sets value instead of terminator. Fixes #8

  • Loading branch information...
commit 6dd10a58b53353db86c20b6fb93abeb3039d73f4 1 parent 8496707
@akalsey akalsey authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 tropo.class.php
View
10 tropo.class.php
@@ -226,7 +226,13 @@ public function on($on) {
public function record($record) {
if(!is_object($record) && is_array($record)) {
$params = $record;
- $choices = isset($params["choices"]) ? new Choices($params["choices"]) : null;
+ $p = array('as', 'voice', 'emailFormat', 'transcription', 'terminator');
+ foreach ($p as $option) {
+ $params[$option] = array_key_exists($option, $params) ? $params[$option] : null;
+ }
+ $choices = isset($params["choices"])
+ ? new Choices(null, null, $params["choices"])
+ : null;
$say = new Say($params["say"], $params["as"], null, $params["voice"]);
if (is_array($params['transcription'])) {
$p = array('url', 'id', 'emailFormat');
@@ -845,7 +851,7 @@ public function __construct($value=NULL, $mode=NULL, $terminator=NULL) {
*
*/
public function __toString() {
- $this->value = $this->_value;
+ if(isset($this->value)){ $this->value = $this->_value; }
if(isset($this->_mode)) { $this->mode = $this->_mode; }
if(isset($this->_terminator)) { $this->terminator = $this->_terminator; }
return $this->unescapeJSON(json_encode($this));
Please sign in to comment.
Something went wrong with that request. Please try again.