]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Explicitly set args in park_call_exec NULL so in the case of no options being passed...
authorJeff Peeler <jpeeler@digium.com>
Mon, 6 Oct 2008 22:03:01 +0000 (22:03 +0000)
committerJeff Peeler <jpeeler@digium.com>
Mon, 6 Oct 2008 22:03:01 +0000 (22:03 +0000)
 is no garbage attempted to be used. Also, do not set args to unknown value again if there are
 no options passed in.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146875 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/features.c

index a3bc2d5c3da37b0c6c337c6bcd4ae2c9070e62b0..984e9610f9cd3f6d3f0a95c3089213c60cf29e7b 100644 (file)
@@ -2773,22 +2773,30 @@ static int park_call_exec(struct ast_channel *chan, void *data)
        if (!res) {
                struct ast_park_call_args args = {
                        .orig_chan_name = orig_chan_name,
+                       .extout = NULL,
+                       .return_con = NULL,
+                       .return_ext = NULL,
                };
                struct ast_flags flags = { 0 };
 
-               if (parse && !ast_strlen_zero(app_args.timeout)) {
-                       if (sscanf(app_args.timeout, "%d", &args.timeout) != 1) {
-                               ast_log(LOG_WARNING, "Invalid timeout '%s' provided\n", app_args.timeout);
-                               args.timeout = 0;
+               if (parse) {
+                       if (!ast_strlen_zero(app_args.timeout)) {
+                               if (sscanf(app_args.timeout, "%d", &args.timeout) != 1) {
+                                       ast_log(LOG_WARNING, "Invalid timeout '%s' provided\n", app_args.timeout);
+                                       args.timeout = 0;
+                               }
                        }
-               }
-
-               args.return_con = app_args.return_con;
-               args.return_ext = app_args.return_ext;
-               if (parse && !ast_strlen_zero(app_args.return_pri)) {
-                       if (sscanf(app_args.return_pri, "%d", &args.return_pri) != 1) {
-                               ast_log(LOG_WARNING, "Invalid priority '%s' specified\n", app_args.return_pri);
-                               args.return_pri = 0;
+                       if (!ast_strlen_zero(app_args.return_con)) {
+                               args.return_con = app_args.return_con;
+                       }
+                       if (!ast_strlen_zero(app_args.return_ext)) {
+                               args.return_ext = app_args.return_ext;
+                       }
+                       if (!ast_strlen_zero(app_args.return_pri)) {
+                               if (sscanf(app_args.return_pri, "%d", &args.return_pri) != 1) {
+                                       ast_log(LOG_WARNING, "Invalid priority '%s' specified\n", app_args.return_pri);
+                                       args.return_pri = 0;
+                               }
                        }
                }