<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>I am having a weird issue with setting the recording file for the Page app.  Here is some quick background info</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I have a macro that pages all my phones:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><I>[macro-pageall]</I></DIV><DIV><I>; Context for paging all devices.</I></DIV><DIV><I>;       This will search the sip table in the realtime database</I></DIV><DIV><I>;       for all phones that start with a number.  That number is</I></DIV><DIV><I>;       passed to this macro as ${ARG1}.</I></DIV><DIV><I>;</I></DIV><DIV><I>;       ARG1 = The first digit of the phones to be paged (6=US Campus, 4=MS, 2=LS)</I></DIV><DIV><I>;       ARG2 = Device for the PA system.  If the user selected to</I></DIV><DIV><I>;               page the PA system.  That will be included.</I></DIV><DIV><I>;</I></DIV><DIV><I>exten =&gt; s,1,MYSQL(Connect connid ${realdb_host} ${realdb_user} ${realdb_pass} ${realdb_db})</I></DIV><DIV><I>exten =&gt; s,2,MYSQL(Query resultid ${connid} SELECT\ name\ FROM\ sip\ WHERE\ name\ LIKE\ "'${ARG1}%'")</I></DIV><DIV><I>exten =&gt; s,3,MYSQL(Fetch fetchid ${resultid} number)</I></DIV><DIV><I>exten =&gt; s,4,GoToIf($["${fetchid}" = "1"]?5:7)</I></DIV><DIV><I>exten =&gt; s,5,Set(pagedevice=${pagedevice}&amp;SIP/${number})</I></DIV><DIV><I>exten =&gt; s,6,GoToIf($["${fetchid}" = "1"]?3:7)</I></DIV><DIV><I>exten =&gt; s,7,Set(pagedevice=${pagedevice:1})</I></DIV><DIV><I>exten =&gt; s,8,MYSQL(Clear ${resultid})</I></DIV><DIV><I>exten =&gt; s,9,MYSQL(Disconnect ${connid})</I></DIV><DIV><I>exten =&gt; s,10,GoToIf($["${ARG2}" != ""]?11:12)</I></DIV><DIV><I>exten =&gt; s,11,Set(pagedevice=${pagedevice}&amp;${ARG2})</I></DIV><DIV><I>;Add Call Info for GrandStream Phone on the PA system</I></DIV><DIV><I>exten =&gt; s,12,SIPAddHeader(Call-Info:answer-after=0)</I></DIV><DIV><I>;Add Alert-Info for all Polycom Phones</I></DIV><DIV><I>exten =&gt; s,13,SIPAddHeader(Alert-Info: Ring Answer)</I></DIV><DIV><I>exten =&gt; s,14,Set(MEETME_RECORDINGFILE=custom/paging/campuslastpage_${RAND(1|100)})</I></DIV><DIV><I>exten =&gt; s,15,NoOp(${MEETME_RECORDINGFILE})</I></DIV><DIV><I>exten =&gt; s,16,Set(CALLERID(all)=System Page &lt;1010&gt;)</I></DIV><DIV><I>exten =&gt; s,17,Page(${pagedevice},r)</I></DIV><DIV><I>exten =&gt; h,1,System(/var/lib/asterisk/scripts/mail_lastpage ${ARG1} ${MEETME_RECORDINGFILE})</I></DIV><DIV><I>exten =&gt; h,2,Hangup()</I></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I call the macro with:</DIV><DIV><I>;Page All Phones including the PA system.</I></DIV><DIV><I>exten =&gt; 1010,1,Authenticate(12345)</I></DIV><DIV><I>exten =&gt; 1010,2,Macro(pageall,2,SIP/ls-pa)</I></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Basically the macro goes through my sip realtime database and finds all the phones that begin with the number 2 (my lower school campus).  The generates a variable named pagedevice that looks like this: </DIV><DIV>SIP/2101&amp;SIP/2102&amp;SIP/2103</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This part works great.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The issue I am having is setting the MEETME_RECORDINGFILE.  It should be set to an audio file in the custom sounds directory with a random number at the end.  I then use a hangup (h) extension to execute a script (at bottom of email) to email the audio file to a conference area in our email system (FirstClass).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>What is weird is after I restart the asterisk process, this works fine for about a week.  It does exactly as it is supposed to, creates the audio file with a random number, then the email script delivers it.  After a week or so Asterisk will stop setting the variable MEETME_RECORDINGFILE and start placing the recordings in the sounds directory named meetme-conf-rec.######.wav.  Which is the default is MEETME_RECORDINGFILE is not set.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Anyone seen this issue before?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks!</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Forrest Beck</DIV><DIV><A href="mailto:jonforrest.beck@gmail.com">jonforrest.beck@gmail.com</A></DIV><DIV>www.shift8.biz</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><DIV>#!/bin/bash</DIV><DIV>#Set some variables</DIV><DIV>USFACULTY="<A href="mailto:ast-phonepages@somedomain.com">ast-phonepages@somedomain.com</A>"</DIV><DIV>LSFACULTY="ast-phonepages@somedomain.com"</DIV><DIV>USFACULTY="ast-phonepages@somedomain.com"</DIV><DIV>MONTH=`date +%B`</DIV><DIV>DAY=`date +%d`</DIV><DIV>YEAR=`date +%Y`</DIV><DIV>HOUR=`date +%I`</DIV><DIV>MINUTE=`date +%M`</DIV><DIV>ZONE=`date +%Z`</DIV><DIV>AMPM=`date +%P`</DIV><DIV>PGSOUNDDIR="/var/lib/asterisk/sounds/"</DIV><DIV>LOGFILE="/var/log/mail_lastpage.log"</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>#Write Log</DIV><DIV>echo "`date` Running script for campus $1 with file $2" &gt;&gt; $LOGFILE</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>#Let give asterisk time to finish creating the recordng file.  Just in Case.</DIV><DIV>sleep 10</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>#</DIV><DIV>#Create a temp file with our message body</DIV><DIV>#</DIV><DIV>echo "Repeat Last Page" &gt; /tmp/repeatpage_$1</DIV><DIV>echo "" &gt;&gt; /tmp/repeatpage_$1</DIV><DIV>echo "The attached WAV file is a copy of the last broadcast over the phone system."  &gt;&gt; /tmp/repeatpage_$1</DIV><DIV>echo "" &gt;&gt; /tmp/repeatpage_$1</DIV><DIV>echo "The page was broadcasted $MONTH $DAY, $YEAR at $HOUR:$MINUTE $AMPM. You may play this file back if you missed the page." &gt;&gt; /tmp/repeatpage_$1</DIV><DIV>echo "" &gt;&gt; /tmp/repeatpage_$1</DIV><DIV>echo "" &gt;&gt; /tmp/repeatpage_$1</DIV><DIV>echo "If you wish to mark this email as "read" (Remove Red Flag) without opening the email, you may right-click (or control-click for Mac) and left-click "Mark </DIV><DIV>as Read" before opening the email." &gt;&gt; /tmp/repeatpage_$1</DIV><DIV>#</DIV><DIV>#Send the email with the recorded Page attached</DIV><DIV>#</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV># Was it Upper School?</DIV><DIV>if [ "$1" -eq "6" ]</DIV><DIV>        then</DIV><DIV>                cat /tmp/repeatpage_$1 | mutt -a $PGSOUNDDIR$2.wav -s "Recording of Last Page for Upper School" $USFACULTY</DIV><DIV>fi</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV># Was it Middle School?</DIV><DIV>if [ "$1" -eq "4" ]</DIV><DIV>        then</DIV><DIV>                cat /tmp/repeatpage_$1 | mutt -a $PGSOUNDDIR$2.wav -s "Recording of Last Page for Middle School" $MSFACULTY</DIV><DIV>fi</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV># How about Lower?</DIV><DIV>if [ "$1" -eq "2" ]</DIV><DIV>        then</DIV><DIV>                cat /tmp/repeatpage_$1 | mutt -a $PGSOUNDDIR$2.wav -s "Recording of Last Page for Lower School" $LSFACULTY</DIV><DIV>fi</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>rm -rf /tmp/repeatpage_$1</DIV><DIV>rm -f $PGSOUNDDIR$2.wav</DIV><DIV>exit</DIV><BR></BODY></HTML>