예제 #1
0
파일: sl.c 프로젝트: AndreiPlesa/opensips
static int mod_init(void)
{
	LM_INFO("Initializing StateLess engine\n");

	/* if statistics are disabled, prevent their registration to core */
	if (sl_enable_stats==0)
#ifdef STATIC_SL
		sl_exports.stats = 0;
#else
		exports.stats = 0;
#endif

	/* filter all ACKs before script */
	if (register_script_cb(sl_filter_ACK, PRE_SCRIPT_CB|REQ_TYPE_CB, 0 )!=0) {
		LM_ERR("register_script_cb failed\n");
		return -1;
	}

	/* init internal SL stuff */
	if (sl_startup()!=0) {
		LM_ERR("sl_startup failed\n");
		return -1;
	}

	return 0;
}
예제 #2
0
파일: sl.c 프로젝트: OPSF/uClinux
static int mod_init(void)
{
	fprintf(stderr, "stateless - initializing\n");
	if (init_sl_stats()<0) {
		LOG(L_ERR, "ERROR: init_sl_stats failed\n");
		return -1;
	}
	/* if SL loaded, filter ACKs on beginning */
	register_script_cb( sl_filter_ACK, PRE_SCRIPT_CB, 0 );
	sl_startup();

	return 0;
}
예제 #3
0
static int mod_init(void)
{
	if (init_sl_stats() < 0) {
		ERR("init_sl_stats failed\n");
		return -1;
	}

	     /* if SL loaded, filter ACKs on beginning */
	if (register_script_cb( sl_filter_ACK, PRE_SCRIPT_CB|REQ_TYPE_CB, 0 )<0) {
		ERR("Failed to install SCRIPT callback\n");
		return -1;
	}
	sl_startup();

	return 0;
}
예제 #4
0
static int mod_init(void)
{
	fprintf(stderr, "stateless - initializing\n");
	if (init_sl_stats()<0) {
		LOG(L_ERR, "ERROR: init_sl_stats failed\n");
		return -1;
	}
	/* filter all ACKs before script */
	if (register_script_cb(sl_filter_ACK, PRE_SCRIPT_CB|REQ_TYPE_CB, 0 )!=0) {
		LOG(L_ERR,"ERROR:sl:mod_init: register_script_cb failed\n");
		return -1;
	}
	/* init internal SL stuff */
	if (sl_startup()!=0) {
		LOG(L_ERR,"ERROR:sl:mod_init: sl_startup failed\n");
		return -1;
	}

	return 0;
}
예제 #5
0
파일: sl.c 프로젝트: kiryu/kamailio
static int mod_init(void)
{
	if (init_sl_stats() < 0) {
		ERR("init_sl_stats failed\n");
		return -1;
	}
	if (sl_register_kstats()<0) {
		ERR("init k stats failed\n");
		return -1;
	}

	/* if SL loaded, filter ACKs on beginning */
	if (register_script_cb( sl_filter_ACK, PRE_SCRIPT_CB|REQUEST_CB, 0 )<0) {
		ERR("Failed to install SCRIPT callback\n");
		return -1;
	}
	if(sl_startup()<0)
	{
		ERR("Failed to do startup tasks\n");
		return -1;
	}

	if(sl_bind_tm!=0)
	{
		if(load_tm_api(&tmb)==-1)
		{
			LM_INFO("could not bind tm module - only stateless mode"
					" available\n");
			sl_bind_tm=0;
		}
	}

	_sl_filtered_ack_route=route_lookup(&event_rt, "sl:filtered-ack");
	if (_sl_filtered_ack_route>=0 && event_rt.rlist[_sl_filtered_ack_route]==0)
		_sl_filtered_ack_route=-1; /* disable */

	return 0;
}
예제 #6
0
파일: sl.c 프로젝트: 4N7HR4X/kamailio
static int mod_init(void)
{
	if (init_sl_stats() < 0) {
		ERR("init_sl_stats failed\n");
		return -1;
	}
	if (sl_register_kstats()<0) {
		ERR("init k stats failed\n");
		return -1;
	}

	/* if SL loaded, filter ACKs on beginning */
	if (register_script_cb( sl_filter_ACK, PRE_SCRIPT_CB|REQUEST_CB, 0 )<0) {
		ERR("Failed to install SCRIPT callback\n");
		return -1;
	}
	if(sl_startup()<0)
	{
		ERR("Failed to do startup tasks\n");
		return -1;
	}

	memset(&tmb, 0, sizeof(struct tm_binds));
	if(sl_bind_tm!=0)
	{
		if(load_tm_api(&tmb)==-1)
		{
			LM_INFO("could not bind tm module - only stateless mode"
					" available during modules initialization\n");
		}
	}

	sl_lookup_event_routes();

	return 0;
}