Exemplo n.º 1
0
static int unload_module(void)
{
	if (security_stasis_sub) {
		security_stasis_sub = stasis_unsubscribe(security_stasis_sub);
	}

	ast_logger_unregister_level(LOG_SECURITY_NAME);

	ast_verb(3, "Security Logging Disabled\n");

	return 0;
}
Exemplo n.º 2
0
static int load_module(void)
{
	if ((LOG_SECURITY = ast_logger_register_level(LOG_SECURITY_NAME)) == -1) {
		return AST_MODULE_LOAD_DECLINE;
	}

	if (!(security_stasis_sub = stasis_subscribe(ast_security_topic(), security_stasis_cb, NULL))) {
		ast_logger_unregister_level(LOG_SECURITY_NAME);
		LOG_SECURITY = -1;
		return AST_MODULE_LOAD_DECLINE;
	}

	ast_verb(3, "Security Logging Enabled\n");

	return AST_MODULE_LOAD_SUCCESS;
}
Exemplo n.º 3
0
static int load_module(void)
{
    if ((LOG_SECURITY = ast_logger_register_level(LOG_SECURITY_NAME)) == -1) {
        return AST_MODULE_LOAD_DECLINE;
    }

    if (!(security_event_sub = ast_event_subscribe(AST_EVENT_SECURITY,
                               security_event_cb, "Security Event Logger",
                               NULL, AST_EVENT_IE_END))) {
        ast_logger_unregister_level(LOG_SECURITY_NAME);
        LOG_SECURITY = -1;
        return AST_MODULE_LOAD_DECLINE;
    }

    ast_verb(3, "Security Logging Enabled\n");

    return AST_MODULE_LOAD_SUCCESS;
}