diff --git a/CHANGES b/CHANGES index bcc4beff1199231aa14713da5346e3be28e6b40e..3f7315ea8ae10a46e33a51910966668bf34724da 100644 --- a/CHANGES +++ b/CHANGES @@ -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 5320b3f5244e1d216d38ed00b2a79f9be757d783..af03e25e59e94e6095d93b66bdc17e5e027e5443 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);