提交 865d09b6 authored 作者: Mitch Capper's avatar Mitch Capper
<?php
include( 'login.php' );
$api = new phttapi();
$api->start_work();
$b = new phttapi_action_binding( '~\d+#' );
$b->strip('#');
$pb = new phttapi_playback();
$pb->file( sprintf( 'http://%s%s/exten.wav', $_SERVER['HTTP_HOST'], dirname( $_SERVER['PHP_SELF'] ) ) );
$pb->error_file( sprintf( 'http://%s%s/invalid.wav', $_SERVER['HTTP_HOST'], dirname( $_SERVER['PHP_SELF'] ) ) );
$pb->input_timeout( '15000' );
$pb->digit_timeout( '5000' );
$pb->action( 'dial:disa:XML' );
$pb->add_binding($b);
$api->add_action($pb);
$api->end_work();
print $api->output();
<?php
require_once( '../phttapi.php' );
if ( array_key_exists( 'session_id', $_REQUEST ) ) {
session_id( $_REQUEST['session_id'] );
}
session_start();
if ( array_key_exists( 'exiting', $_REQUEST ) ) {
header( 'Content-Type: text/plain' );
print "OK";
exit();
}
header( 'Content-Type: text/xml' );
if ( array_key_exists( 'ivr_path', $_REQUEST ) ) {
$ivr_path = $_REQUEST['ivr_path'];
} else {
$ivr_path = 'main_menu';
}
if ( file_exists( "$ivr_path.php" ) ) {
include( "$ivr_path.php" );
} else {
$api = new phttapi();
$api->start_work();
$h = new phttapi_hangup();
$h->cause( 'NORMAL_CLEARING' );
$api->add_action( $h );
$api->end_work();
print $api->output();
}
<?php
if ( !array_key_exists( 'authenticated', $_SESSION ) || $_SESSION['authenticated'] != 'true' ) {
if ( array_key_exists( 'user_pin_authenticated', $_REQUEST ) ) {
$_SESSION['authenticated'] = true;
$_SESSION['authenticated_user'] = $_REQUEST['user_pin_authenticated_user'];
$api = new phttapi();
$api->start_variables();
$api->add_variable('authenticated_user', $_REQUEST['user_pin_authenticated_user'] );
$api->end_variables();
unset( $_SESSION['authenticating'] );
} elseif ( array_key_exists( 'authenticating', $_SESSION ) ) {
$class = new phttapi();
$class->start_work();
$authed = new phttapi_getVariable( 'user_pin_authenticated' );
$class->add_action( $authed );
$auth_user = new phttapi_getVariable( 'user_pin_authenticated_user' );
$class->add_action( $auth_user );
$class->end_work();
print $class->output();
exit();
} else {
$_SESSION['authenticating'] = true;
$class = new phttapi();
$class->start_work();
$vm = new phttapi_voicemail();
$vm->auth_only( 'true' );
$vm->domain( 'home.intralanman.com' );
$class->add_action( $vm );
$class->end_work();
print $class->output();
exit();
}
}
<?php
if ( array_key_exists( 'option', $_REQUEST ) ) {
$option = $_REQUEST ['option'];
} else {
$option = '';
}
if ( $option ) {
switch ( $option ) {
case '1' :
$menu_ivr_path = 'disa';
break;
case '2' :
$menu_ivr_path = 'record';
break;
// case '':
// $menu_ivr_path = '';
// break;
}
$api = new phttapi();
$api->start_variables();
$api->add_variable( 'ivr_path', $menu_ivr_path );
$api->end_variables();
$api->start_work();
$var = new phttapi_getVariable( 'ivr_path' );
$var->permanent( 'true' );
$api->add_action( $var );
$api->end_work();
print $api->output();
} else {
$api = new phttapi();
$api->start_work();
$pause = new phttapi_pause();
$pause->milliseconds( 1500 );
$bind1 = new phttapi_action_binding( '1' );
$bind1->strip( '#' );
$bind2 = new phttapi_action_binding( '2' );
$play = new phttapi_google_tts();
$play->text( "to make an outbound call, press 1,, to record a file, press 2" );
$play->name( 'option' );
$play->input_timeout( '5000' );
$play->add_binding( $bind1 );
$play->add_binding( $bind2 );
$api->add_action( $pause );
$api->add_action( $play );
$api->end_work();
print $api->output();
}
<?php
require_once( 'login.php' );
$api = new phttapi();
$api->start_work();
$h = new phttapi_hangup();
if ( is_array( $_FILES ) ) {
$api->add_action( $h );
} else {
$api->add_action( $h );
}
$api->end_work();
print $api->output();
\ No newline at end of file
差异被折叠。
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论