Esempio n. 1
0
static void belle_sip_dialog_init_200Ok_retrans(belle_sip_dialog_t *obj, belle_sip_response_t *resp){
	const belle_sip_timer_config_t *cfg=belle_sip_stack_get_timer_config(obj->provider->stack);
	obj->timer_200Ok=belle_sip_timeout_source_new((belle_sip_source_func_t)dialog_on_200Ok_timer,obj,cfg->T1);
	belle_sip_object_set_name((belle_sip_object_t*)obj->timer_200Ok,"dialog_200Ok_timer");
	belle_sip_main_loop_add_source(obj->provider->stack->ml,obj->timer_200Ok);
	
	obj->timer_200Ok_end=belle_sip_timeout_source_new((belle_sip_source_func_t)dialog_on_200Ok_end,obj,cfg->T1*64);
	belle_sip_object_set_name((belle_sip_object_t*)obj->timer_200Ok_end,"dialog_200Ok_timer_end");
	belle_sip_main_loop_add_source(obj->provider->stack->ml,obj->timer_200Ok_end);
	
	obj->last_200Ok=(belle_sip_response_t*)belle_sip_object_ref(resp);
}
Esempio n. 2
0
static void nict_send_request(belle_sip_nict_t *obj){
	belle_sip_transaction_t *base=(belle_sip_transaction_t*)obj;
	const belle_sip_timer_config_t *cfg=belle_sip_transaction_get_timer_config(base);
	
	belle_sip_transaction_set_state(base,BELLE_SIP_TRANSACTION_TRYING);
	obj->timer_F=belle_sip_timeout_source_new((belle_sip_source_func_t)nict_on_timer_F,obj,cfg->T1*64);
	belle_sip_object_set_name((belle_sip_object_t*)obj->timer_F,"timer_F");
	belle_sip_transaction_start_timer(base,obj->timer_F);
	if (!belle_sip_channel_is_reliable(base->channel)){
		obj->timer_E=belle_sip_timeout_source_new((belle_sip_source_func_t)nict_on_timer_E,obj,cfg->T1);
		belle_sip_object_set_name((belle_sip_object_t*)obj->timer_E,"timer_E");
		belle_sip_transaction_start_timer(base,obj->timer_E);
	}
	belle_sip_channel_queue_message(base->channel,(belle_sip_message_t*)base->request);
}
Esempio n. 3
0
static void schedule_timer_at(belle_sip_refresher_t* refresher,int delay, timer_purpose_t purpose) {
	belle_sip_message("Refresher: scheduling next timer in %i ms",delay);
	refresher->timer_purpose=purpose;
	/*cancel timer if any*/
	cancel_retry(refresher);
	refresher->timer=belle_sip_timeout_source_new(timer_cb,refresher,delay);
	belle_sip_object_set_name((belle_sip_object_t*)refresher->timer,"Refresher timeout");
	belle_sip_main_loop_add_source(belle_sip_stack_get_main_loop(refresher->transaction->base.provider->stack),refresher->timer);
}
belle_sip_source_t* belle_sip_main_loop_create_timeout(belle_sip_main_loop_t *ml
														, belle_sip_source_func_t func
														, void *data
														, unsigned int timeout_value_ms
														,const char* timer_name) {
	belle_sip_source_t * s=belle_sip_timeout_source_new(func,data,timeout_value_ms);
	belle_sip_object_set_name((belle_sip_object_t*)s,timer_name);
	belle_sip_main_loop_add_source(ml,s);
	return s;
}
Esempio n. 5
0
static void nict_set_completed(belle_sip_nict_t *obj, belle_sip_response_t *resp){
	belle_sip_transaction_t *base=(belle_sip_transaction_t*)obj;
	const belle_sip_timer_config_t *cfg=belle_sip_transaction_get_timer_config(base);
	belle_sip_transaction_set_state(base,BELLE_SIP_TRANSACTION_COMPLETED);
	if (obj->timer_K) belle_sip_fatal("Should never happen.");

	belle_sip_client_transaction_notify_response((belle_sip_client_transaction_t*)obj,resp);

	if (!belle_sip_channel_is_reliable(base->channel)){
		obj->timer_K=belle_sip_timeout_source_new((belle_sip_source_func_t)nict_on_timer_K,obj,cfg->T4);
		belle_sip_object_set_name((belle_sip_object_t*)obj->timer_K,"timer_K");
		belle_sip_transaction_start_timer(base,obj->timer_K);
	}else belle_sip_transaction_terminate(base);
}