<p style="white-space: pre-wrap; word-wrap: break-word;">I don't believe this is needed either as the app_readexten module appears to already have this functionality hardcoded in:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">                        if (!ast_matchmore_extension(chan, arglist.context, exten, 1 /* priority */,<br>                                S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {<br>                                if (!ast_exists_extension(chan, arglist.context, exten, 1,<br>                                        S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))<br>                                        && res == '#') {<br>                                        exten[x] = '\0';<br>                                }<br>                                break;<br>                        }</pre><p style="white-space: pre-wrap; word-wrap: break-word;">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.</p><p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11387">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11387">change 11387</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/11387"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: If77c40c9c8b525885730821e768f5dea71cf04c1 </div>
<div style="display:none"> Gerrit-Change-Number: 11387 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 22 May 2019 13:36:44 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>