[asterisk-bugs] [Asterisk 0011196]: RealTime MusicOnHold

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Nov 8 18:09:55 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11196 
====================================================================== 
Reported By:                sergee
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11196
Category:                   Resources/res_musiconhold
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 89114 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             11-08-2007 12:59 CST
Last Modified:              11-08-2007 18:09 CST
====================================================================== 
Summary:                    RealTime MusicOnHold
Description: 
Some parts of asterisk support RealTime, but others don't. This patch is an
implementation of RT for res_musiconhold. Now you can store MOH classes in
text config and RT engine. Classes from RT engine override classes from
text config. 

To use it, add a line to your extconfig.conf:
musiconhold => mysql,asterisk

Every time MOH starts, search is perfomed first in RT engine, then in
memory (linked list of classes created from musiconhold.conf).

If MOH class is found in RT engine - separate structure is created in
memory. This structure is not added to linked list (mohclasses) and will be
destroyed as soon as MOH will stop.
====================================================================== 

---------------------------------------------------------------------- 
 putnopvut - 11-08-07 18:09  
---------------------------------------------------------------------- 
Tested with mode=files and also found no obvious faults.

I also tested with mode=custom (set to play mp3's using mpg123) and
mode=quietmp3. These modes had a problem when using realtime which did not
show itself when using static classes defined in musiconhold.conf.

When using static moh classes, subsequent calls would all attach to the
running mpg123 process; however, when using realtime, a new mpg123 process
was spawned each time a call was made. This meant that after only a few
calls (maybe 10), my computer was running noticeably slower than usual.
After investigating the source, this is because
ast_pthread_create_background is called every time moh is started if using
realtime. I think this could be avoided by checking whether
mohclass->thread is NULL, and only call ast_pthread_create_background if
this is the case.

I'll be testing more tomorrow in the attempt to find any other strange
edge cases that fail when using realtime moh. Thanks for the submission
though! I know there are many people who will be very happy once this is
merged. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-08-07 18:09  putnopvut      Note Added: 0073420                          
======================================================================




More information about the asterisk-bugs mailing list