Notification for missed calls - part II

Another work-around would be a script, which you execute as a cronjob every 5mins or so (you have to change the time span)

cdr-email.sh

#!/bin/bash

/usr/bin/mysql -u freepbxuser -PASSWORD -e "SELECT calldate AS Timestamp, clid AS Caller, disposition AS Status, dst AS Destination, duration AS Duration, src AS Source, did AS Target_inbound,lastapp AS LastApp,dcontext AS Context, dstchannel AS DestChannel, userfield AS outgoing, uniqueid AS ID from cdr where calldate > date_sub(now(), interval 24 HOUR) GROUP BY ID, Status ORDER BY ID DESC, Status DESC" -H asteriskcdrdb | mail -s "$(echo -e "Custom Call Report YOURLOCATION\nContent-Type: text/html")" YOUREMAILADDRESS

I described it here

1 Like