[Asterisk-code-review] app_readexten: new option 'p' to stop reading on '#' key (...asterisk[16])

Joshua Colp asteriskteam at digium.com
Wed May 22 08:36:44 CDT 2019


Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/11387 )

Change subject: app_readexten: new option 'p' to stop reading on '#' key
......................................................................


Patch Set 2: Code-Review-1

I don't believe this is needed either as the app_readexten module appears to already have this functionality hardcoded in:

                        if (!ast_matchmore_extension(chan, arglist.context, exten, 1 /* priority */,
                                S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
                                if (!ast_exists_extension(chan, arglist.context, exten, 1,
                                        S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))
                                        && res == '#') {
                                        exten[x] = '\0';
                                }
                                break;
                        }

If the extension can't match any more, and the extension doesn't exist, and the last digit pressed was '#' then remove the '#' digit from the extension and stop accepting digits. The subsequent code then does the extension check again and sets things accordingly.


-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11387
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: If77c40c9c8b525885730821e768f5dea71cf04c1
Gerrit-Change-Number: 11387
Gerrit-PatchSet: 2
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Comment-Date: Wed, 22 May 2019 13:36:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190522/6621ffdf/attachment-0001.html>


More information about the asterisk-code-review mailing list