Portal Home > Knowledgebase > cPanel > Call notify script
Installed in /var/lib/astersisk/binRuns every 10 minutes due to cron setup#!/usr/bin/php -q$callNotify = array('ext' => 'comma delimited list of SMS number','302' => '6138188391,6138801797', // robin, amanda'5212' => '6138801797', // mark'5213' => '6138801797' // steph);# Directory housing the voicemail spool for asterisk$dir = "/var/spool/asterisk/voicemail/default/";foreach ($callNotify as $ext => $sms){if( dir_has_files($dir . $ext . '/INBOX') ){$phones = preg_split("/[\s]*[,][\s]*/", $sms);foreach( $phones as $phone ){// http://192.168.10.23:9090/sendsms?phone=6138188391&text=text+messagefile_get_contents('http://192.168.10.23:9090/sendsms?phone='.$phone.'&text=MMAH+voicemail+on+extension+'.$ext);}}}function dir_has_files($dir) {if (is_dir($dir))return (count(scandir($dir)) > 2);return 0;}?>
Add to Favourites
Print this Article