Check for already registered manager command. Bug #836
authorJeremy McNamara <jj@nufone.net>
Wed, 14 Jan 2004 06:31:18 +0000 (06:31 +0000)
committerJeremy McNamara <jj@nufone.net>
Wed, 14 Jan 2004 06:31:18 +0000 (06:31 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2029 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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;
        }