]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Corrected some module issues introduced by r383579.
authorDavid M. Lee <dlee@digium.com>
Fri, 22 Mar 2013 19:26:37 +0000 (19:26 +0000)
committerDavid M. Lee <dlee@digium.com>
Fri, 22 Mar 2013 19:26:37 +0000 (19:26 +0000)
When I moved res_json.c to json.c, I left the MODULE_INFO stuff in there,
which was interesting if you ran module show. I also forgot to call what
was in module_load() from asterisk main().

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

include/asterisk/json.h
main/asterisk.c
main/json.c

index d287bd61238a947bbf2b4f2980c88967966d7a12..d8cf98ece11b62a7e17fdc832056feded6a2cae4 100644 (file)
 
 /*!@{*/
 
+/*!
+ * \brief Initialize the JSON library.
+ */
+void ast_json_init(void);
+
 /*!
  * \brief Set custom allocators instead of the standard ast_malloc() and ast_free().
  * \since 12.0.0
index 3a0e87c4125e202215d88fa4d1fd1d5d7dc9b971..d7eb8d9534aaedfad24fc28918a3066c7260700e 100644 (file)
@@ -241,6 +241,7 @@ int daemon(int, int);  /* defined in libresolv of all places */
 #include "asterisk/uuid.h"
 #include "asterisk/sorcery.h"
 #include "asterisk/stasis.h"
+#include "asterisk/json.h"
 
 #include "../defaults.h"
 
@@ -4070,6 +4071,7 @@ int main(int argc, char *argv[])
                        ast_el_read_history(filename);
        }
 
+       ast_json_init();
        ast_ulaw_init();
        ast_alaw_init();
        tdd_init();
index f1ebaef60c2db07f3ce89c3923b18332f2e9be8d..b91707a8a608129f9e537c5f58edc150861c2662 100644 (file)
@@ -502,19 +502,8 @@ struct ast_json *ast_json_deep_copy(const struct ast_json *value)
        return (struct ast_json *)json_deep_copy((json_t *)value);
 }
 
-static int unload_module(void)
-{
-       /* Nothing to do */
-       return 0;
-}
-
-static int load_module(void)
+void ast_json_init(void)
 {
        /* Setup to use Asterisk custom allocators */
        ast_json_reset_alloc_funcs();
-       return AST_MODULE_LOAD_SUCCESS;
 }
-
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "JSON library",
-               .load = load_module,
-               .unload = unload_module);