aboutsummaryrefslogtreecommitdiffstats
path: root/main/pbx.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-20 22:23:32 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-20 22:23:32 +0000
commit81774113038d1ab329dc16365ff75ba69be40bcb (patch)
tree44a5ec29cf619c0742080b64ae03dfc0126a0187 /main/pbx.c
parenta88b4d6e3f529937a140c00918709bc04e3001c1 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@264779 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 60b2e949a..8e5aa4686 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 */
}