Skip to content
Snippets Groups Projects
  • Frederic LE FOLL's avatar
    35e02d6f
    res_musiconhold.c: Restart MOH if previous hold just reached end-of-file · 35e02d6f
    Frederic LE FOLL authored
    On MOH activation, moh_files_readframe() is called while the current
    stream attached to the channel is NULL and it calls ast_moh_files_next()
    immediately.  However, it won't call ast_moh_files_next() again if sample
    reading fails.  The failure may occur because res_musiconhold retains the
    last sample reading position in the channel data and MOH during the
    previous hold/retrieve just reached EOF.  Obviously, a bit of bad luck is
    required here.
    
    * Restructured moh_files_readframe() to try a second time to start MOH if
    there was no stream setup and the saved position was at EOF.  Also added
    comments describing what is going on for each step.
    
    ASTERISK-28029
    
    Change-Id: I1508cf2c094f8feca22d6f76deaa9fdfa9944860
    35e02d6f
    History
    res_musiconhold.c: Restart MOH if previous hold just reached end-of-file
    Frederic LE FOLL authored
    On MOH activation, moh_files_readframe() is called while the current
    stream attached to the channel is NULL and it calls ast_moh_files_next()
    immediately.  However, it won't call ast_moh_files_next() again if sample
    reading fails.  The failure may occur because res_musiconhold retains the
    last sample reading position in the channel data and MOH during the
    previous hold/retrieve just reached EOF.  Obviously, a bit of bad luck is
    required here.
    
    * Restructured moh_files_readframe() to try a second time to start MOH if
    there was no stream setup and the saved position was at EOF.  Also added
    comments describing what is going on for each step.
    
    ASTERISK-28029
    
    Change-Id: I1508cf2c094f8feca22d6f76deaa9fdfa9944860