Skip to content

Commit

Permalink
(Fix) Moified Voice property of Tropo object to render properly on Sa…
Browse files Browse the repository at this point in the history
…y and Ask
  • Loading branch information
mheadd committed Dec 6, 2010
1 parent f9523ed commit f30eb9b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tropo.class.php
Expand Up @@ -112,7 +112,6 @@ public function setLanguage($language) {
*/
public function ask($ask, Array $params=NULL) {
if(!is_object($ask)) {
$voice = isset($this->_voice) ? $this->_voice : null;
$p = array('as','event','voice','attempts', 'bargein', 'minConfidence', 'name', 'required', 'timeout');
foreach ($p as $option) {
$$option = null;
Expand All @@ -129,7 +128,8 @@ public function ask($ask, Array $params=NULL) {
}
$params["mode"] = isset($params["mode"]) ? $params["mode"] : null;
$params["dtmf"] = isset($params["dtmf"]) ? $params["dtmf"] : null;
$choices = isset($params["choices"]) ? new Choices($params["choices"], $params["mode"], $params["terminator"]) : null;
$voice = isset($this->_voice) ? $this->_voice : null;
$choices = isset($params["choices"]) ? new Choices($params["choices"], $params["mode"], $params["terminator"]) : null;
$ask = new Ask($attempts, $bargein, $choices, $minConfidence, $name, $required, $say, $timeout, $voice);
}
$this->ask = sprintf($ask);
Expand Down Expand Up @@ -306,9 +306,6 @@ public function reject() {
*/
public function say($say, Array $params=NULL) {
if(!is_object($say)) {
if (isset($this->_voice)) {
$voice = $this->_voice;
}
$p = array('as', 'format', 'event','voice');
$value = $say;
foreach ($p as $option) {
Expand All @@ -317,6 +314,7 @@ public function say($say, Array $params=NULL) {
$$option = $params[$option];
}
}
$voice = isset($voice) ? $voice : $this->_voice;
$say = new Say($value, $as, $event, $voice);
}
$this->say = array(sprintf($say));
Expand Down

0 comments on commit f30eb9b

Please sign in to comment.