diff options
author | Olle Johansson <oej@edvina.net> | 2011-10-04 09:43:03 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2011-10-04 09:43:03 +0000 |
commit | eeefca7f91e8674a6d9f2091d09096402b0ba7ad (patch) | |
tree | c30077455266319b18b8060148831f420a0f0f23 | |
parent | 34bf1527e818078b19bf9dcc533ea68cb6288170 (diff) |
Generate error message when AMI action originate extension doesn't exist
Review: https://reviewboard.asterisk.org/r/1445/
Is this a bug or a new feature? No responses on Asterisk-dev so I'm
committing to trunk only.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@339206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | main/manager.c | 10 |
2 files changed, 14 insertions, 0 deletions
@@ -40,6 +40,10 @@ CDR postgresql driver changes ----------------------------- * Added command "cdr show pgsql status" to check connection status +AMI (Asterisk Manager Interface) changes +---------------------------------------- + * Originate now generates an error response if the extension given + is not found in the dialplan ------------------------------------------------------------------------------ --- Functionality changes from Asterisk 1.8 to Asterisk 10 ------------------- diff --git a/main/manager.c b/main/manager.c index 5320b3f52..af03e25e5 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3997,6 +3997,16 @@ static int action_originate(struct mansession *s, const struct message *m) } } + /* Check early if the extension exists. If not, we need to bail out here. */ + if (exten && context && pi) { + if (! ast_exists_extension(NULL, context, exten, pi, l)) { + /* The extension does not exist. */ + astman_send_error(s, m, "Extension does not exist."); + res = 0; + goto fast_orig_cleanup; + } + } + /* Allocate requested channel variables */ vars = astman_get_variables(m); |