[Home]

Summary:ASTERISK-13400: [patch] Pressing only # when app_read is playing multiple prompts does not act as expected
Reporter:Bradley Watkins (marquis)Labels:
Date Opened:2009-01-19 13:10:13.000-0600Date Closed:2009-03-03 17:39:26.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_read
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) fix_app_read.patch
( 1) read-ampersanmd.patch2
Description: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.
Comments:By: Bradley Watkins (marquis) 2009-01-19 13:14:01.000-0600

The attached patch is a proposed solution.  It doesn't include any (possible) changes to other calls of ast_readstring that may be required to avoid breakage.

If this way of going about it is ok, I'll create a new patch with all the other uses of it changed if necessary.

A cursory glance through the source seemed to me that many existing uses would not have to be altered, though some would.

By: Digium Subversion (svnbot) 2009-03-03 17:21:27.000-0600

Repository: asterisk
Revision: 180032

U   trunk/apps/app_read.c
U   trunk/include/asterisk/app.h
U   trunk/main/app.c
U   trunk/main/channel.c

------------------------------------------------------------------------
r180032 | dvossel | 2009-03-03 17:21:27 -0600 (Tue, 03 Mar 2009) | 14 lines

app_read does not break from prompt loop with user terminated empty string

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() which uses an enum I've delcared in apps.h.  This enum is now used as a return value for ast_app_getdata().

(closes issue ASTERISK-13400)
Reported by: Marquis
Patches:
fix_app_read.patch uploaded by Marquis (license 32)
read-ampersanmd.patch2 uploaded by dvossel (license 671)
Tested by: Marquis, dvossel
Review: http://reviewboard.digium.com/r/177/



------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=180032

By: Digium Subversion (svnbot) 2009-03-03 17:35:19.000-0600

Repository: asterisk
Revision: 180078

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_read.c
U   branches/1.6.0/include/asterisk/app.h
U   branches/1.6.0/main/app.c
U   branches/1.6.0/main/channel.c

------------------------------------------------------------------------
r180078 | dvossel | 2009-03-03 17:35:18 -0600 (Tue, 03 Mar 2009) | 19 lines

Merged revisions 180032 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r180032 | dvossel | 2009-03-03 17:21:18 -0600 (Tue, 03 Mar 2009) | 14 lines
 
 app_read does not break from prompt loop with user terminated empty string
 
 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() which uses an enum I've delcared in apps.h.  This enum is now used as a return value for ast_app_getdata().
 
 (closes issue ASTERISK-13400)
 Reported by: Marquis
 Patches:
  fix_app_read.patch uploaded by Marquis (license 32)
  read-ampersanmd.patch2 uploaded by dvossel (license 671)
 Tested by: Marquis, dvossel
 Review: http://reviewboard.digium.com/r/177/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=180078

By: Digium Subversion (svnbot) 2009-03-03 17:39:26.000-0600

Repository: asterisk
Revision: 180080

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_read.c
U   branches/1.6.1/include/asterisk/app.h
U   branches/1.6.1/main/app.c
U   branches/1.6.1/main/channel.c

------------------------------------------------------------------------
r180080 | dvossel | 2009-03-03 17:39:26 -0600 (Tue, 03 Mar 2009) | 19 lines

Merged revisions 180032 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r180032 | dvossel | 2009-03-03 17:21:18 -0600 (Tue, 03 Mar 2009) | 14 lines
 
 app_read does not break from prompt loop with user terminated empty string
 
 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() which uses an enum I've delcared in apps.h.  This enum is now used as a return value for ast_app_getdata().
 
 (closes issue ASTERISK-13400)
 Reported by: Marquis
 Patches:
  fix_app_read.patch uploaded by Marquis (license 32)
  read-ampersanmd.patch2 uploaded by dvossel (license 671)
 Tested by: Marquis, dvossel
 Review: http://reviewboard.digium.com/r/177/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=180080