<p>Alexei Gradinari has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11387">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_readexten: new option 'p' to stop reading on '#' key<br><br>This patch adds the 'p' option.<br>The extension entered will be considered complete when a # is entered.<br><br>Change-Id: If77c40c9c8b525885730821e768f5dea71cf04c1<br>---<br>M apps/app_readexten.c<br>A doc/CHANGES-staging/app_readexten_pound.txt<br>2 files changed, 14 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/87/11387/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_readexten.c b/apps/app_readexten.c</span><br><span>index c8c9f48..1c9d982 100644</span><br><span>--- a/apps/app_readexten.c</span><br><span>+++ b/apps/app_readexten.c</span><br><span>@@ -63,6 +63,10 @@</span><br><span> <option name="n"></span><br><span> <para>Read digits even if the channel is not answered.</para></span><br><span> </option></span><br><span style="color: hsl(120, 100%, 40%);">+ <option name="p"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>The extension entered will be considered complete when a <literal>#</literal></span><br><span style="color: hsl(120, 100%, 40%);">+ is entered.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </option></span><br><span> </optionlist></span><br><span> </parameter></span><br><span> <parameter name="timeout"></span><br><span>@@ -100,12 +104,14 @@</span><br><span> OPT_SKIP = (1 << 0),</span><br><span> OPT_INDICATION = (1 << 1),</span><br><span> OPT_NOANSWER = (1 << 2),</span><br><span style="color: hsl(120, 100%, 40%);">+ POUND_TO_END_FLAG = (1 << 3),</span><br><span> };</span><br><span> </span><br><span> AST_APP_OPTIONS(readexten_app_options, {</span><br><span> AST_APP_OPTION('s', OPT_SKIP),</span><br><span> AST_APP_OPTION('i', OPT_INDICATION),</span><br><span> AST_APP_OPTION('n', OPT_NOANSWER),</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_APP_OPTION('p', POUND_TO_END_FLAG),</span><br><span> });</span><br><span> </span><br><span> static char *app = "ReadExten";</span><br><span>@@ -226,6 +232,11 @@</span><br><span> break;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_test_flag(&flags, POUND_TO_END_FLAG) && res == '#') {</span><br><span style="color: hsl(120, 100%, 40%);">+ exten[x] = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> exten[x] = res;</span><br><span> if (!ast_matchmore_extension(chan, arglist.context, exten, 1 /* priority */,</span><br><span> S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {</span><br><span>diff --git a/doc/CHANGES-staging/app_readexten_pound.txt b/doc/CHANGES-staging/app_readexten_pound.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..551f751</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_readexten_pound.txt</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: ReadExten</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Add 'p' option to stop reading extension if user presses '#' key.</span><br><span></span><br></pre><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: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>