diff options
author | Olle Johansson <oej@edvina.net> | 2011-09-21 09:39:13 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2011-09-21 09:39:13 +0000 |
commit | 7b08b2cf53393b26050320dcdfee6edbecae94f7 (patch) | |
tree | 683bc2961ac368ffb691e9edac11364b54b4c788 /main | |
parent | 2ae7ae00c804936dbc5c8b391398dc0a2933ce4e (diff) |
Merged revisions 337219 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10
........
r337219 | oej | 2011-09-21 11:32:50 +0200 (Ons, 21 Sep 2011) | 13 lines
Make ast_pbx_run() not default to s@default if extension is not found
Review: https://reviewboard.asterisk.org/r/1446/
This is a bug - or architecture mistake - that has been in Asterisk for a
very long time. It was exposed by the AMI originate action and possibly
some other applications. Most channel drivers checks if an extension
exists BEFORE starting a pbx on an inbound call, so most calls will
not depend on this issue.
Thanks everyone involved in the review and on IRC and the mailing list
for a quick review and all the feedback.
(closes issue ASTERISK-18578)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/pbx.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/main/pbx.c b/main/pbx.c index d790f0656..7e6e8a122 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4977,23 +4977,16 @@ static enum ast_pbx_result __ast_pbx_run(struct ast_channel *c, autoloopflag = ast_test_flag(c, AST_FLAG_IN_AUTOLOOP); /* save value to restore at the end */ ast_set_flag(c, AST_FLAG_IN_AUTOLOOP); - /* Start by trying whatever the channel is set to */ - if (!ast_exists_extension(c, c->context, c->exten, c->priority, - S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { - /* If not successful fall back to 's' */ + if (ast_strlen_zero(c->exten)) { + /* If not successful fall back to 's' - but only if there is no given exten */ ast_verb(2, "Starting %s at %s,%s,%d failed so falling back to exten 's'\n", c->name, c->context, c->exten, c->priority); /* XXX the original code used the existing priority in the call to * ast_exists_extension(), and reset it to 1 afterwards. * I believe the correct thing is to set it to 1 immediately. - */ + */ set_ext_pri(c, "s", 1); - if (!ast_exists_extension(c, c->context, c->exten, c->priority, - S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { - /* JK02: And finally back to default if everything else failed */ - ast_verb(2, "Starting %s at %s,%s,%d still failed so falling back to context 'default'\n", c->name, c->context, c->exten, c->priority); - ast_copy_string(c->context, "default", sizeof(c->context)); - } } + if (c->cdr) { /* allow CDR variables that have been collected after channel was created to be visible during call */ ast_cdr_update(c); |