• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ register_timer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中register_timer函数的典型用法代码示例。如果您正苦于以下问题:C++ register_timer函数的具体用法?C++ register_timer怎么用?C++ register_timer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了register_timer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: log_putc

int log_putc(int c)
{
	if(last_update.trigger_value == 0)
		last_update = register_timer(LOG_TIMEOUT);

	if(log_buf && buf_size)
	{
		log_buf[buf_ptr++] = c;
		if(buf_ptr >= buf_size)
		{
			if(log_fp && log_fp->fflush_cb)
			{
				log_fp->fflush_cb(log_fp);
				last_update = register_timer(LOG_TIMEOUT);
			}
			buf_ptr = 0;
		}
		return 0;
	}
	else if(log_fp)
	{
		// Disable output to the log for the write
		rpi_boot_output_state state = output_get_state();
		output_disable_log();

		// Write one character
		fwrite(&c, 1, 1, log_fp);

		// Restore saved output state
		output_restore_state(state);
		return 0;
	}
	return EOF;
}
开发者ID:jncronin,项目名称:rpi-boot,代码行数:34,代码来源:log.c


示例2: mod_init

static int mod_init(void)
{
	LM_INFO("Call Center module - initializing\n");

	init_db_url( db_url , 0 /*cannot be null*/);
	init_db_url( acc_db_url , 0 /*cannot be null*/);
	b2b_scenario.len = strlen(b2b_scenario.s);

	/* Load B2BUA API */
	if (load_b2b_logic_api( &b2b_api) != 0) {
		LM_ERR("Can't load B2B-UA hooks, missing 'b2b_logic' module ?\n");
		return -1;
	}

	if (register_timer( "cc_agents", cc_timer_agents, NULL, 1)<0) {
		LM_ERR("failed to register agents timer function\n");
		return -1;
	}

	if (register_timer( "cc_cleanup", cc_timer_cleanup, NULL, 5)<0) {
		LM_ERR("failed to register cleaup timer function\n");
		return -1;
	}

	/* main CC data */
	data = init_cc_data();
	if (data==0) {
		LM_CRIT("failed to get shm mem for data\n");
		return -1;
	}

	/* init and open DB connection */
	if (init_cc_db( &db_url )!=0) {
		LM_ERR("failed to initialize the DB support\n");
		return -1;
	}
	if (init_cc_acc_db( &acc_db_url )!=0) {
		LM_ERR("failed to initialize the acc DB support\n");
		return -1;
	}

	/* load data */
	if ( cc_load_db_data( data )!=0 ) {
		LM_CRIT("failed to load callcenter data\n");
		return -1;
	}
	clean_cc_old_data(data);

	/* restore calls */
	if ( cc_db_restore_calls( data )!=0 ) {
		LM_CRIT("failed to load callcenter data\n");
		return -1;
	}

	/* close DB connection */
	cc_close_db();

	return 0;
}
开发者ID:abh-gitcs1989,项目名称:opensips,代码行数:59,代码来源:call_center.c


示例3: mod_init

/**
 * init module function
 */
static int mod_init(void)
{
	stm_timer_t *it;
	if(_stm_list==NULL)
		return 0;

	/* init faked sip msg */
	if(faked_msg_init()<0)
	{
		LM_ERR("failed to init timer local sip msg\n");
		return -1;
	}

	/* register timers */
	it = _stm_list;
	while(it)
	{
		if(it->mode==0)
		{
			if(register_timer(stm_timer_exec, (void*)it, it->interval)<0)
			{
				LM_ERR("failed to register timer function\n");
				return -1;
			}
		} else {
			register_basic_timers(1);
		}
		it = it->next;
	}

	return 0;
}
开发者ID:aallamaa,项目名称:kamailio,代码行数:35,代码来源:rtimer_mod.c


示例4: mod_init

static int mod_init(void)
{
	LM_INFO("initializing SMPP protocol\n");

	db_url.len = strlen(db_url.s);
	smpp_outbound_uri.len = strlen(smpp_outbound_uri.s);

	if (smpp_db_init(&db_url) < 0)
		return -1;

	if (smpp_sessions_init() < 0)
		return -1;

	smpp_db_close();

	if (register_timer("enquire-link-timer", enquire_link, NULL, 5,
			TIMER_FLAG_DELAY_ON_DELAY)<0 )
		return -1;

	/* load the TM API */
	if (load_tm_api(&tmb)!=0) {
		LM_ERR("can't load TM API\n");
		return -1;
	}


	return 0;
}
开发者ID:rrb3942,项目名称:opensips,代码行数:28,代码来源:proto_smpp.c


示例5: get_cpu_info

void get_cpu_info(unsigned long arg)
{
	unsigned int i;
	unsigned int frequency;
	cputime64_t curr_idle_time, curr_wall_time;
	unsigned int delta_wall_time, delta_idle_time;
	unsigned int cpu_load;
	
	struct cpu_monitor_info_s *pdata = (struct cpu_monitor_info_s *)arg;

	/* CPU frequency */
	frequency = cpufreq_quick_get(0);
	printk("[Monitor] cpu frequency: %u\n", frequency);

	for(i=0; i<NUM_CPUS; ++i)
	{
		/* CPU load */
		curr_idle_time = get_cpu_idle_time_us(i, &curr_wall_time);
		delta_wall_time = (unsigned int) cputime64_sub(curr_wall_time, 
				pdata->cpu_info[i].prev_cpu_wall);
		pdata->cpu_info[i].prev_cpu_wall = curr_wall_time;

		delta_idle_time = (unsigned int) cputime64_sub(curr_idle_time, 
				pdata->cpu_info[i].prev_cpu_idle);
		pdata->cpu_info[i].prev_cpu_idle = curr_idle_time;

		cpu_load = 100*(delta_wall_time - delta_idle_time)/delta_wall_time;
		if(cpu_load>100)	cpu_load=0;
		printk("[Monitor] cpu %u load: %u\n", i, cpu_load);
	}
	
	if(g_counter<10)
		register_timer(pdata, TIME_STEP);
}
开发者ID:again4you,项目名称:private,代码行数:34,代码来源:monitor.c


示例6: initialize_kill

int initialize_kill(void)
{
	/* if disabled ... */
	if (time_to_kill == 0)
		return 0;

	if (register_timer("exec_kill", timer_routine, NULL /* param */,
	    1 /* period */, TIMER_FLAG_SKIP_ON_DELAY) < 0) {
		LM_ERR("no exec timer registered\n");
		return -1;
	}

	kill_list = shm_malloc(sizeof *kill_list);
	if (!kill_list) {
		LM_ERR("no more shm!\n");
		return -1;
	}

	kill_list->first_tl.next_tl = &kill_list->last_tl;
	kill_list->last_tl.prev_tl  = &kill_list->first_tl;
	kill_list->first_tl.prev_tl =
	kill_list->last_tl.next_tl  = NULL;

	kill_list->last_tl.time_out = -1;

	kill_lock = lock_alloc();
	if (!kill_lock) {
		LM_ERR("no shm mem for mutex\n");
		return -1;
	}
	lock_init(kill_lock);

	LM_DBG("kill initialized\n");
	return 0;
}
开发者ID:dsanders11,项目名称:opensips,代码行数:35,代码来源:kill.c


示例7: mod_init

static int
mod_init(void)
{
    bind_usrloc_t ul_bind_usrloc;

    if (natpingInterval > 0) {
        ul_bind_usrloc = (bind_usrloc_t)find_export("ul_bind_usrloc", 1, 0);
        if (!ul_bind_usrloc) {
            LOG(L_ERR, "error: mediaproxy/mod_init(): can't find the usrloc "
                "module. Check if usrloc.so is loaded.\n");
            return -1;
        }

        if (ul_bind_usrloc(&userLocation) < 0) {
            LOG(L_ERR, "error: mediaproxy/mod_init(): can't access the usrloc module.\n");
            return -1;
        }

        register_timer(pingClients, NULL, natpingInterval);
    }

    checkAsymmetricFile(&sipAsymmetrics);
    checkAsymmetricFile(&rtpAsymmetrics);

    // children won't benefit from this. figure another way
    //register_timer(checkAsymmetricFiles, NULL, 5);

    return 0;
}
开发者ID:BackupTheBerlios,项目名称:openimscore-svn,代码行数:29,代码来源:mediaproxy.c


示例8: mod_init

/**
 * init module function
 */
static int mod_init(void)
{
	load_tm_f  load_tm;

	DBG("MSILO: initializing ...\n");

	/* binding to mysql module  */
	if (bind_dbmod())
	{
		DBG("MSILO: ERROR: Database module not found\n");
		return -1;
	}

	/* import the TM auto-loading function */
	if ( !(load_tm=(load_tm_f)find_export("load_tm", NO_SCRIPT, 0))) {
		LOG(L_ERR, "ERROR: msilo: mod_init: can't import load_tm\n");
		return -1;
	}
	/* let the auto-loading function load all TM stuff */
	if (load_tm( &tmb )==-1)
		return -1;

	ml = msg_list_init();
	if(!ml)
	{
		DBG("ERROR: msilo: mod_init: can't initialize msg list\n");
		return -1;
	}
	register_timer( m_clean_silo, 0, check_time);

	reg_addr.s = registrar;
	reg_addr.len = (registrar)?strlen(registrar):0;

	return 0;
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:38,代码来源:msilo.c


示例9: register_functions

void register_functions( lua_State* L, gwlua_t* state )
{
  static const luaL_Reg statics[] =
  {
    { "playsound",     l_playsound },
    { "stopsounds",    l_stopsounds },
    { "randomize",     l_randomize },
    { "random",        l_random },
    { "round",         l_round },
    { "now",           l_now },
    { "splittime",     l_splittime },
    { "inttostr",      l_inttostr },
    { "loadvalue",     l_loadvalue },
    { "savevalue",     l_savevalue },
    { "setbackground", l_setbackground },
    { "setzoom",       l_setzoom },
    { "inputstate",    l_inputstate },
    { "loadbin",       l_loadbin },
    { "loadbs",        l_loadbs },
    { NULL, NULL }
  };
  
  lua_newtable( L );
  
  register_image( L, state );
  register_sound( L, state );
  register_timer( L, state );
  
  lua_pushlightuserdata( L, (void*)state );
  luaL_setfuncs( L, statics, 1 );
  
  // module
  
  if ( luaL_loadbufferx( L, (const char*)gwlua_lua_system_lua, gwlua_lua_system_lua_len, "system.lua", "t" ) != LUA_OK )
  {
    lua_error( L );
    return;
  }
  
  // module chunk
  
  lua_call( L, 0, 1 );
  
  // module function
  
  lua_pushvalue( L, -2 );
  
  // module function module
  
  lua_call( L, 1, 0 );
  
  // module
  
  lua_setglobal( L, "system" );
  
  // --
}
开发者ID:kurumushi,项目名称:gw-libretro,代码行数:57,代码来源:functions.c


示例10: window_load

static void window_load(Window *window) {
  Layer *window_layer = window_get_root_layer(window);
  GRect bounds = layer_get_bounds(window_layer);

  render_layer = layer_create(bounds);
  layer_set_update_proc(render_layer, update_display);
  layer_add_child(window_layer, render_layer);
  register_timer(NULL);
}
开发者ID:franc0is,项目名称:pebble-tinymath,代码行数:9,代码来源:fractal_tree.c


示例11: repl_prof_init

int repl_prof_init(void)
{
	int index;

	if (!repl_prof_dests_nr)
		return 0;

	if (repl_prof_utimer < 0) {
		LM_ERR("negative replicate timer for profiles %d\n", repl_prof_utimer);
		return -1;
	}
	if (repl_prof_timer_check < 0) {
		LM_ERR("negative replicate timer for profiles check %d\n",
				repl_prof_timer_check);
		return -1;
	}

	if (repl_prof_timer_expire < 0) {
		LM_ERR("negative replicate expire timer for profiles %d\n",
				repl_prof_timer_expire);
		return -1;
	}

	if (repl_prof_buffer_th < 0) {
		LM_ERR("negative replicate buffer threshold for profiles %d\n",
				repl_prof_buffer_th);
		return -1;
	}

	if (register_utimer("dialog-repl-profiles-utimer", repl_prof_utimer_f, NULL,
			repl_prof_utimer * 1000, TIMER_FLAG_DELAY_ON_DELAY) < 0) {
		LM_ERR("failed to register profiles utimer\n");
		return -1;
	}
	if (register_timer("dialog-repl-profiles-timer", repl_prof_timer_f, NULL,
			repl_prof_timer_check, TIMER_FLAG_DELAY_ON_DELAY) < 0) {
		LM_ERR("failed to register profiles utimer\n");
		return -1;
	}

	if (repl_prof_buffer_th > (BUF_SIZE * 0.9)) {
		LM_WARN("Buffer size too big %d - profiles information might get lost",
				repl_prof_buffer_th);
		return -1;
	}

	/* alocate the last_message counter in shared memory */
	for (index = 0; index < repl_prof_dests_nr; index++) {
		repl_prof_dests[index].last_msg = shm_malloc(sizeof(time_t));
		if (!repl_prof_dests[index].last_msg) {
			LM_ERR("OOM shm\n");
			return -1;
		}
	}

	return 0;
}
开发者ID:ionel-cerghit,项目名称:opensips,代码行数:57,代码来源:dlg_replication.c


示例12: mod_init

/**
 * init module function
 */
static int mod_init(void)
{
	bind_xcap_t bind_xcap;
	xcap_api_t xcap_api;

        /* load XCAP API */
        bind_xcap = (bind_xcap_t)find_export("bind_xcap", 1, 0);
        if (!bind_xcap)
        {
                LM_ERR("Can't bind xcap\n");
                return -1;
        }

        if (bind_xcap(&xcap_api) < 0)
        {
                LM_ERR("Can't bind xcap\n");
                return -1;
        }
        xcap_db_url = xcap_api.db_url;
        xcap_db_table = xcap_api.xcap_table;

	/* binding to mysql module  */
	if (db_bind_mod(&xcap_db_url, &xcap_dbf))
	{
		LM_ERR("Database module not found\n");
		return -1;
	}

	if (!DB_CAPABILITY(xcap_dbf, DB_CAP_ALL)) {
		LM_ERR("Database module does not implement all functions"
				" needed by the module\n");
		return -1;
	}

	xcap_db = xcap_dbf.init(&xcap_db_url);
	if (!xcap_db)
	{
		LM_ERR("while connecting to database\n");
		return -1;
	}

	curl_global_init(CURL_GLOBAL_ALL);

	if(periodical_query)
	{
		register_timer("xcapc-update", query_xcap_update, 0,
			query_period, TIMER_FLAG_DELAY_ON_DELAY);
	}

	if(xcap_db)
		xcap_dbf.close(xcap_db);
	xcap_db = NULL;

	return 0;
}
开发者ID:alias-neo,项目名称:opensips,代码行数:58,代码来源:xcap_client.c


示例13: mod_init

/**
 * init module function
 */
static int mod_init(void)
{
	if(register_mi_mod(exports.name, mi_cmds)!=0)
	{
		LM_ERR("failed to register MI commands\n");
		return -1;
	}
	if(htable_init_rpc()!=0)
	{
		LM_ERR("failed to register RPC commands\n");
		return -1;
	}

	if(ht_init_tables()!=0)
		return -1;
	ht_db_init_params();

	if(ht_db_url.len>0)
	{
		if(ht_db_init_con()!=0)
			return -1;
		if(ht_db_open_con()!=0)
			return -1;
		if(ht_db_load_tables()!=0)
		{
			ht_db_close_con();
			return -1;
		}
		ht_db_close_con();
	}
	if(ht_has_autoexpire())
	{
		LM_DBG("starting auto-expire timer\n");
		if(ht_timer_interval<=0)
			ht_timer_interval = 20;
		if(ht_timer_procs<=0) {
			if(register_timer(ht_timer, 0, ht_timer_interval)<0)
			{
				LM_ERR("failed to register timer function\n");
				return -1;
			}
		} else {
			register_sync_timers(ht_timer_procs);
		}
	}

	if (ht_enable_dmq>0 && ht_dmq_initialize()!=0) {
		LM_ERR("failed to initialize dmq integration\n");
		return -1;
	}

	ht_iterator_init();

	return 0;
}
开发者ID:aphistic,项目名称:kamailio,代码行数:58,代码来源:htable.c


示例14: mod_init

/** Module init function */
static int mod_init(void)
{
	if(load_uac_auth_api(&uac_auth_api)<0){
		LM_ERR("Failed to load uac_auth api\n");
		return -1;
	}

	/* load all TM stuff */
	if(load_tm_api(&tmb)==-1) {
		LM_ERR("can't load tm functions\n");
		return -1;
	}

	if(default_expires<15){
		LM_ERR("default_expires to short: [%d]<15\n", default_expires);
		return -1;
	}
	if(timer_interval<10){
		LM_ERR("timer_interval to short: [%d]<10\n", timer_interval);
		return -1;
	}
	if(reg_hsize<1 || reg_hsize>20) {
		LM_ERR("Wrong hash size: 20<[%d]<1\n", reg_hsize);
	}
	reg_hsize = 1<<reg_hsize;

	if(init_reg_htable()<0) {
		LM_ERR("Failed to initialize registrant hash table\n");
		return -1;
	}

	reg_table_name.len = strlen(reg_table_name.s);
	registrar_column.len = strlen(registrar_column.s);
	proxy_column.len = strlen(proxy_column.s);
	aor_column.len = strlen(aor_column.s);
	third_party_registrant_column.len =
		strlen(third_party_registrant_column.s);
	username_column.len = strlen(username_column.s);
	password_column.len = strlen(password_column.s);
	binding_URI_column.len = strlen(binding_URI_column.s);
	binding_params_column.len = strlen(binding_params_column.s);
	expiry_column.len = strlen(expiry_column.s);
	forced_socket_column.len = strlen(forced_socket_column.s);
	init_db_url(db_url , 0 /*cannot be null*/);
	if (init_reg_db(&db_url) != 0) {
		LM_ERR("failed to initialize the DB support\n");
		return -1;
	}

	register_timer("uac_reg_check", timer_check, 0,
					timer_interval/reg_hsize);

	return 0;
}
开发者ID:KISSMonX,项目名称:opensips,代码行数:55,代码来源:registrant.c


示例15: repl_prof_init

int repl_prof_init(void)
{
	if (!profile_replicate_cluster && !accept_repl_profiles)
		return 0;

	if (repl_prof_timer_check < 0) {
		LM_ERR("negative replicate timer for profiles check %d\n",
			repl_prof_timer_check);
		return -1;
	}

	if (repl_prof_timer_expire < 0) {
		LM_ERR("negative replicate expire timer for profiles %d\n",
			repl_prof_timer_expire);
		return -1;
	}

	if (register_timer("dialog-repl-profiles-timer", repl_prof_timer_f, NULL,
		repl_prof_timer_check, TIMER_FLAG_DELAY_ON_DELAY) < 0) {
		LM_ERR("failed to register profiles utimer\n");
		return -1;
	}

	if (!profile_replicate_cluster)
		return 0;

	if (repl_prof_utimer < 0) {
		LM_ERR("negative replicate timer for profiles %d\n", repl_prof_utimer);
		return -1;
	}

	if (repl_prof_buffer_th < 0) {
		LM_ERR("negative replicate buffer threshold for profiles %d\n",
			repl_prof_buffer_th);
		return -1;
	}

	if (register_utimer("dialog-repl-profiles-utimer", repl_prof_utimer_f, NULL,
		repl_prof_utimer * 1000, TIMER_FLAG_DELAY_ON_DELAY) < 0) {
		LM_ERR("failed to register profiles utimer\n");
		return -1;
	}


	if (repl_prof_buffer_th > (BUF_SIZE * 0.9)) {
		LM_WARN("Buffer size too big %d - profiles information might get lost",
			repl_prof_buffer_th);
		return -1;
	}

	return 0;
}
开发者ID:SimleCat,项目名称:opensips,代码行数:52,代码来源:dlg_replication.c


示例16: mod_init

/*! \brief
 * Module initialization function
 */
static int mod_init(void) {

	if (usrloc_debug){
		LM_INFO("Logging usrloc records to %.*s\n", usrloc_debug_file.len, usrloc_debug_file.s);
		debug_file = fopen(usrloc_debug_file.s, "a");
		fprintf(debug_file, "starting\n");
		fflush(debug_file);
	}

#ifdef STATISTICS
	/* register statistics */
	if (register_module_stats( exports.name, mod_stats)!=0 ) {
		LM_ERR("failed to register core statistics\n");
		return -1;
	}
#endif

	/* Compute the lengths of string parameters */
	usrloc_debug_file.len = strlen(usrloc_debug_file.s);

	if (ul_hash_size <= 1)
		ul_hash_size = 512;
	else
		ul_hash_size = 1 << ul_hash_size;
	ul_locks_no = ul_hash_size;

	if (ul_init_locks() != 0) {
		LM_ERR("locks array initialization failed\n");
		return -1;
	}

	/* Regsiter RPC */
	if (rpc_register_array(ul_rpc) != 0) {
		LM_ERR("failed to register RPC commands\n");
		return -1;
	}

	/* Register cache timer */
	LM_DBG("Registering cache timer");
	register_timer(timer, 0, timer_interval);

	/* init the callbacks list */
	if (init_ulcb_list() < 0) {
		LM_ERR("usrloc/callbacks initialization failed\n");
		return -1;
	}

	init_flag = 1;

	return 0;
}
开发者ID:aallamaa,项目名称:kamailio,代码行数:54,代码来源:ul_mod.c


示例17: mod_init

/* initialize ratelimit module */
static int mod_init(void)
{
	DBG("RATELIMIT: initializing ...\n");

	/* register timer to reset counters */
	if (register_timer(timer, 0, timer_interval) < 0) {
		LOG(L_ERR, "RATELIMIT:ERROR: could not register timer function\n");
		return -1;
	}

	invite_counter = shm_malloc(sizeof(int));
	register_counter = shm_malloc(sizeof(int));
	subscribe_counter = shm_malloc(sizeof(int));
	if (!invite_counter || !register_counter || !subscribe_counter) {
		LOG(L_ERR, "RATELIMIT:ERROR: no memory for counters\n");
		return -1;
	}
	*invite_counter = 0;
	*register_counter = 0;
	*subscribe_counter = 0;

	invite_limit = shm_malloc(sizeof(int));
	register_limit = shm_malloc(sizeof(int));
	subscribe_limit = shm_malloc(sizeof(int));
	if (!invite_limit || !register_limit || !subscribe_limit) {
		LOG(L_ERR, "RATELIMIT:ERROR: no memory for limit settings\n");
		return -1;
	}
	/* obtain limits from modparam */
	*invite_limit = invite_limit_mp;
	*register_limit = register_limit_mp;
	*subscribe_limit = subscribe_limit_mp;


#if defined (RL_WITH_RED)
	/* these are only needed when using RED */
	invite_load = shm_malloc(sizeof(int));
	register_load = shm_malloc(sizeof(int));
	subscribe_load = shm_malloc(sizeof(int));
	if (!invite_load || !register_load || !subscribe_load) {
		LOG(L_ERR, "RATELIMIT:ERROR: no memory for load levels\n");
		return -1;
	}
	*invite_load = -1; /* -1 = first run identifier */
	*register_load = -1;
	*subscribe_load = -1;
#endif

	return 0;
}
开发者ID:4N7HR4X,项目名称:kamailio,代码行数:51,代码来源:ratelimit.c


示例18: mod_init

/*! This is the first function to be called by Kamailio, to initialize the module.
 * This call must always return a value as soon as possible.  If it were not to
 * return, then Kamailio would not be able to initialize any of the other
 * modules. */
static int mod_init(void) 
{
	if (register_message_code_statistics() < 0) 
	{
		return -1;
	}

	/* Initialize shared memory used to buffer communication between the
	 * usrloc module and the snmpstats module.  */
	initInterprocessBuffers();
	
	/* We need to register for callbacks with usrloc module, for whenever a
	 * contact is added or removed from the system.  We need to do it now
	 * before Kamailio's functions get a chance to load up old user data from
	 * the database.  That load will happen if a lookup() function is come
	 * across in kamailio.cfg. */

	if (snmp_export_registrar!=0)
	{
		if(!registerForUSRLOCCallbacks())
		{
			/* Originally there were descriptive error messages here to help
			 * the operator debug problems.  Turns out this may instead
			 * alarm them about problems they don't need to worry about.  So
			 * the messages are commented out for now */
		
			/*
			LM_ERR("snmpstats module was unable to register callbacks"
					" with the usrloc module\n");
			LM_ERR("Are you sure that the usrloc module was loaded"
					" before the snmpstats module in ");
			LM_ERR("kamailio.cfg?  kamailioSIPRegUserTable will not be "
				   "updated.");
			*/
		}
	}

	/* Register the alarm checking function to run periodically */
	register_timer(run_alarm_check, 0, ALARM_AGENT_FREQUENCY_IN_SECONDS);

	/* add space for one extra process */
	register_procs(1);
	/* add child to update local config framework structures */
	cfg_register_child(1);
	/* Initialize config framework in utilities.c */
	config_context_init();

	return 0;
}
开发者ID:gbour,项目名称:kamailio,代码行数:53,代码来源:snmpstats.c


示例19: mod_init

static int
mod_init(void)
{

	if (natping_interval > 0) {
		get_all_ucontacts =
		    (int (*)(void *, int))find_export("ul_get_all_ucontacts", 1, 0);
		if (!get_all_ucontacts) {
			LOG(L_ERR, "This module requires usrloc module\n");
			return -1;
		}
		register_timer(timer, NULL, natping_interval);
	}

	return 0;
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:16,代码来源:nathelper.c


示例20: init_ql_support

/* Initializes needed structures and registeres timer
 *
 * Important : To be called before forking so all processes
 * inherit same queue */
int init_ql_support(void)
{
	if (query_buffer_size > 1)
	{
		if  (init_query_list() != 0 ||
			register_timer("querydb-flush", ql_timer_routine,NULL,
				query_flush_time>0?query_flush_time:DEF_FLUSH_TIME,
				TIMER_FLAG_DELAY_ON_DELAY) < 0 )
		{
			LM_ERR("failed initializing ins list support\n");
			return -1;
		}
	}

	return 0;
}
开发者ID:BeIP,项目名称:opensips,代码行数:20,代码来源:db_insertq.c



注:本文中的register_timer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ register_type函数代码示例发布时间:2022-05-30
下一篇:
C++ register_term_acks函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap