Summary:ASTERISK-10549: Implement READSTATUS
Reporter:Michael FIG (michael-fig)Labels:
Date Opened:2007-10-16 14:53:37Date Closed:2007-11-21 12:35:57.000-0600
Versions:Frequency of
Environment:Attachments:( 0) asterisk-1.4.13-READSTATUS.diff
( 1) asterisk-86033-READSTATUS.diff
Description:The attached patch uses jsmith's suggestion in ASTERISK-1092989 to implement a READSTATUS channel variable when digits are read.


Here is an example usage (taken from Corydon76), to implement an interruptible menu with arbitrary logic:

exten => 100,n,ExecIf($["${READSTATUS}" = "TIMEOUT"],Read,VAR,my-message2,1,,,0.001)
exten => 100,n,ExecIf($["${READSTATUS}" = "TIMEOUT"],Read,VAR,my-message3,1,,,86400)
exten => 100,n,GotoIf($["${VAR}" = ""]?PoundKeyPressed)

Other READSTATUS values are: ERROR, INTERRUPTED (when the command stream has traffic on it), and OK.
Comments:By: Jason Parker (jparker) 2007-10-16 17:07:18

This would be best implemented in app_read.c

We don't really want to change the READSTATUS variable every time those functions are called.

By: Michael FIG (michael-fig) 2007-10-16 20:41:41

As you wish.  Attached are two patches... one for SVN trunk, and one for 1.4.13 (in case some user wants the feature there).

By: Michael FIG (michael-fig) 2007-10-16 20:48:26

Oops... that needs a trivial documentation fix in both patches: "ERRROR" in the help text should be "ERROR".

By: Jason Parker (jparker) 2007-10-17 11:23:18

I think the asterisk-85943-READSTATUS.diff was mistakenly deleted.

Could you please reupload it?

By: Michael FIG (michael-fig) 2007-10-17 17:01:15

I've reuploaded asterisk-86033-READSTATUS.diff, which supercedes 85943.

By: Tilghman Lesher (tilghman) 2007-11-19 15:40:18.000-0600

Is there a reason you're checking the channel for zombie status near the end?

By: Michael FIG (michael-fig) 2007-11-21 11:51:08.000-0600

Superstition.  I'm not sure what it does, exactly.

By: Digium Subversion (svnbot) 2007-11-21 12:35:57.000-0600

Repository: asterisk
Revision: 89489

U   trunk/CHANGES
U   trunk/UPGRADE.txt
U   trunk/apps/app_read.c

r89489 | tilghman | 2007-11-21 12:35:56 -0600 (Wed, 21 Nov 2007) | 6 lines

Change Read to set READSTATUS as an indication of the result
Also, some cleanup to CHANGES.
Reported by: michael-fig
Patch by: michael-fig,tilghman
(Closes issue ASTERISK-10549)