From: Tilghman Lesher Date: Thu, 20 May 2010 22:24:16 +0000 (+0000) Subject: Merged revisions 264779 via svnmerge from X-Git-Tag: 1.6.2.9-rc1~2^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a09588ab45cd7b2146b1c2a0a63b739686f5a69f;p=thirdparty%2Fasterisk.git Merged revisions 264779 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r264779 | tilghman | 2010-05-20 17:23:32 -0500 (Thu, 20 May 2010) | 8 lines 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/branches/1.6.2@264783 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index f454fdbd3e..682a17ee80 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -3837,6 +3837,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 */ }