Verify the right vars are passed to manager originate (bug 1185)
authorJames Golovich <james@gnuinter.net>
Tue, 9 Mar 2004 20:01:46 +0000 (20:01 +0000)
committerJames Golovich <james@gnuinter.net>
Tue, 9 Mar 2004 20:01:46 +0000 (20:01 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2379 65c4cc65-6c06-0410-ace0-fbb531ad65f3

manager.c

index dba09d2..cbd641c 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -522,7 +522,12 @@ static int action_originate(struct mansession *s, struct message *m)
        if (strlen(app)) {
                res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 0, strlen(callerid) ? callerid : NULL, variable, account);
        } else {
        if (strlen(app)) {
                res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 0, strlen(callerid) ? callerid : NULL, variable, account);
        } else {
-               res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, variable, account);
+               if (exten && context && pi)
+                       res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, variable, account);
+               else {
+                       astman_send_error(s, m, "Originate with 'Exten' requires 'Context' and 'Priority'");
+                       return 0;
+               }
        }   
        if (!res)
                astman_send_ack(s, m, "Originate successfully queued");
        }   
        if (!res)
                astman_send_ack(s, m, "Originate successfully queued");