<?php

include_once('db_services.php');
ini_set('max_execution_time', 120);

$cid = isset($_POST['ani']) ? $_POST["ani"]  : "";
$equipo = isset($_POST['equipo']) ? $_POST["equipo"]  : "";

if( $cid == "" ) 
   $cid = isset($_GET['ani']) ? $_GET["ani"]  : "";

if( $cid != "" ) {
   $first = true;
   $q = sprintf( "select sql_no_cache * from ani_calls where cid='%s' and equipo='%s'", $cid, equipo );
   $result = $conn->query( $q );
   if( $result->num_rows > 0 ) {
      if($row = $result->fetch_assoc()) {
         $count = $row["count"];
         $count_conf = $row["count_conference"];

         echo (intval( $count ) + intval($cont_conf));
      }
   }
   else echo "-1";
   if( is_resource($result) ) mysql_free_result( $result );
}
else echo "-2";
mysqli_close($conn);
?>

