[asterisk-users] Paging MEETME_RECORDINGFILE Variable

Forrest Beck jonforrest.beck at gmail.com
Fri Sep 21 08:59:02 CDT 2007


Here is my CLI from this morning.  We had a Page at 9:15 that was  
about 20 seconds long.  Then another Page at 9:18.  The first page  
worked fine.  It recorded in the correct file.  The second just  
disregarded the MEETME_RECORDINGFILE variable.

------ CLI from Page that worked.

[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Executing [s at macro- 
pageall:14] Set("SIP/6101-086ce6c8", "MEETME_RECORDINGFILE=custom/ 
paging/campuslastpage_47") in new stack
[Sep 21 09:15:16] DEBUG[13842] app_macro.c: Executed application: Set
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Executing [s at macro- 
pageall:15] NoOp("SIP/6101-086ce6c8", "custom/paging/ 
campuslastpage_47") in new stack
[Sep 21 09:15:16] DEBUG[13842] app_macro.c: Executed application: NoOp
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Executing [s at macro- 
pageall:16] Set("SIP/6101-086ce6c8", "CALLERID(all)=System Page  
<1010>") in new stack
[Sep 21 09:15:16] DEBUG[13842] app_macro.c: Executed application: Set
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Executing [s at macro- 
pageall:17] Page("SIP/6101-086ce6c8", "SIP/6101&SIP/6102&SIP/6103&SIP/ 
6104&SIP/6105&SIP/6106&SIP/6107&SIP/6108&SIP/6109&SIP/6120&SIP/ 
6131&SIP/6132&SIP/6133&SIP/6134&SIP/6141&SIP/6142&SIP/6143&SIP/ 
6144&SIP/6145&SIP/6146&SIP/6147&SIP/6148&SIP/6149&SIP/6161&SIP/ 
6162&SIP/6163&SIP/6181&SIP/6182&SIP/6183&SIP/6301&SIP/6302&SIP/ 
6303&SIP/6304&SIP/6305&SIP/6306&SIP/6307&SIP/6308&SIP/6309&SIP/ 
6310&SIP/6311&SIP/6312&SIP/6313&SIP/6314&SIP/6315&SIP/6316&SIP/ 
6317&SIP/6318&SIP/6319&SIP/6320&SIP/6321&SIP/6322&SIP/6324&SIP/ 
6325&SIP/6326&SIP/6327&SIP/6328&SIP/6329&SIP/6330&SIP/6332&SIP/ 
6333&SIP/6334&SIP/6335&SIP/6336&SIP/6337&SIP/6338&SIP/6339&SIP/ 
6340&SIP/6342&SIP/6343&SIP/6344&SIP/6345&SIP/6346&SIP/6347&SIP/ 
6398&SIP/6401&SIP/6402&SIP/6404&SIP/6405&SIP/6406&SIP/6407&SIP/ 
6410&SIP/6411&SIP/6420&SIP/6421&SIP/6422&SIP/us-pa|r") in new stack
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Called 6102
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Called 6103
----- Others.....
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Called 6406
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Called 6411
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Called us-pa
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- <SIP/6101-086ce6c8>  
Playing 'beep' (language 'en')
[Sep 21 09:15:16] VERBOSE[13853] logger.c:     -- SIP/6106-086ca570  
is ringing
----- Others.....
[Sep 21 09:15:16] VERBOSE[13924] logger.c:     -- SIP/6405-086dcee8  
is ringing
[Sep 21 09:15:16] VERBOSE[13927] logger.c:     -- SIP/us-pa-0871b160  
is ringing
[Sep 21 09:15:16] DEBUG[13842] app_meetme.c: Building dynamic  
conference '79166422d'
[Sep 21 09:15:16] VERBOSE[13842] logger.c:     -- Created MeetMe  
conference 1022 for conference '79166422d'
[Sep 21 09:15:16] VERBOSE[13842] logger.c:        > Starting  
recording of MeetMe Conference 79166422d into file custom/paging/ 
campuslastpage_47.wav.

------ CLI from Page that failed.

[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- Executing [s at macro- 
pageall:14] Set("SIP/6101-b7a53170", "MEETME_RECORDINGFILE=custom/ 
paging/campuslastpage_6") in new stack
[Sep 21 09:18:36] DEBUG[14225] app_macro.c: Executed application: Set
[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- Executing [s at macro- 
pageall:15] NoOp("SIP/6101-b7a53170", "custom/paging/ 
campuslastpage_6") in new stack
[Sep 21 09:18:36] DEBUG[14225] app_macro.c: Executed application: NoOp
[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- Executing [s at macro- 
pageall:16] Set("SIP/6101-b7a53170", "CALLERID(all)=System Page  
<1010>") in new stack
[Sep 21 09:18:36] DEBUG[14225] app_macro.c: Executed application: Set
[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- Executing [s at macro- 
pageall:17] Page("SIP/6101-b7a53170", "SIP/6101&SIP/6102&SIP/6103&SIP/ 
6104&SIP/6105&SIP/6106&SIP/6107&SIP/6108&SIP/6109&SIP/6120&SIP/ 
6131&SIP/6132&SIP/6133&SIP/6134&SIP/6141&SIP/6142&SIP/6143&SIP/ 
6144&SIP/6145&SIP/6146&SIP/6147&SIP/6148&SIP/6149&SIP/6161&SIP/ 
6162&SIP/6163&SIP/6181&SIP/6182&SIP/6183&SIP/6301&SIP/6302&SIP/ 
6303&SIP/6304&SIP/6305&SIP/6306&SIP/6307&SIP/6308&SIP/6309&SIP/ 
6310&SIP/6311&SIP/6312&SIP/6313&SIP/6314&SIP/6315&SIP/6316&SIP/ 
6317&SIP/6318&SIP/6319&SIP/6320&SIP/6321&SIP/6322&SIP/6324&SIP/ 
6325&SIP/6326&SIP/6327&SIP/6328&SIP/6329&SIP/6330&SIP/6332&SIP/ 
6333&SIP/6334&SIP/6335&SIP/6336&SIP/6337&SIP/6338&SIP/6339&SIP/ 
6340&SIP/6342&SIP/6343&SIP/6344&SIP/6345&SIP/6346&SIP/6347&SIP/ 
6398&SIP/6401&SIP/6402&SIP/6404&SIP/6405&SIP/6406&SIP/6407&SIP/ 
6410&SIP/6411&SIP/6420&SIP/6421&SIP/6422&SIP/us-pa|r") in new stack
[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- Called 6102
----- Others.....
[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- Called 6406
[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- Called 6411
[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- Called us-pa
[Sep 21 09:18:36] VERBOSE[14225] logger.c:     -- <SIP/6101-b7a53170>  
Playing 'beep' (language 'en')
[Sep 21 09:18:36] VERBOSE[14277] logger.c:     -- SIP/6319-b5fa79b0  
is busy
----- Others.....
[Sep 21 09:18:36] VERBOSE[14297] logger.c:     -- SIP/6342-b5e0d0a0  
is ringing
[Sep 21 09:18:37] VERBOSE[14309] logger.c:     -- SIP/us-pa-b5e4a318  
answered
[Sep 21 09:18:37] DEBUG[14309] app_meetme.c: Building dynamic  
conference '177928251d'
[Sep 21 09:18:37] VERBOSE[14309] logger.c:     -- Created MeetMe  
conference 1021 for conference '177928251d'
[Sep 21 09:18:37] VERBOSE[14309] logger.c:        > Starting  
recording of MeetMe Conference 177928251d into file meetme-conf- 
rec-177928251d-1190380716.710.wav.


Forrest Beck
jonforrest.beck at gmail.com
www.shift8.biz



Begin forwarded message:

> From: Forrest Beck <jonforrest.beck at gmail.com>
> Date: September 20, 2007 5:37:22 PM EDT
> To: Asterisk Users Mailing List - Non-Commercial Discussion  
> <asterisk-users at lists.digium.com>
> Subject: Paging MEETME_RECORDINGFILE Variable
>
> I am having a weird issue with setting the recording file for the  
> Page app.  Here is some quick background info
>
> I have a macro that pages all my phones:
>
> [macro-pageall]
> ; Context for paging all devices.
> ;       This will search the sip table in the realtime database
> ;       for all phones that start with a number.  That number is
> ;       passed to this macro as ${ARG1}.
> ;
> ;       ARG1 = The first digit of the phones to be paged (6=US  
> Campus, 4=MS, 2=LS)
> ;       ARG2 = Device for the PA system.  If the user selected to
> ;               page the PA system.  That will be included.
> ;
> exten => s,1,MYSQL(Connect connid ${realdb_host} ${realdb_user} $ 
> {realdb_pass} ${realdb_db})
> exten => s,2,MYSQL(Query resultid ${connid} SELECT\ name\ FROM\ sip 
> \ WHERE\ name\ LIKE\ "'${ARG1}%'")
> exten => s,3,MYSQL(Fetch fetchid ${resultid} number)
> exten => s,4,GoToIf($["${fetchid}" = "1"]?5:7)
> exten => s,5,Set(pagedevice=${pagedevice}&SIP/${number})
> exten => s,6,GoToIf($["${fetchid}" = "1"]?3:7)
> exten => s,7,Set(pagedevice=${pagedevice:1})
> exten => s,8,MYSQL(Clear ${resultid})
> exten => s,9,MYSQL(Disconnect ${connid})
> exten => s,10,GoToIf($["${ARG2}" != ""]?11:12)
> exten => s,11,Set(pagedevice=${pagedevice}&${ARG2})
> ;Add Call Info for GrandStream Phone on the PA system
> exten => s,12,SIPAddHeader(Call-Info:answer-after=0)
> ;Add Alert-Info for all Polycom Phones
> exten => s,13,SIPAddHeader(Alert-Info: Ring Answer)
> exten => s,14,Set(MEETME_RECORDINGFILE=custom/paging/campuslastpage_ 
> ${RAND(1|100)})
> exten => s,15,NoOp(${MEETME_RECORDINGFILE})
> exten => s,16,Set(CALLERID(all)=System Page <1010>)
> exten => s,17,Page(${pagedevice},r)
> exten => h,1,System(/var/lib/asterisk/scripts/mail_lastpage ${ARG1}  
> ${MEETME_RECORDINGFILE})
> exten => h,2,Hangup()
>
> I call the macro with:
> ;Page All Phones including the PA system.
> exten => 1010,1,Authenticate(12345)
> exten => 1010,2,Macro(pageall,2,SIP/ls-pa)
>
> 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:
> SIP/2101&SIP/2102&SIP/2103
>
> This part works great.
>
> 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).
>
> 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.
>
> Anyone seen this issue before?
>
> Thanks!
>
>
> Forrest Beck
> jonforrest.beck at gmail.com
> www.shift8.biz
>
>
> #!/bin/bash
> #Set some variables
> USFACULTY="ast-phonepages at somedomain.com"
> LSFACULTY="ast-phonepages at somedomain.com"
> USFACULTY="ast-phonepages at somedomain.com"
> MONTH=`date +%B`
> DAY=`date +%d`
> YEAR=`date +%Y`
> HOUR=`date +%I`
> MINUTE=`date +%M`
> ZONE=`date +%Z`
> AMPM=`date +%P`
> PGSOUNDDIR="/var/lib/asterisk/sounds/"
> LOGFILE="/var/log/mail_lastpage.log"
>
> #Write Log
> echo "`date` Running script for campus $1 with file $2" >> $LOGFILE
>
> #Let give asterisk time to finish creating the recordng file.  Just  
> in Case.
> sleep 10
>
> #
> #Create a temp file with our message body
> #
> echo "Repeat Last Page" > /tmp/repeatpage_$1
> echo "" >> /tmp/repeatpage_$1
> echo "The attached WAV file is a copy of the last broadcast over  
> the phone system."  >> /tmp/repeatpage_$1
> echo "" >> /tmp/repeatpage_$1
> echo "The page was broadcasted $MONTH $DAY, $YEAR at $HOUR:$MINUTE  
> $AMPM. You may play this file back if you missed the page." >> /tmp/ 
> repeatpage_$1
> echo "" >> /tmp/repeatpage_$1
> echo "" >> /tmp/repeatpage_$1
> 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
> as Read" before opening the email." >> /tmp/repeatpage_$1
> #
> #Send the email with the recorded Page attached
> #
>
> # Was it Upper School?
> if [ "$1" -eq "6" ]
>         then
>                 cat /tmp/repeatpage_$1 | mutt -a $PGSOUNDDIR$2.wav - 
> s "Recording of Last Page for Upper School" $USFACULTY
> fi
>
> # Was it Middle School?
> if [ "$1" -eq "4" ]
>         then
>                 cat /tmp/repeatpage_$1 | mutt -a $PGSOUNDDIR$2.wav - 
> s "Recording of Last Page for Middle School" $MSFACULTY
> fi
>
> # How about Lower?
> if [ "$1" -eq "2" ]
>         then
>                 cat /tmp/repeatpage_$1 | mutt -a $PGSOUNDDIR$2.wav - 
> s "Recording of Last Page for Lower School" $LSFACULTY
> fi
>
> rm -rf /tmp/repeatpage_$1
> rm -f $PGSOUNDDIR$2.wav
> exit
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070921/416cceca/attachment.htm 


More information about the asterisk-users mailing list