}
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&all_events, ev, eq_next) {
+ /* Never release the last event */
+ if (!AST_RWLIST_NEXT(ev, eq_next)) {
+ break;
+ }
+
/* 2.5 times whatever the HTTP timeout is (maximum 2.5 hours) is the maximum time that we will definitely cache an event */
if (ev->usecount == 0 && ast_tvdiff_sec(now, ev->tv) > (httptimeout > 3600 ? 3600 : httptimeout) * 2.5) {
AST_RWLIST_REMOVE_CURRENT(eq_next);
#define SMDI_MSG_EXPIRY_TIME 30000 /* 30 seconds */
static const char config_file[] = "smdi.conf";
+static int smdi_loaded;
/*! \brief SMDI message desk message queue. */
struct ast_smdi_md_queue {
static int load_module(void)
{
int res;
+ smdi_loaded = 1;
/* initialize our containers */
memset(&smdi_ifaces, 0, sizeof(smdi_ifaces));
static int _unload_module(int fromload)
{
+ if (!smdi_loaded) {
+ return 0;
+ }
+
/* this destructor stops any running smdi_read threads */
ASTOBJ_CONTAINER_DESTROYALL(&smdi_ifaces, ast_smdi_interface_destroy);
ASTOBJ_CONTAINER_DESTROY(&smdi_ifaces);
ast_custom_function_unregister(&smdi_msg_function);
}
+ smdi_loaded = 0;
return 0;
}