Review Board 1.7.16


app_read does not break from prompt loop with empty string

Review Request #177 - Created Feb. 26, 2009 and submitted

David Vossel
/trunk
0014279
Reviewers
asterisk-dev
russell
Asterisk
ignore the last description parts of it were wrong.

When multiple ampersand-delimited prompts are passed to app_read, pressing # (without pressing other DTMF keys) merely cycles through the prompts until it reaches the last one. Then it will *finally* skip that prompt and return to the dialplan.  It would be nice if # returned to the dialplan immediately without cycling through the rest of the prompts.  

In app.c, ast_app_getdata is called to stream the prompts and receive DTMF input.  If ast_app_getdata() receives an empty string caused by the user inputing the end of string character, in this case '#', it should break from the prompt loop and return to app_read, but instead it cycles through all the prompts.  I've added a return value for this special case in ast_readstring().   

 
Review request changed
Updated (March 3, 2009, 5:20 a.m.)
Added enum to clarify return values. 
Ship it!
Posted (March 3, 2009, 7:59 a.m.)
Other than these last changes, it looks fine to me.
/trunk/include/asterisk/channel.h (Diff revision 2)
 
 
 
 
 
 
 
 
 
 
I would put this in app.h, so that it goes with the ast_app_getdata() API call.  Also, you should change the return type on ast_app_getdata() to be this enum.

For the comment you have in here, use /*! ... */.  That special formatting will let doxygen pick it up.
/trunk/main/app.c (Diff revision 2)
 
 
Change the return type on ast_readstring(), as well.

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.