3 # Set a variable called stdin to help us
4 # get the variables from Asterisk
7 # Read in the variables from Asterisk
8 while [ "$stdin" != "" ]
13 ## admin_email=$(nvram get "AST_ADMIN_Email")
14 ## smtp_server=$(nvram get "AST_SMTP_Server")
15 admin_email=$(uci get mars.system.AST_ADMIN_Email)
16 smtp_server=$(uci get mars.system.AST_SMTP_Server)
18 echo 'From: '$admin_email >/tmp/wa_dir.html
19 echo 'Subject: Web Audio Directory' >>/tmp/wa_dir.html
20 echo 'MIME-Version: 1.0' >>/tmp/wa_dir.html
21 echo -e 'Content-Type: text/html\n' >>/tmp/wa_dir.html
23 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' >>/tmp/wa_dir.html
24 echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">' >>/tmp/wa_dir.html
25 echo '<xml version="1.0" encoding="ISO-8859-1"' >>/tmp/wa_dir.html
27 echo '<body>' >>/tmp/wa_dir.html
28 echo '<b>Web Audio Directory</b><p>' >>/tmp/wa_dir.html
29 echo '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><pre><strong><big>' >>/tmp/wa_dir.html
31 grep -v "\[URL" /usr/lib/asterisk/agi-bin/web_audio.txt > /tmp/wa_dir.txt
32 cat /tmp/wa_dir.txt >>/tmp/wa_dir.html
34 echo '</big></strong></pre></td></tr></table></body></html>' >>/tmp/wa_dir.html
35 #echo "Mailing Calls Log ..."
36 /usr/sbin/mini_sendmail -t -s$smtp_server $admin_email </tmp/wa_dir.html