From b323c972b6759466b98a36fc64fd50bc957c1a12 Mon Sep 17 00:00:00 2001
From: Tilghman Lesher <tilghman@meg.abyt.es>
Date: Sat, 29 Nov 2008 18:33:18 +0000
Subject: [PATCH] Allow the '#' sign to exist within an extension (inspired by
 issue #13330)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_readexten.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/apps/app_readexten.c b/apps/app_readexten.c
index 9a54094ea2..b556391555 100644
--- a/apps/app_readexten.c
+++ b/apps/app_readexten.c
@@ -224,12 +224,13 @@ static int readexten_exec(struct ast_channel *chan, void *data)
 					status = "TIMEOUT";
 				}
 				break;
-			} else if (res == '#') {
-				break;
 			}
 
 			exten[x] = res;
 			if (!ast_matchmore_extension(chan, arglist.context, exten, 1 /* priority */, chan->cid.cid_num)) {
+				if (!ast_exists_extension(chan, arglist.context, exten, 1, chan->cid.cid_num) && res == '#') {
+					exten[x] = '\0';
+				}
 				break;
 			}
 		}
-- 
GitLab