include "logger.h" and errno.h from asterisk.h - usage shows that they
[asterisk/asterisk.git] / res / res_agi.c
index 293d54b..d8df079 100644 (file)
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
-#include <sys/types.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
 #include <math.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
 #include <signal.h>
 #include <sys/time.h>
-#include <stdio.h>
 #include <fcntl.h>
-#include <errno.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
 
+#include "asterisk/network.h"
 #include "asterisk/file.h"
-#include "asterisk/logger.h"
 #include "asterisk/channel.h"
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/astdb.h"
 #include "asterisk/callerid.h"
 #include "asterisk/cli.h"
-#include "asterisk/logger.h"
 #include "asterisk/options.h"
 #include "asterisk/image.h"
 #include "asterisk/say.h"
@@ -1701,14 +1688,14 @@ int ast_agi_unregister(struct ast_module *mod, agi_command *cmd)
        AST_RWLIST_WRLOCK(&agi_commands);
        AST_RWLIST_TRAVERSE_SAFE_BEGIN(&agi_commands, e, list) {
                if (cmd == e) {
-                       AST_RWLIST_REMOVE_CURRENT(&agi_commands, list);
+                       AST_RWLIST_REMOVE_CURRENT(list);
                        if (mod != ast_module_info->self)
                                ast_module_unref(ast_module_info->self);
                        unregistered=1;
                        break;
                }
        }
-       AST_RWLIST_TRAVERSE_SAFE_END
+       AST_RWLIST_TRAVERSE_SAFE_END;
        AST_RWLIST_UNLOCK(&agi_commands);
        if (unregistered)
                ast_verb(2, "AGI Command '%s' unregistered\n",fullcmd);