[asterisk-dev] Read() app and multi-prompt wackiness

Watkins, Bradley Bradley.Watkins at compuware.com
Thu Dec 4 19:31:35 CST 2008


There appears to be a bug in app_read when you pass multiple voice
prompts for it to play in sequence (i.e. Read(VARIABLE,
prompt1&prompt2&prompt3&etc) ).

In essence, if you hit '#' without entering any digits, it doesn't exit
immediately as it does when you only ask it to play one prompt.  What it
does is skips the rest of the currently playing prompt and then starts
playing the next one in sequence.

Anyway, the point is not to complain about the bug but to ask for some
assistance in the proper way of fixing it.

The current way that I've gone about it is to change ast_readstring_full
to return the character that ended collection of digits if no other
digits were collected, and then check for this in ast_app_getdata so
that I can break out of the loop that is iterating through the
ampersand-delimited filenames argument.

The primary downside to this tact is that it requires changes to all
other uses of ast_readstring (which calls ast_readstring_full) to be
aware of the case.  It's not a huge deal, but it touches a fair few
files along the way.

So the question I have is should this be done a different/better way?

Thanks in advance,
- Brad



More information about the asterisk-dev mailing list