5) and ($row['dst']<>'musiconhold') and ($row['dst']<>"STARTMEETME") and ($row['disposition']=="ANSWERED") and ($row['billsec']>0) and ($row['dstchannel']>"")) { $cd=$row['calldate']; $trk=substr($row['dstchannel'],4,10); $dest=$row['dst']; if(strlen($dest)==8) { $dest=$state.$dest; } $sec=$row['billsec']; $sec=str_pad($sec,5,"0",STR_PAD_LEFT); $a=$cd.",".$trk.",".$dest.",".$sec."\n"; if(substr($trk,0,1)=="T") { fputs($fe,$a); } } } mysqli_close($con); fclose($fe); shell_exec("/bin/sh copy-cdr-to-emersion & \n"); } //----------------------------------------------------------- // -- end of functions // -------------------------------------------------------------- // code $cdr=get_reporting(); if ($cdr=="N") { die; } $state=get_state_prefix(); create_data_file($state);