Summary:ASTERISK-13885: ast_read() used with incorrect ast_waitfor() in app_fax.c
Reporter:caspy (caspy)Labels:
Date Opened:2009-04-02 11:36:33Date Closed:2009-04-03 16:44:53
Versions:Frequency of
Description:in in main/channel.c some changes are made to check for correct usage of ast_waitfor() before each ast_read().

in my case, as soon as i start ReceiveFAX() application from dialplan, messages like this begin to flood log:
ERROR[14159] channel.c: ast_read() called with no recorded file descriptor.

looking into transmit_audio() (and transmit_t38() too) of apps/app_fax.c we can see this:
       while (!s->finished) {
               res = ast_waitfor(s->chan, 20);
               if (res < 0)
               else if (res > 0)
                       res = 0;

               inf = ast_read(s->chan);

if i understand correctly, ast_waitfor() returns zero, when the is nothing to read. but in provided code we can see that reading is still beeing done.

am i right?
Comments:By: Andrew Lindh (andrew) 2009-04-02 18:35:25

Please see bug id ASTERISK-13846

By: snuffy (snuffy) 2009-04-03 06:40:57

caspy, can you check if the patch in bug mentioned by andrew fixes your issue?

By: caspy (caspy) 2009-04-03 06:55:21

apply all fixes from that patch, or only lines about parsing result from ast_waitfor()?

By: caspy (caspy) 2009-04-03 09:04:31

patch from 0014769 resolves this issue.

By: snuffy (snuffy) 2009-04-03 16:44:53

Reporter used fix in another bug.. worked correctly