Created
November 21, 2011 10:13
-
-
Save kookoolib/1382220 to your computer and use it in GitHub Desktop.
KooKoo Mixpanel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('response.php');// this is kookoo library. You can download it from KooKoo website. | |
$r= new Response(); | |
if($_REQUEST['event'] == 'NewCall') | |
{ | |
//get the phone number of the person who called | |
$caller_id=$_REQUEST['cid']; | |
//get the deals for the categories chosen by the caller.getDealsForCustomer is the function | |
//which gets details from your database. | |
$deal=getDealsForCustomer($caller_id); | |
$cd= new CollectDtmf(); | |
//playback the deals and hangup | |
$cd->addPlayText('Please press 1 for '.$deal[0]); | |
$cd->addPlayText('Please press 2 for '.$deal[1]); | |
$r->addCollectDtmf($cd); | |
$r->send(); | |
} | |
else if($_REQUEST['event']=='GotDtmf') | |
{ | |
$digit=$_REQUEST['data']; | |
if($digit == '1') | |
{ | |
$r->addPlayText('Thanks for choosing deal 1'); | |
//do payment processing | |
} | |
else if($digit == '2') | |
{ | |
$r->addPlayText('Thanks for choosing deal 2'); | |
} | |
$r->addHangup(); | |
$r->send(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment