[asterisk-bugs] [Asterisk 0006681]: [patch][post 1.4] Random Periodic Announcements in app_queue

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Oct 18 14:39:15 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=6681 
====================================================================== 
Reported By:                alt_phil
Assigned To:                bweschke
====================================================================== 
Project:                    Asterisk
Issue ID:                   6681
Category:                   Applications/app_queue
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases): trunk 
SVN Revision (number only!):  
Disclaimer on File?:        No 
Request Review:             Yes 
====================================================================== 
Date Submitted:             03-08-2006 13:33 CST
Last Modified:              10-18-2007 14:39 CDT
====================================================================== 
Summary:                    [patch][post 1.4] Random Periodic Announcements in
app_queue
Description: 
Just wanted to submit this little addition to Periodic Announcements while
on hold.
This patch allows you to specify a directory instead of a file for
periodic-announce in queues.conf.
Doing so will randomly choose and play a file in that directory, however
often is specified with periodic-announce-frequency.  A different random
file from that directory is played each time.

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
child of            0006776 [patch] does not goto context in queues...
====================================================================== 

---------------------------------------------------------------------- 
 putnopvut - 10-18-07 14:39  
---------------------------------------------------------------------- 
I've uploaded a new version of this patch. Here are some differences
between it and the old patch:

1. It applies cleanly to the current SVN trunk (rev 86329)
2. I replaced uses of insecure functions like sprintf and strcat with the
asterisk dynamic string functions.
3. The path to the directory specified is not hardcoded. Instead, you may
specify any absolute path to a directory that contains the sound files.
4. I replaced the random functions used with the thread-safe ast_random
function.

I pondered bweschke's comments about the expense of doing this in
realtime, but ended up not changing the patch to reflect those concerns. I
can certainly agree with the computational concerns of stat'ing and
scandir'ing every time an announcement is played. The thing is, I can also
see how someone might want to occasionally change the contents of their
periodic-announce directory without the need to reload app_queue. Perhaps
another option should be introduced to allow caching of the directory
entries at module load time for those who can't afford the CPU hit or who
don't change periodic announcement files around often? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-18-07 14:39  putnopvut      Note Added: 0072248                          
======================================================================




More information about the asterisk-bugs mailing list