Exemplo n.º 1
0
static int load_module(void)
{
	if(!parse_config(0))
		return AST_MODULE_LOAD_DECLINE;

	ast_config_engine_register(&pgsql_engine);
	ast_verb(1, "PostgreSQL RealTime driver loaded.\n");
	ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));

	return 0;
}
int load_module(void)
{
	int res = 0;
	do_reload = 1;
	load_config(1);
	do_reload = 0;

	ast_config_engine_register(&sqlite_engine);
	ast_verbose(VERBOSE_PREFIX_2 "SQLite Config Handler Registered.\n");


	if (has_cdr) {
		ast_verbose(VERBOSE_PREFIX_2 "Loading SQLite CDR\n");
		res = ast_cdr_register(cdr_name, "RES SQLite CDR", sqlite_log);
	}
	else 
		ast_verbose(VERBOSE_PREFIX_2 "SQLite CDR Disabled\n");



	ast_register_application(app, sqlite_execapp, synopsis, tdesc);


	if (has_switch) {
		if (ast_register_switch(&sqlite_switch))
			ast_log(LOG_ERROR, "Unable to register SQLite Switch\n");
		else {
			sqlite3HashInit(&extens,SQLITE_HASH_STRING,COPY_KEYS);
			ast_verbose(VERBOSE_PREFIX_2 "Registered SQLite Switch\n");
		}
	}
	else 
		ast_verbose(VERBOSE_PREFIX_2 "Sqlite Switch Disabled\n");

	if (has_cli) {
		ast_verbose(VERBOSE_PREFIX_2 "Activating SQLite CLI Command Set.\n");
		ast_cli_register(&cli_sqlite1); 
		ast_cli_register(&cli_sqlite2);	 
		ast_cli_register(&cli_sqlite3);	 
		ast_cli_register(&cli_sqlite4);	 
		ast_cli_register(&cli_sqlite5);	 
		ast_cli_register(&cli_sqlite6);
		ast_cli_register(&cli_sqlite7);
		ast_cli_register(&cli_sqlite8);
		ast_cli_register(&cli_sqlite9);
	}
	else 
		ast_verbose(VERBOSE_PREFIX_2 "SQLite CLI Command Set Not Configured.\n");

	return res;
}
Exemplo n.º 3
0
static int load_module(void)
{
	ast_log(LOG_NOTICE, "Loading res_config_redis...\n");

	ast_debug(1, "Loading res_config_redis...\n");
//	if(!parse_config(0)) {
//		return AST_MODULE_LOAD_DECLINE;
//	}
	ast_config_engine_register(&redis_engine);

	ast_cli_register_multiple(cli_realtime, ARRAY_LEN(cli_realtime));

	ast_debug(1, "Done Loading res_config_redis...\n");
	return 0;
}
Exemplo n.º 4
0
static int load_module(void)
{
	ast_config_engine_register(&sorcery_config_engine);
	ast_realtime_append_mapping("sorcery_realtime_test", "sorcery_realtime_test", "test", "test", 1);
	AST_TEST_REGISTER(object_create);
	AST_TEST_REGISTER(object_retrieve_id);
	AST_TEST_REGISTER(object_retrieve_field);
	AST_TEST_REGISTER(object_retrieve_multiple_all);
	AST_TEST_REGISTER(object_retrieve_multiple_field);
	AST_TEST_REGISTER(object_retrieve_regex);
	AST_TEST_REGISTER(object_update);
	AST_TEST_REGISTER(object_update_uncreated);
	AST_TEST_REGISTER(object_delete);
	AST_TEST_REGISTER(object_delete_uncreated);

	return AST_MODULE_LOAD_SUCCESS;
}
static int load_module(void)
{
	if (!ast_module_check("res_curl.so")) {
		if (ast_load_resource("res_curl.so") != AST_MODULE_LOAD_SUCCESS) {
			ast_log(LOG_ERROR, "Cannot load res_curl, so res_config_curl cannot be loaded\n");
			return AST_MODULE_LOAD_DECLINE;
		}
	}

	if (!ast_module_check("func_curl.so")) {
		if (ast_load_resource("func_curl.so") != AST_MODULE_LOAD_SUCCESS) {
			ast_log(LOG_ERROR, "Cannot load func_curl, so res_config_curl cannot be loaded\n");
			return AST_MODULE_LOAD_DECLINE;
		}
	}

	reload_module();

	ast_config_engine_register(&curl_engine);

	return 0;
}
Exemplo n.º 6
0
static int load_module(void)
{
	if(!parse_config())
		return AST_MODULE_LOAD_DECLINE;

	ast_mutex_lock(&pgsql_lock);

	if (!pgsql_reconnect(NULL)) {
		ast_log(LOG_WARNING,
				"Postgresql RealTime: Couldn't establish connection. Check debug.\n");
		ast_log(LOG_DEBUG, "Postgresql RealTime: Cannot Connect: %s\n",
				PQerrorMessage(pgsqlConn));
	}

	ast_config_engine_register(&pgsql_engine);
	if (option_verbose) {
		ast_verbose("Postgresql RealTime driver loaded.\n");
	}
	ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));

	ast_mutex_unlock(&pgsql_lock);

	return 0;
}
Exemplo n.º 7
0
static int load_module (void)
{
	ast_config_engine_register(&curl_engine);
	ast_verb(1, "res_config_curl loaded.\n");
	return 0;
}