Skip to content

Instantly share code, notes, and snippets.

@kookoolib
kookoolib / gist:3652506
Created Sep 6, 2012
Integrating KooKoo with Freshdesk for automated support management
View gist:3652506
<?php
session_start();
if($_REQUEST['event']=='NewCall')
{
echo '<response>';
$caller=get_user($_REQUEST['cid']);
if($caller != "")
echo '<playtext>Welcome '.$caller.'</playtext>';
View wedding_ivr.php
<?php
session_start();
require_once("response.php");//response.php is the kookoo xml preparation class file
$r = new Response();
$r->setFiller("yes");
$recore_wav="update";
if(isset ($_REQUEST['event']) && $_REQUEST['event']== "NewCall" )
{
$_SESSION['caller_number']=$_REQUEST['cid'];
$_SESSION['kookoo_number']=$_REQUEST['called_number'];
@kookoolib
kookoolib / ContactController
Created Mar 22, 2012
Sales force Integration
View ContactController
//Visual Force Page
<apex:page controller="ContactController" showheader="false" action="{!pageDetail}">
<apex:detail subject="{!contactId}" relatedList="false"/>
</apex:page>
//Apex Controller
public class ContactController {
public string contactId { get; set; }
public ContactController() {
}
@kookoolib
kookoolib / CallManagementController
Created Mar 20, 2012
Salesforce Call management controller
View CallManagementController
/*The controller sends the XML response*/
public class CallManagementController {
/*state is required to know the call flow state*/
public string state { get; set; }
public string response { get; set; }
public CallManagementController() {
state='start';
}
View call_management
<apex:page controller="CallManagementController" showheader="false"
contentType="text/xml" action="{!kookooResponse}"
>{! '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' }
{!response}
</apex:page>
View kookoo_mixpanel_final.php
<?php
require_once('response.php');// this is kookoo library. You can download it from KooKoo website.
$r= new Response();
//you will get the key after registering at mixpanel.
$metrics = new MetricsTracker("your_mixpanel_api_key");
if($_REQUEST['event'] == 'NewCall')
{
//get the phone number of the person who called
View kookoo_mixpanel.php
<?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.
You can’t perform that action at this time.