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
/*!@{*/
+/*!
+ * \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
#include "asterisk/uuid.h"
#include "asterisk/sorcery.h"
#include "asterisk/stasis.h"
+#include "asterisk/json.h"
#include "../defaults.h"
ast_el_read_history(filename);
}
+ ast_json_init();
ast_ulaw_init();
ast_alaw_init();
tdd_init();
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);