Bill Clarke
New Member
- Joined
- Dec 26, 2018
- Messages
- 4
- Reaction score
- 0
I need to set up a daily email including all inbound calls, there destination or extension transferred to, and if the call was answered or went to VM. Is this possible?
Here's the script that we run from /etc/crontab every day:
Code:#!/bin/bash mysql -u root -ppassw0rd asteriskcdrdb -e 'SELECT calldate, clid FROM cdr WHERE DATE(calldate) = SUBDATE(CURDATE(), 1) AND did <> ""'
Here's the script that we run from /etc/crontab every day:
Code:#!/bin/bash mysql -u root -ppassw0rd asteriskcdrdb -e 'SELECT calldate, clid FROM cdr WHERE DATE(calldate) = SUBDATE(CURDATE(), 1) AND did <> ""'
#!/bin/bash
(
echo "From: PBX <[email protected]>";
echo "To: Admin <[email protected]>";
echo "Subject: Yesterday's Call Report";
echo "MIME-Version: 1.0";
echo "Content-Type: text/html";
echo "Content-Disposition: inline";
echo "<html>"
echo "<body>"
echo "<pre style=\"font: monospace\">"
mysql -u root -ppassw0rd asteriskcdrdb -t -e 'SELECT calldate AS Timestamp, clid AS CallerID, did as DID, dst AS Destination, disposition AS Disposition, duration AS Duration FROM cdr WHERE DATE(calldate) = SUBDATE(CURDATE(), 1) AND did <> ""'
echo "</pre>";
echo "</body>";
echo "</html>";
) | sendmail -t
40 0 * * * root /root/daily-report > /dev/null 2>&1
Don't alter anything. It will retrieve calls from the previous day.
Link up your team and customers Phone System Live Chat Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.