Check for already registered manager command. Bug #836
[asterisk/asterisk.git] / manager.c
index 73b58d1..c687dd8 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -820,6 +820,11 @@ int ast_manager_register( char *action, int auth,
 
        ast_mutex_lock(&actionlock);
        while(cur) { /* Walk the list of actions */
+               if (!strcasecmp(cur->action, action)) {
+                       ast_log(LOG_WARNING, "Manager: Action '%s' already registered\n", action);
+                       ast_mutex_unlock(&actionlock);
+                       return -1;
+               }
                prev = cur; 
                cur = cur->next;
        }