]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_callcenter: Add error response for queue load and queue reload (FS-2988)
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 29 Jan 2011 08:09:06 +0000 (03:09 -0500)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 29 Jan 2011 08:09:06 +0000 (03:09 -0500)
src/mod/applications/mod_callcenter/mod_callcenter.c

index d1de632ee612b0a15a67ea11a3af7ddb271eddb8..61305bbbb5500794060f433b82f569874a4b0ff7 100644 (file)
@@ -2625,8 +2625,10 @@ SWITCH_STANDARD_API(cc_config_api_function)
                                cc_queue_t *queue = NULL;
                                if ((queue = get_queue(queue_name))) {
                                        queue_rwunlock(queue);
+                                       stream->write_function(stream, "%s", "+OK\n");
+                               } else {
+                                       stream->write_function(stream, "%s", "-ERR Invalid Queue not found!\n");
                                }
-                               stream->write_function(stream, "%s", "+OK\n");
                        }
                } else if (action && !strcasecmp(action, "unload")) {
                        if (argc-initial_argc < 1) {
@@ -2648,8 +2650,10 @@ SWITCH_STANDARD_API(cc_config_api_function)
                                destroy_queue(queue_name, SWITCH_FALSE);
                                if ((queue = get_queue(queue_name))) {
                                        queue_rwunlock(queue);
+                                       stream->write_function(stream, "%s", "+OK\n");
+                               } else {
+                                       stream->write_function(stream, "%s", "-ERR Invalid Queue not found!\n");
                                }
-                               stream->write_function(stream, "%s", "+OK\n");
                        }
                } else if (action && !strcasecmp(action, "list")) {
                        if (argc-initial_argc < 1) {
@@ -2671,7 +2675,6 @@ SWITCH_STANDARD_API(cc_config_api_function)
                                goto done;
                        } else {
                                const char *queue_name = argv[0 + initial_argc];
-
                                struct list_result cbt;
                                cbt.row_process = 0;
                                cbt.stream = stream;