[Asterisk-code-review] app_readexten: new option 'p' to stop reading on '#' key (...asterisk[16])
Alexei Gradinari
asteriskteam at digium.com
Wed May 22 09:39:19 CDT 2019
Alexei Gradinari 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:
> 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.
You are wrong. You can test it by yourself.
exten => 100,1,Playback(hello-world)
exten => 1001,1,Playback(tt-monkeys)
exten => _011[2-9]XXXX.,1,Playback(tt-monkeys)
core set debug 4 app_readexten.so
Enter 01122222222#, then you can repeat '#'
readexten_exec: extension so far: '', timeout: 5000
readexten_exec: extension so far: '0', timeout: 5000
readexten_exec: extension so far: '01', timeout: 5000
readexten_exec: extension so far: '011', timeout: 5000
readexten_exec: extension so far: '0112', timeout: 5000
readexten_exec: extension so far: '01122', timeout: 5000
readexten_exec: extension so far: '011222', timeout: 5000
readexten_exec: extension so far: '0112222', timeout: 5000
readexten_exec: extension so far: '01122222', timeout: 5000
readexten_exec: extension so far: '011222222', timeout: 5000
readexten_exec: extension so far: '0112222222', timeout: 5000
readexten_exec: extension so far: '01122222222', timeout: 5000
readexten_exec: extension so far: '01122222222#', timeout: 5000
readexten_exec: extension so far: '01122222222##', timeout: 5000
readexten_exec: extension so far: '01122222222###', timeout: 5000
readexten_exec: extension so far: '01122222222####', timeout: 5000
readexten_exec: extension so far: '01122222222#####', timeout: 5000
readexten_exec: extension so far: '01122222222######', timeout: 5000
readexten_exec: extension so far: '01122222222#######', timeout: 5000
readexten_exec: extension so far: '01122222222########', timeout: 5000
When you enter 01122222222#
ast_matchmore_extension returns -1 and ast_exists_extension returns -1
--
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 14:39:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190522/6f0da693/attachment-0001.html>
More information about the asterisk-code-review
mailing list