[SOLVED] Call Logs - Not real time.

Status
Not open for further replies.

adonias

Joined
Oct 13, 2007
Messages
7
Reaction score
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
 
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
 
Status
Not open for further replies.

Forum statistics

Threads
111,901
Messages
589,635
Members
164,768
Latest member
Eagle Man