[asterisk-dev] Empty recordings with length of 4 seconds

Marcus Hunger hunger at sipgate.de
Mon Apr 10 10:16:36 MST 2006


Recently I found some voicemail-recordings in my voicebox, that claimed to be 
4 seconds long, but the .wav-files were almost empty (a wave-header was 
there). I traced the problem to app.c, which threw a warning "Apr 7 18:19:12 
WARNING[30378] app.c: No audio available on SIP/*********" followed by "user 
hungup".
 
ast_play_and_record() returns the duration of these failed recordings which is 
4 seconds. 
 
these 4 seconds come from the following code:
 
 res = ast_waitfor(chan, 2000);
 if (!res) {
    ast_log(LOG_DEBUG, "One waitfor failed, trying another\n");
    /* Try one more time in case of masq */
    res = ast_waitfor(chan, 2000);
    if (!res) {
       ast_log(LOG_WARNING, "No audio available on %s??\n", chan->name);
       res = -1;
    }
 }
 
so the check for audio-availability lasts 4 seconds and then the function 
returns as if the user has hungup normally.
 
I created a patch so that ast_play_and_record() decreases the recording's 
duration by 4 seconds.

For the patch and the start of the discussion, look here:
http://bugs.digium.com/view.php?id=6911

The "No audio"-condition is different from silence and means that asterisk 
didn't receive audio-data for a specific amount of time, right?

ast_play_and_prepend suffers from the same problem and should be handle the 
same way.

Marcus



More information about the asterisk-dev mailing list