Made a simple script that read Master.csv and print out detatils about calls. Have these lines in /www/cgi-bin/webif/status-asterisk.sh
First time I made a shell script...please help me modify it little to the better
echo "<h3>CDR Call Detail Records</h3>"
if [ -f /var/log/asterisk/cdr-custom/Master.csv ]; then
echo '<table width="100%" border="0" cellspacing="0" cellpadding="20">'
echo '<tr>'
echo '<td bgcolor="#CCCCCC">Incoming Number</td>'
echo '<td bgcolor="#CCCCCC">Outgoing Number</td>'
echo '<td bgcolor="#CCCCCC">Start Time</td>'
echo '<td bgcolor="#CCCCCC">End Time</td>'
echo '<td bgcolor="#CCCCCC">Seconds</td>'
echo '</tr>'
IFS=,
while
read CDRclid CDRsrc CDRdst CDRdcontext CDRchannel CDRdstchannel CDRlastapp CDRlastdata CDRstart CDRanswer CDRend CDRduration CDRbill
do echo
echo '<tr>'
echo '<td>'"$CDRsrc"'</td>'
echo '<td>'"$CDRdst"'</td>'
echo '<td>'"$CDRstart"'</td>'
echo '<td>'"$CDRend"'</td>'
echo '<td>'"$CDRbillsec"'</td>'
echo '</tr>'
done < /var/log/asterisk/cdr-custom/Master.csv
echo '</table>'
else
echo 'Please load the cdr_custom.so module'
fi