Mar 1 / sandeep

memento June 2011 to dec 2011

this post and the T-shirt in the pic is a memento for the time between june 2011 to dec 2011

Feb 25 / sandeep

Fix For Amazon API Error: Your request is missing required parameters. Required parameters include AssociateTag.

Amazon has made changes to there API which came effect since November 1st: 2011, and you might be getting following error when you made request to Product Advertising API.

Your request is missing required parameters. Required parameters include AssociateTag.

 

The fix is below

Sign up for Amazon Associates account.

get AssociateTag and pass it as parm in the request

eg:

 

$method = "GET";
$host = "ecs.amazonaws.".$region; // must be in small case
$uri = "/onca/xml";

$params["Service"] = "AWSECommerceService";
$params["AWSAccessKeyId"] = $public_key;
<strong>$params["AssociateTag"] = "your associate tag here ";</strong>
$params["Timestamp"] = gmdate("Y-m-d\TH:i:s\Z");
$params["Version"] = "2009-03-31";

/* The params need to be sorted by the key, as Amazon does this at
their end and then generates the hash of the same. If the params
are not in order then the generated hash will be different thus
failing the authetication process.
*/
ksort($params);

$canonicalized_query = array();

foreach ($params as $param=&gt;$value)
{
$param = str_replace("%7E", "~", rawurlencode($param));
$value = str_replace("%7E", "~", rawurlencode($value));
$canonicalized_query[] = $param."=".$value;
}

$canonicalized_query = implode("&amp;", $canonicalized_query);

$string_to_sign = $method."\n".$host."\n".$uri."\n".$canonicalized_query;

/* calculate the signature using HMAC with SHA256 and base64-encoding.
The 'hash_hmac' function is only available from PHP 5 &gt;= 5.1.2.
*/
$signature = base64_encode(hash_hmac("sha256", $string_to_sign, $private_key, True));

/* encode the signature for the request */
$signature = str_replace("%7E", "~", rawurlencode($signature));

/* create request */
$request = "http://".$host.$uri."?".$canonicalized_query."&amp;Signature=".$signature;

/* I prefer using CURL */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

$xml_response = curl_exec($ch);

 

Jan 31 / sandeep

OpenVBX which works with Indian Telephony networks

It’s finally here. and for those who don’t know  OpenVBX  its a  open source web phone system created by Twilio. It allows you to create your business phone system using a simple drag and drop approach. Accompanied by its plugin repository, it has become a very successful and hacker friendly for people to come out with very innovative integrations. You can find some videos here:

You want A/B testing of your call flows, we got you covered. You want call routing, that’s there too. What about CRM integration? Absolutely yes. You can find these and a lot more plugins at the Plugin Repository, Because it is such a useful system and it is open source, other telephony guys have also provided their own flavours, the most famous of which is TropoVBX

some time back in may june of 2010 i was working on a app called talkifi, so for that i was hacking openvbx and trying to make it work with http://www.kookoo.in/ due to time constraint and all i thought of using some one’s help in building openvbx for kookoo i have posted the project on stalkninja (StalkNinja ). luckely i found this amazing guy from IIT Chennai Mr.Janardhan a first year student who could complete the task. You can find the project details here, http://stalkninja.com/project/95

As i got busy with other things and didn’t find time to devote on this project  I have decided to give the code to KooKoo so others can build on top of it. kookoo team have hosted it on GitHub you can download the code here

Steps to get started:

  1. Download code
  2. Host it on your PHP enabled web server
  3. Open the site in your browser
  4. Login as admin@kookoovbx.com and password test123
  5. Create your flow and paste the URL of the flow in your KooKoo settings page.
  6. Call your KooKoo number and listen to your flow.

 

So go ahead, download KooKooVBX and use it to build your own innovative cloud business phone systems. Since it is all in PHP, you are free to create/hack your own system and resell it on top of KooKoo which is kind of  robust easy to scale platform and spread across 8 states as of now.

Jan 3 / sandeep

Protected: New year Resolutions 2012

This post is password protected. To view it please enter your password below:


Nov 14 / sandeep

Relationships and commitments

A truly great relationship between 2 people can only exist on basis of giving freedom to each other and never ever on commitments made to each other — RGV

I don’t know where i am eligible to write this post as but lately when i look at some of the failed relationships of my frineds i thouht i would like to share my opinion about relationships and commitments

its perfectly fine for a people to fall in Love and become crazy over it, you and i cant help it, but the real problem comes when they commit to each other at a very early stage. usually any guy or a girl tries to show up there best or good part of them in the beggninning of any relationship may be friendship or lovers or for that matter even in new job this usually stays for may be first 6 months or 1 year depending on the person so obiviously when they are trying to show there best part these times relationships go fine . but the real person comes out only at the time of difficult situation or critical times and usually it takes little long time to observe the guy’s or girls behiour in these times. by this time people might have allready been in a commited relationship then the bad time starts and compromises begeins if both the guys are meature enough of understand each others problem and comprimise then it’s fine happy story otherwise relationship breaks and they wil have terreble time.

so my only advice is Don’t commit to a person early. be friends for some time obeserve in happy and tough times and see if he is right one for you and then make a decesion. i know its difficult for any indian girl to hangout with a guy and not been in a relation but times are chaning people are becoming more open.

please share your perspective about this in the comments below.
:)

May 27 / sandeep

Some words for ninjas at stalkninja.com

Voice post:

Voicepost-talkifi-sandeepeecs by sandeepeecs

Powered by Talkifi ( launch very soon..)

Jan 21 / sandeep

How to build Missed call Applications with Kookoo

In india Missed calls are very popular. we tent to have some preconsived notions and try to communacte it to other people with out even wasting a penny (just a missed call) :)

For the People who have came here for the first time Kookoo is the simplest and easiest way to build telecom applications
IVRs, office PBX and outbound campaigns. this is my earlier post on how to Build kookoo app with PHP

we can build missed call Applications with Kookoo, for example you can just give a missed call to a  number and get cricket score.  as this app was allready built by another company. i tried to build a similar app with it you will get your horoscope with a missed call

here is how it works .

first call this number 918030412941 then it will ask you to enter your birth date in particular format. ( this is the only time your call get charged)
from the next call onwards your call will be disconnected and SMS horoscope will be sent to you.

to know more you can post a comment here or drop me a mail.

Oct 11 / sandeep

Developing Kookoo apps with codeigniter

Prerequisite : you should know the Codeigniter framework and Kookoo API.

KooKoo communicates with our application by posting GET requests to our web server and passing request parameters. but Codeigniter, by default crafts it’s URL in a search engine friendly format. It uses a segment-based approach.

So the first and foremost tweak that we need to do is configure Codeigniter to mix the segments and querystring. this howto article can help you in doing it Howto article.

This is what you can do if you need to have a mixed segment and querystring approach. You can enable this either globally for your whole application or just locally within a controller.

To enable this globally, go to your application/config.php file, and look for $config['uri_protocol'] variable and change it to:

$config['uri_protocol'] = “PATH_INFO”;
After that, find the $config['enable_query_strings'] variable and change it to:
$config['enable_query_strings'] = TRUE;

Now your application is ready to accept both segments and querystrings.
Next thing is you need to parse the url string so that you can get the Parameters available in your class.
so add this line in your Controller Constructor method.
parse_str($_SERVER['QUERY_STRING'],$_GET);

thats it now we are ready to work with Get style of URL’s in codeigniter.

Kookoo has provided a PHP library for working with Kookoo. this is the modified version for codeignitor
so please download this and you can add this file to your application/libraries. Kookoo codeignitor lib

once its done you can start writing your logic in your Class. here is one such example for my Book isbn APP.

class Kookooapp extends Controller {

	function Kookooapp()
	{
		parent::Controller();
                $this->load->library('Kookoo');
                $this->load->library('session');
                parse_str($_SERVER['QUERY_STRING'],$_REQUEST);
	}

        function index()
	{

                $calldata = array(
                   'callno'  => '',
                   'state'   => '',
                   'isbn'    => '',
                   'logged_in' => TRUE
               );

		//for email
		$to = "sandeep.eecs@gmail.com";
                $subject = "KooKooApp call";

                if($_REQUEST['event']=="NewCall") {
                    $this->kookoo->response("5692");
                     $this->kookoo->collectdtmf('15','#','5000');
                     $this->kookoo->addPlayText("Please Enter the Book. isebean number and terminate with hash");
                     $this->session->set_userdata('state', 'getISBN');
                    $this->session->set_userdata('callno', $_REQUEST['cid']);
                    $this->kookoo->getXML();

                } else if ($_REQUEST['event']=="GotDTMF" && $this->session->userdata('state') == "getISBN") {
                    $isbn = $_REQUEST['data'];
                    $this->kookoo->response("5692");
                    $bookdata = $this->flipkartdata($isbn);
                    $emailtext="We got a call from ". $this->session->userdata('callno')." for a book with ISBN ".$isbn ;
                    mail($to,$subject,$emailtext,$headers);
                    if($bookdata['msg']=="gotdata")
                    {
                        $this->session->set_userdata('title', $bookdata['title']);
                        $this->session->set_userdata('fkprice', $bookdata['price']);
                        $this->kookoo->collectdtmf('1','#','5000');
                        $this->kookoo->addPlayText("We found book with title .");
                        $this->kookoo->addPlayText($bookdata['title']);
                        $this->kookoo->addPlayText(" and FlipKart Price is ");
                        $this->kookoo->addPlayText($bookdata['price']);
                        $this->kookoo->addPlayText(" Please Press one to find Price of other Stores");
                        $this->kookoo->addPlayText(" and terminate with hash");
                        $smstext="www.mydiscountbay.com"."flipkart Price ".$this->session->userdata('price'). "booktitle :".$this->session->userdata('title') ;
                        $this->kookoo->sendsms($smstext,$this->session->userdata('callno'));

                        $calldetails = $this->session->userdata('callno'). " called for " .$isbn;
                        $this->kookoo->sendsms($calldetails,'9916810809');

                        $this->session->set_userdata('isbn', $isbn);
                        $this->session->set_userdata('state', 'other store price');
                        $this->kookoo->getXML();
                    }
                    else
                    {
                        $this->kookoo->collectdtmf('15','#','5000');
                        $this->kookoo->addPlayText("Invalid Isbn number Please try again");
                        $this->session->set_userdata('state', 'getISBN');
                        $this->kookoo->getXML();
                    }
                }

                 else if ($_REQUEST['event']=="GotDTMF" && $this->session->userdata('state') == "other store price") {
               	    $option = $_REQUEST['data'];                    

                    $isbn= $this->session->userdata('isbn');
                    $lmprice=$this->getprices->landmark($isbn);
                    $ibprice=$this->getprices->infibeam($isbn);
                    if($lmprice=="N/A")
                    $lmprice="Book not found";
                    else
                    $lmprice = "Rupees ".$lmprice;
                    if($ibprice=="N/A")
                    $ibprice="Book not found";
                    else
                    $ibprice = "Rupees ".$ibprice;
                    $this->kookoo->response("5692");
                    $this->kookoo->PlayText("The Book Price at Landmark is ");
                    $this->kookoo->PlayText($lmprice);
                    $this->kookoo->PlayText("The Book Price at infibeam is ");
                    $this->kookoo->PlayText($ibprice);
                    $this->kookoo->playtext("Thank you for calling Us.");
                    $smstext="www.mydiscountbay.com book with :".$isbn. "price at landmark is  ".$lmprice ."and Price at infibeam is ".$ibprice;
                    $this->kookoo->sendsms($smstext,$this->session->userdata('callno'));
                    $this->kookoo->hangup();
                    $this->kookoo->getXML();
                    //session_destroy();
                    //$this->session->unset_userdata($calldata);
                   $this->session->set_userdata('state', '');

                }

                       	}

        function flipkartdata($isbn)
        {

            if(!$this->isbn->check($isbn))
		{
			$data = array('msg' => "The ISBN number is not Valid"	);
		}
		else{
			$flipkart=$this->flipkart->getdata_html($isbn);
				$data = array(
                                              'title' => $flipkart['title'],
				'author' => $flipkart['author'],
                                'msg'=> "gotdata",
				'price'=> $flipkart['price']);
		}

                return $data ;
        }

}

Post your comments if you found this usefull.