[SOLVED] Call Logs - Not real time.

Discussion in '3CX Phone System - General' started by adonias, Nov 3, 2007.

  1. adonias

    Joined:
    Oct 13, 2007
    Messages:
    7
    Likes Received:
    0
    Call Logs - Not real time.

    ok, call logs report works fine, but the time in all callsis not real!

    Example:

    If call to extencion 1001 from extencion 1000, and ringin 5 seconds. The logs is time ringing + time call.

    its wrong.

    How to show in the report only call time, not ringing time?

    Thxx for your help
     
  2. adonias

    Joined:
    Oct 13, 2007
    Messages:
    7
    Likes Received:
    0
    I solved by my self!

    Plz chech it:

    Code:
    	
    //class for postgre
    $myDB = new DB();
    
    
    	//Select from history call, call answer (eventtype 2) ;
    	$myDB->query("SELECT * FROM history WHERE eventtype = 2 AND extract bla bla bla ORDER BY idhistory DESC");
    	
    	//get result from array 
    	while($Data = $myDB->fetchArray()){
    
    			//Check call finish (eventtype 6),  by call id
    			$last_eventtime = dbQueryFirst("SELECT * FROM history WHERE callid = '".$Data['callid']."' AND eventtype = '6' ");
    			
    echo 'Start:'.$Data['eventtime'].';
    echo 'Finish:'.$last_eventtime['eventtime'].' ;
    echo 'real time spk:'.(strtotime($last_eventtime['eventtime']) - strtotime($Data['eventtime']));
    echo 'Ext To:'.$Data['callto']; 
    echo 'Ext From:'.$Data['callfrom'];
    
    }
    
    its a simpl solution
     

Share This Page