Extracting the email address for device 100
<?php
if(!empty($argv[1])){
$email=shell_exec("cat /etc/asterisk/voicemail.conf | grep $argv[1] ");
stristr($email, '@'); // As of PHP 5.3.0, outputs US
$username=stristr($email, '@',true);
$id=explode(',',$email);
echo $id[2];
echo "\n";
$domain=explode(',',$username);
echo $domain[2]; }
else {
echo "FALSE";
}
?>
php vm_email.php 100
No hay comentarios:
Publicar un comentario