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

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Nov 9 10:22:39 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-09-2007 10:22 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-09-07 10:22  
---------------------------------------------------------------------- 
sergee:

I think you're on the right track, but even if you want to enable true
realtime for each user, I think it could be done better.

For instance, the way it's implemented now, if I were to call into a queue
and wait through several different cycles of trying to reach queue members
(with periodic announcements played in between), this would mean spawning
mpg123 processes each time music on hold restarts (plus this also means
that I always hear the same snippet of the first file in my playlist every
time). Furthermore, once I hang up, none of the spawned mpg123 processes
are killed, so multiple calls can add up quickly.

My suggestion is to do the following. When a channel requests for Asterisk
to start music on hold, do the realtime lookup and spawn the new mpg123 (or
whatever application is used) process and associate that process with the
channel that started it. If that same channel requests to start music on
hold again, then reattach to the process that that channel initially
spawned. Then, once that channel is hung up, kill the process. By doing
this, you'll have true realtime on per-call basis without having a bunch of
extra processes that aren't used.

Even if you choose not to do what I suggest above, I still think you
should kill the process on hangup just so they don't build up and cause
huge slowdown. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-09-07 10:22  putnopvut      Note Added: 0073438                          
======================================================================




More information about the asterisk-bugs mailing list