<?php

function POST($url, $data)
{
    $opts = array('http' => array('method' => 'POST', 'header' => 'Content-type: audio/l16; rate=16000', 'content' => $data));
    $context = stream_context_create($opts);
    $fp = fopen($url, 'rb', false, $context);
    $result = stream_get_contents($fp);
    return $result;
}
session_start();
//start session, session will be maintained for entire call
require_once "response.php";
//response.php is the kookoo xml preparation class file
$r = new Response();
$r->setFiller("yes");
/*Description 
 * kookoo request and response process
 * 
 * Step 1: KooKoo NewCall Request
 * 	For Every New call kookoo will send you the below Request Parameters
 *   
 * event=NewCall
 * cid=Caller Number
 * called_number=Dialled Number 
 * sid=session parameter 
 *   // Capture these details to your own Session variables
 * 
 * Step 2: Maintain One session Variable X
 * 		   Maintaining Combination Of KooKoo 'event' parameter and Session Variable X in Unique
 *         This will help you in tracking your position in the application