[asterisk-dev] new app read option

Matthew Jordan mjordan at digium.com
Wed Jun 12 06:43:47 CDT 2013


On Mon, Jun 10, 2013 at 7:17 PM, <Bbarron at guesswho.com> wrote:

> We have the need to allow a * to exit the read application in addition to
> the # key.  This will have a different meaning than the # key.  I propose
> adding a ‘c’ option to app_read that if passed as an option will then set
> the READSTATUS to CANCELLED if the * key is pressed.  Variable will store
> the data entered up till the * key pressed.****
>
> ** **
>
> This is my first proposed change to the asterisk source, so I am looking
> for some input is this is a valid feature or if it’s too specific a feature
> request.****
>
>
Whenever you're thinking of writing a new feature, you should ask yourself:
is this feature specific to my application needs, or is it useful for a lot
of business needs?

Consider a few points:
(1) What if I wanted the Read application to terminate whenever someone hit
'0' as opposed to '*' or '#'?
(2) What if the semantics of the user pressing '*' meant that they should
be directed to an automated attendant extension, as opposed to cancelling a
transaction?
(3) If you have multiple digits that exit the application - beyond just *
and # - do you want the READSTATUS channel variable to convey which digit
was pressed? How do you map the status values back to digits?

I'd approach the problem a bit differently.

(1) Provide a configuration variable that allows any number of digits to be
specified as terminating digits. Syntax can be c(digits).
(2) If any of those digits are pressed, the READSTATUS is set to OK
(3) If any of those digits are pressed, the READESCAPED channel variable is
set to the ending digit that is pressed

This way, the Read application continues to adhere to its purpose: reading
DTMF. Logic about what to do with that DTMF is deferred to the dialplan.
Addition of the READESCAPED channel variable conveys what key was pressed
to end the read sequence, allowing a dialplan writer to switch on that
logic.

Matt

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130612/1188311f/attachment.htm>


More information about the asterisk-dev mailing list