I have a Perl script which inserts values in to a Mysql DB. Within the same script, I check a condition, and if successful, go to the asterisk CLI and run the originate command. When I run it in the terminal it's working properly. When I set it as a crontab, it will update the DB but the originate command is not working. I am new to Perl, please help me to solve this. Thanks in advance.
Perl script:
if($temperature > 85){
print `asterisk -rx "originate Dongle/dongle0/0123456789 extension 400\@out"`;
}
Crontab:
*/1 * * * * /home/test/bin/insert_mysql.pl