Is it possible in phpAGI script

Hi,
i am trying to connect to my external hosted mysql db of website using a class file (API) with in agi script and get back the result variable back to agiscript and from there to dialplan.Here is my code

my classfile(api) :calleridverification.php

<?php
class CallerIdVerification{
var $clientid = "jambodium";
var $clientsecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
var $url = "http://xxxxxxxxxxxxxxxxxx/callerverify.php";
var $postfields;
var $callerid;

function __construct() {
}

function CallerVerify($caller_id=''){
	$resp = 0;
	$this->callerid = trim($caller_id);
	//$this->url .= '?clientid='.$this->clientid.'&clientsecret='.$this->clientsecret.'&callerid='.$this->callerid;
	$this->postfields .= "clientid=".$this->clientid."&clientsecret=".$this->clientsecret."&callerid=".$this->callerid;
	//echo $this->url.'<br />';
	$resp = $this->getCURL();
	return $resp;
}

function getCURL(){
	// Get cURL resource
	$curl = curl_init();
	// Set some options - we are passing in a useragent too here
	curl_setopt($curl, CURLOPT_URL, $this->url);
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($curl, CURLOPT_POST, 1);
	curl_setopt($curl, CURLOPT_POSTFIELDS, $this->postfields);
	// Send the request & save response to $resp
	$resp = curl_exec($curl);
	//echo $this->url;
	//echo $resp;
	$resultmob = NULL;
	if(!$resp){
	// Show ERROR message if $resp is FALSE
		echo 'Error: ' . curl_error($curl) . ' - Code: ' . curl_errno($curl);
	}else{
		$resparr = json_decode($resp,true);
		$resultmob = (count($resparr)>0)?$resparr['resultmob']:NULL;
	}
	// Close request to clear up some resources
	curl_close($curl);
	//return $resp;
	return $resultmob;
}

}
?>


and my phpagi script:workingagi.php

#!/usr/bin/php -q 
<?php
error_reporting (E_ALL ^ E_NOTICE);
set_time_limit(30);
require('phpagi.php');
require('CallerIdVerification.php');
ini_set('display_errors','false');
$agi=new AGI();
/* variable $argv[1] is callerid from dialplan*/
$callerid=$argv[1];
$resultmob=0;
$civ = new CallerIdVerification();
$resultmob = $civ->CallerVerify($callerid);
$agi->set_variable("resultmob",$resultmob);

/* sending variable $resultmob back to dial plan */
$agi->verbose("****$resultmob*****");
exit();
?>

i executed in shell as well as in asterisk it wont take any thing from class file (api).please let me know how to solve this …thank you

Solved working fine…