[asterisk-bugs] [Asterisk 0015188]: [patch] ReadExten returns TIMEOUT in cases where it should return OK or INVALID

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Aug 11 10:20:29 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15188 
====================================================================== 
Reported By:                jcovert
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   15188
Category:                   Applications/app_readexten
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Target Version:             1.6.2.12
Asterisk Version:           SVN 
JIRA:                       SWP-1809 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-05-23 14:07 CDT
Last Modified:              2010-08-11 10:20 CDT
====================================================================== 
Summary:                    [patch] ReadExten returns TIMEOUT in cases where it
should return OK or INVALID
Description: 
The documentation for ReadExten states:

TIMEOUT   No extension was entered in the specified time

but ReadExten is returning TIMEOUT also in the case of a partial (INVALID)
extension or a completed (OK) variable length extension.

The behaviour of asterisk dialplan processing has always been that
"timeout" (i.e. continuation at the "t" extension) would only occur if "no
extension" (i.e. nothing, not any digits, not even an invalid extension)
was entered.  A "TIMEOUT" was always nothing entered in the Response
Timeout. Once a single digit was entered, and processing switched to the
Digit Timeout, the result could only be "INVALID" (continuation at the "i"
extension) or "OK" continuation at an actual extension.

ReadExten is not doing this correctly.  Consider use of ReadExten
specifying a context containing ONLY the following two extensions:

exten => 12,1,Noop()

exten => 345.,1,Noop()

The expected asterisk behaviour is that (1) entering just a "1" and
waiting for a timeout would end up at the "i" extension.  Similarly, (2)
entering 345 would also end up at the "i" extension, but (3) entering
"3456" would be processed.

ReadExten returns "TIMEOUT" in all three cases, and the digits entered are
lost.

The attached patch corrects this behaviour.  Cases (1) and (2) will return
"INVALID" with the digits dialled returned in ${INVALID_EXTEN} and case (3)
will return "OK" with the result in the return argument variable.

The patch also includes my suggestion concerning allowing tonelists, issue
https://issues.asterisk.org/view.php?id=15185.

It also allows a "#" as the FIRST character of an extension (if the
dialplan contains such an extension, frequently used for #xx feature
codes).  Entry of a "#" when the dialplan does not contain such an
extension is processed as an INVALID (with the "#" returned in
INVALID_EXTEN).

Regards/john
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0015185 [patch] Patch to allow tone-list as arg...
====================================================================== 

---------------------------------------------------------------------- 
 (0125823) svnbot (reporter) - 2010-08-11 10:20
 https://issues.asterisk.org/view.php?id=15188#c125823 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 281726

_U  trunk/
U   trunk/apps/app_readexten.c

------------------------------------------------------------------------
r281726 | tilghman | 2010-08-11 10:20:28 -0500 (Wed, 11 Aug 2010) | 21
lines

Merged revisions 281723 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r281723 | tilghman | 2010-08-11 10:18:40 -0500 (Wed, 11 Aug 2010) | 14
lines
  
  Merged revisions 281722 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r281722 | tilghman | 2010-08-11 10:17:20 -0500 (Wed, 11 Aug 2010) | 7
lines
    
    Only set status TIMEOUT, if we have no digits.
    
    (closes issue https://issues.asterisk.org/view.php?id=15188)
     Reported by: jcovert
     Patches: 
           app_readexten.c.patch-1.6.2.8-rc1 uploaded by jcovert (license
551)
  ........
................

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-08-11 10:20 svnbot         Checkin                                      
2010-08-11 10:20 svnbot         Note Added: 0125823                          
======================================================================




More information about the asterisk-bugs mailing list