die Lancom Call Manager können alternativ die Call Detail Records [CDR] auch als Mail versenden. Um diese wieder in Listenform darzustellen, soll folgendes PHP Script dienen:
Code: Alles auswählen
<?php
header('Content-type: text/html'); echo"<pre>";
$imapObj=imap_open("{mailserver.de:110/pop3/notls}INBOX","username","password");
if($imapObj) { $imapCount=imap_num_msg($imapObj); for ($i=1;$i<=$imapCount;++$i) {
$header=imap_header($imapObj,$i); if (strpos($header->subject,"CDR")!=false) {
$body=imap_body($imapObj,$i); $bodyarray=explode("\n",$body); $cdr=array();
foreach($bodyarray as $value) { $x=explode(": ",$value); $cdr[str_replace(" ","",trim($x[0]))]=trim($x[1]); }
echo substr($cdr["StartTime"],0,19)." - ";
if ($cdr["ConnectTime"]=="") { echo " - "; } else {
echo strtotime(substr($cdr["EndTime"],0,19))-strtotime(substr($cdr["ConnectTime"],0,19))." - "; }
echo $cdr["CallingLine"]." ".$cdr["CallingID"]." -> ";
echo $cdr["ConnectedLine"]." ".$cdr["ConnectedID"]."<br>"; } }
imap_close($imapObj); }
else { echo "No Connection!"; }
echo"</pre>";
?>
Anregungen zur Erweiterung sind willkommen.
Gruß aus Essen ... Erik