[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
Thu Aug 27 22:02:56 CDT 2009
The following issue has been ASSIGNED.
======================================================================
https://issues.asterisk.org/view.php?id=15188
======================================================================
Reported By: jcovert
Assigned To: dbrooks
======================================================================
Project: Asterisk
Issue ID: 15188
Category: Applications/app_readexten
Reproducibility: always
Severity: major
Priority: normal
Status: assigned
Target Version: 1.6.0.x Pending Blocker
Asterisk Version: 1.6.0.9
Regression: No
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
======================================================================
Date Submitted: 2009-05-23 14:07 CDT
Last Modified: 2009-08-27 22:02 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
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2009-08-27 22:02 russell Status new => assigned
2009-08-27 22:02 russell Assigned To => dbrooks
======================================================================
More information about the asterisk-bugs
mailing list