提交 b411a529 authored 作者: Raymond Chandler's avatar Raymond Chandler

refactor a bit

上级 1b97f2f2
<?php <?php
if ( array_key_exists( 'option', $_REQUEST ) ) { if ( array_key_exists( 'option', $_REQUEST ) ) {
$option = $_REQUEST['option']; $option = $_REQUEST ['option'];
} else { } else {
$option = ''; $option = '';
} }
if ( $option ) { if ( $option ) {
switch ( $option ) { switch ( $option ) {
case '1': case '1' :
$menu_ivr_path = 'disa'; $menu_ivr_path = 'disa';
break; break;
case '2': case '2' :
$menu_ivr_path = 'record'; $menu_ivr_path = 'record';
break; break;
// case '': // case '':
...@@ -38,21 +38,24 @@ if ( $option ) { ...@@ -38,21 +38,24 @@ if ( $option ) {
$api = new phttapi(); $api = new phttapi();
$api->start_work(); $api->start_work();
$pause = new phttapi_pause();
$pause->milliseconds( 1500 );
$bind1 = new phttapi_action_binding( '1' ); $bind1 = new phttapi_action_binding( '1' );
$bind1->strip( '#' );
$bind2 = new phttapi_action_binding( '2' ); $bind2 = new phttapi_action_binding( '2' );
$play = new phttapi_speak( "to make an outbound call, press 1,, to record a file, press 2,, " ); $play = new phttapi_google_tts();
$play->engine( 'flite' ); $play->text( "to make an outbound call, press 1,, to record a file, press 2" );
$play->voice( 'slt' );
$play->name( 'option' ); $play->name( 'option' );
$play->input_timeout( '5000' ); $play->input_timeout( '5000' );
$play->add_binding($bind1); $play->add_binding( $bind1 );
$play->add_binding($bind2); $play->add_binding( $bind2 );
$api->add_action( $pause );
$api->add_action( $play ); $api->add_action( $play );
$api->end_work(); $api->end_work();
print $api->output(); print $api->output();
} }
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论