");
if ($start != -1)
{
$start+=2;
$msg = substr($msg, $start);
$parts = split("[<>]", $msg);
$to_agent = $parts[12];
$DbLink->query("insert into ".C_OFFLINE_IM_TBL." (uuid, message) values ('" .
mysql_escape_string($to_agent) . "', '" .
mysql_escape_string($msg) . "')");
echo "true";
}
else
{
echo "false";
}
exit;
}
if ($method == "/RetrieveMessages/")
{
$parms = $HTTP_RAW_POST_DATA;
$parts = split("[<>]", $parms);
$agent_id = $parts[6];
$DbLink->query("select message from ".C_OFFLINE_IM_TBL." where uuid='" .
mysql_escape_string($agent_id) . "'");
echo "";
while(list($message) = $DbLink->next_record())
{
echo $message;
}
echo "";
$DbLink->query("delete from ".C_OFFLINE_IM_TBL." where uuid='" .
mysql_escape_string($agent_id) . "'");
exit;
}
?>