[asterisk-bugs] [Asterisk 0014416]: [patch] streamed moh breaks if nobody listen it

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Mar 12 11:55:18 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14416 
====================================================================== 
Reported By:                caspy
Assigned To:                file
====================================================================== 
Project:                    Asterisk
Issue ID:                   14416
Category:                   Resources/res_musiconhold
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.0 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-02-06 02:37 CST
Last Modified:              2009-03-12 11:55 CDT
====================================================================== 
Summary:                    [patch] streamed moh breaks if nobody listen it
Description: 
If i have a moh class, which plays a network stream, and when no one
currently listening it, asterisk stops to receive data from player, 
then in a few minutes player stops reading network stream,
and then tcp connection dropeed from server side. Bad.

I did not find any player, which can always read network, even when no one
reads music from it.

I have looked what to patch, and decided, that asterisk's res_musiconhold
is the easiest way.

All we need, is to check for existence of 'listeners' not just before
reading music from player, but just after.
Look for code example in add.info.

With this patch, asterisk _always_ take music from player, and only then
decides what to do (waste away or play for somebody).

It's work fine in my production (1.6.0.3-rc1) for two month.

====================================================================== 

---------------------------------------------------------------------- 
 (0101668) svnbot (reporter) - 2009-03-12 11:55
 http://bugs.digium.com/view.php?id=14416#c101668 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 181663

_U  branches/1.6.1/
U   branches/1.6.1/res/res_musiconhold.c

------------------------------------------------------------------------
r181663 | file | 2009-03-12 11:55:17 -0500 (Thu, 12 Mar 2009) | 26 lines

Merged revisions 181661 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r181661 | file | 2009-03-12 13:53:52 -0300 (Thu, 12 Mar 2009) | 19 lines
  
  Merged revisions 181659-181660 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r181659 | file | 2009-03-12 13:50:37 -0300 (Thu, 12 Mar 2009) | 8
lines
    
    Fix another scenario where depending on configuration the stream would
not get read.
    
    For custom commands we don't know whether the audio is coming from a
stream or not
    so we are going to have to read the data despite no channels.
    
    (closes issue http://bugs.digium.com/view.php?id=14416)
    Reported by: caspy
  ........
    r181660 | file | 2009-03-12 13:52:45 -0300 (Thu, 12 Mar 2009) | 2
lines
    
    Fix logic flaw in previous commit.
  ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=181663 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-12 11:55 svnbot         Checkin                                      
2009-03-12 11:55 svnbot         Note Added: 0101668                          
======================================================================




More information about the asterisk-bugs mailing list