Summary:ASTERISK-00994: [patch] Incorrect implementation of function ast_waitfordigit_full
Reporter:stefankroon (stefankroon)Labels:
Date Opened:2004-02-05 03:54:16.000-0600Date Closed:2004-09-25 02:51:28
Versions:Frequency of
Environment:Attachments:( 0) channel.c.diff
( 1) channel.c.udiff
Description:While looking at the implementation of the function ast_waitfordigit_full it seemed to be that it wasn't quite correct. 'Grep'-ing through the code shows that the functions isn't used anywhere except at the app_agi.
In the function the parameter ctrl (cmdfd) isn't used and the parameter audio (audiofd) isn't used for writing to a file.
Find attached the function that shows how I guess the function should look. I did not test it yet (I will do so starting now). I first wanted to have some feedback whether I was right.
Comments:By: stefankroon (stefankroon) 2004-02-05 08:59:41.000-0600

I submitted bug no 1000!!!! Do I get a cake now?

By: Brian West (bkw918) 2004-02-05 09:10:52.000-0600

Only if you submit the diff in -u format! :P

By: stefankroon (stefankroon) 2004-02-06 04:25:02.000-0600

I attached a new diff file: channel.c.udiff. It is generated by cvs, so you will need to delete the first few lines before you can use it. (hmmm, getting hungry already ;) )

By: Mark Spencer (markster) 2004-02-07 10:30:22.000-0600

I guess we have to watch both file descriptors right? It's been a while since I worked on this so i'm not sure.

By: stefankroon (stefankroon) 2004-02-09 03:07:24.000-0600

No, you shouldn't watch both file descriptors according to the description of the function in include/asterisk/channel.h:

/* Same as above with audio fd for outputing read audio and ctrlfd to monitor for reading. Returns 1 if ctrlfd becomes available */

The functions should the channel-file-descriptor and the ctrlfd (or cmdfd). The audioFd is used for writing frames that arives from the channel (recording to file). I think the function should be quite the same as the function ast_waitstream_full in file.c, except that there is no stream being played on the channel. See the file attached file: channel.c.udiff

By: Mark Spencer (markster) 2004-04-09 22:22:23

Need to have a cvs diff -u

By: Mark Spencer (markster) 2004-04-12 12:24:34

Fixed in CVS