Example #1
0
 public function testGatherNestedVerbsConvienceMethods()
 {
     $r = new Response();
     $g = $r->addGather(array("action" => "example.com", "method" => "GET"));
     $g->addSay("Hello World");
     $g->addPlay("helloworld.mp3");
     $g->addPause();
     $expected = '
             <Response>
                 <Gather action="example.com" method="GET">
                     <Say>Hello World</Say>
                     <Play>helloworld.mp3</Play>
                     <Pause></Pause>
                 </Gather>
             </Response>';
     $this->assertXmlStringEqualsXmlString($expected, $r->asUrl(False));
 }
Example #2
0
            $response->append($verb);
            $response->addRedirect();
        } else {
            $response->addSay('You selected an incorrect option.');
            $response->addRedirect();
        }
        $response->Respond();
        exit;
    }
}
if (!empty($selected_item)) {
    $response->addRedirect($selected_item);
    $response->Respond();
    exit;
}
$gather = $response->addGather(compact('numDigits'));
$verb = AudioSpeechPickerWidget::getVerbForValue($prompt, null);
$gather->append($verb);
// Infinite loop
if ($repeat_count == -1) {
    $response->addRedirect();
    // Specified repeat count
} else {
    for ($i = 1; $i < $repeat_count; $i++) {
        $gather->addPause(array('length' => 5));
        $gather->append($verb);
    }
}
if (!empty($next)) {
    $response->addRedirect($next);
}