From 815d7bfe445cf172baf8bd3935c4fa0f305275ab Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Thu, 20 May 2010 22:23:32 +0000 Subject: [PATCH] Let ExtensionState resolve dynamic hints. (closes issue #16623) Reported by: tilghman Patches: 20100116__issue16623.diff.txt uploaded by tilghman (license 14) Tested by: lmadsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264779 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/pbx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main/pbx.c b/main/pbx.c index 60b2e949a8..8e5aa46865 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4195,6 +4195,17 @@ int ast_extension_state(struct ast_channel *c, const char *context, const char * return -1; /* No hint, return -1 */ } + if (e->exten[0] == '_') { + /* Create this hint on-the-fly */ + ast_add_extension(e->parent->name, 0, exten, e->priority, e->label, + e->matchcid ? e->cidmatch : NULL, e->app, ast_strdup(e->data), ast_free_ptr, + e->registrar); + if (!(e = ast_hint_extension(c, context, exten))) { + /* Improbable, but not impossible */ + return -1; + } + } + return ast_extension_state2(e); /* Check all devices in the hint */ }