From a109b5aee02088099b7a12a514cb0d9c395360d1 Mon Sep 17 00:00:00 2001
From: Sean Bright <sean.bright@gmail.com>
Date: Mon, 8 Nov 2021 10:01:09 -0500
Subject: [PATCH] pbx.c: Don't remove dashes from hints on reload.

When reloading dialplan, hints created dynamically would lose any dash
characters. Now we ignore those dashes if we are dealing with a hint
during a reload.

ASTERISK-28040 #close

Change-Id: I95e48f5a268efa3c6840ab69798525d3dce91636
---
 main/pbx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/main/pbx.c b/main/pbx.c
index d0ee127389..0cae9b83f8 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -7380,7 +7380,14 @@ static int ast_add_extension2_lockopt(struct ast_context *con,
 		}
 	}
 
-	exten_fluff = ext_fluff_count(extension);
+	if (priority == PRIORITY_HINT) {
+		/* Fluff in a hint is fine. This prevents the removal of dashes from dynamically
+		 * created hints during a reload. */
+		exten_fluff = 0;
+	} else {
+		exten_fluff = ext_fluff_count(extension);
+	}
+
 	callerid_fluff = callerid ? ext_fluff_count(callerid) : 0;
 
 	length = sizeof(struct ast_exten);
-- 
GitLab