Moderators: enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, s0lid
#!/usr/bin/php -q
<?php
const ZUUP_URL = "https://192.168.3.100/admin/save_creditcard.ashx";
const SECRET = "7zekCd8JVwYeSNw";
set_time_limit(30);
require('phpagi.php');
error_reporting(E_ALL);
$agi = new AGI();
$agi->answer();
$cid = $agi->parse_callerid();
var_dump($cid);
$agi->text2wav("Hello, {$cid['name']}. Let's enter some text.");
//mute agent
$agi->evaluate('meetme mute 8600051 01');
$callee = $agi->request['agi_dnid'];
$userId = substr($callee,4);
$agi->text2wav("user id is $userid");
function get_creditcard_info()
{
global $agi;
do{
$agi->text2wav("Please input your credit card number then press the pound key.");
$result = $agi->get_data('beep', 60000, 20);
$ccNumber = $result['result'];
$agi->text2wav("Please input your CSV code then press the pound key.");
$result = $agi->get_data('beep', 3000, 20);
$csv = $result['result'];
do{
$agi->text2wav("Your credit card number is ");
$agi->say_digits($ccNumber);
$agi->text2wav("Your csv code is ");
$agi->say_digits($csv);
$agi->text2wav("Confirm please press 1, re-input please press 2, go back to agent please press 0.");
$result = $agi->get_data('beep', 3000, 20);
if($result['result'] != "1" && $result['result'] != "0" && $result['result'] !="2"){
$agi->text2wav("Incorrect input, please try again.");
continue;
}
break;
}while(true);
if($result['result'] == "1")
{
//Save data, do online verification
$agi->text2wav("Save data. Do online verification now.");
//$ret = PostToServer("4", "421234124124234", "232", "02", "13");
//$agi->exec_goto('default|8600051|1');
break;
}else if($result['result'] == "2")
{
continue;
break;
}else if($result['result'] == "0")
{
//redirect back to agent
$agi->text2wav("We're redirecting you back to agent, please standby.");
break;
}
}while(true);
}
function PostToServer($id, $card_number, $csv, $month, $year)
{
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2(ZUUP_URL, HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'ssl_verify_peer' => false
));
$request->addPostParameter("Secret", SECRET);
$request->addPostParameter("id", $id);
$request->addPostParameter("card_number", $card_number);
$request->addPostParameter("csv", $csv);
$request->addPostParameter("month", $month);
$request->addPostParameter("year", $year);
try {
$response = $request->send();
$data = $response->getBody();
var_dump($data);
if (200 == $response->getStatus()) {
$data = $response->getBody();
return $data;
} else {
return -1;
}
} catch (HTTP_Request2_Exception $e) {
echo $e->getMessage();
return 1;
}
}
get_creditcard_info();
//$ret = PostToServer("4", "421234124124234", "232", "02", "13");
//echo "ret is $ret";
$agi->text2wav('Goodbye');
$agi->hangup();
?>
Return to ViciDialNow - GoAutoDial
Users browsing this forum: No registered users and 94 guests