Here with PHP script we reset the VICIDIAL leads using php script .
<?php
$servername = "localhost";
$username = "admin";
$password = "mydbpassword";
$dbname = "asterisk";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE vicidial_list SET called_since_last_reset = 'N' WHERE list_id > 100000 AND status IN ('NA','RNA','ERI','DROP','NA','NB')";
if ($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$conn->close();
?>
Add it to crontab
*/5 * * * * /usr/bin/php /srv/www/htdocs/reset_leads.php
Comments
Post a Comment