diff --git a/include/asterisk/module.h b/include/asterisk/module.h index cce8735fc1..f79dc8eb10 100644 --- a/include/asterisk/module.h +++ b/include/asterisk/module.h @@ -283,7 +283,7 @@ int ast_loader_unregister(int (*updater)(void)); * \param type The type of action that will be performed by CLI. * * \retval A possible completion of the partial match. - * \retval NULL if no matches were found. + * \retval NULL if no matches were found or Asterisk is not yet fully booted. */ char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, enum ast_module_helper_type type); diff --git a/main/loader.c b/main/loader.c index 4c6c2a809e..549e3f0e52 100644 --- a/main/loader.c +++ b/main/loader.c @@ -1382,6 +1382,11 @@ char *ast_module_helper(const char *line, const char *word, int pos, int state, return NULL; } + /* Tab completion can't be used during startup, or CLI and loader will deadlock. */ + if (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) { + return NULL; + } + if (type == AST_MODULE_HELPER_LOAD) { module_load_helper(word);