Commit 1e781c95 authored by jehan's avatar jehan

add timer config setter

parent 1fdf1688
......@@ -139,6 +139,17 @@ BELLESIP_EXPORT int belle_sip_stack_get_default_dscp(belle_sip_stack_t *stack);
**/
BELLESIP_EXPORT int belle_sip_stack_tls_available(belle_sip_stack_t *stack);
/*
* returns timer config for this stack
* */
BELLESIP_EXPORT const belle_sip_timer_config_t *belle_sip_stack_get_timer_config(const belle_sip_stack_t *stack);
/*
*
* set sip timer config to be used for this stack
* */
BELLESIP_EXPORT void belle_sip_stack_set_timer_config(belle_sip_stack_t *stack, const belle_sip_timer_config_t *timer_config);
BELLE_SIP_END_DECLS
#endif
......
......@@ -531,7 +531,6 @@ belle_sip_hop_t* belle_sip_hop_new_from_uri(const belle_sip_uri_t *uri);
belle_sip_hop_t* belle_sip_hop_new_from_generic_uri(const belle_generic_uri_t *uri);
belle_sip_hop_t * belle_sip_stack_get_next_hop(belle_sip_stack_t *stack, belle_sip_request_t *req);
const belle_sip_timer_config_t *belle_sip_stack_get_timer_config(const belle_sip_stack_t *stack);
/*
belle_sip_provider_t
......
......@@ -945,11 +945,13 @@ static int send_buffer(belle_sip_channel_t *obj, const char *buffer, size_t size
int ret=0;
char *logbuf=NULL;
if (!obj->stack->send_error){
if (obj->stack->send_error == 0){
ret=belle_sip_channel_send(obj,buffer,size);
}else{
}else if (obj->stack->send_error<0){
/*for testing purpose only */
ret=obj->stack->send_error;
} else {
ret=size; /*to silently discard message*/
}
if (ret<0){
......@@ -965,8 +967,9 @@ static int send_buffer(belle_sip_channel_t *obj, const char *buffer, size_t size
}/*ewouldblock error has to be handled by caller*/
}else if (size==(size_t)ret){
logbuf=make_logbuf(BELLE_SIP_LOG_MESSAGE, buffer,size);
belle_sip_message("channel [%p]: message sent to [%s://%s:%i], size: [%i] bytes\n%s"
belle_sip_message("channel [%p]: message %s to [%s://%s:%i], size: [%i] bytes\n%s"
,obj
,obj->stack->send_error==0?"sent":"silently discarded"
,belle_sip_channel_get_transport_name(obj)
,obj->peer_name
,obj->peer_port
......
......@@ -123,6 +123,15 @@ const belle_sip_timer_config_t *belle_sip_stack_get_timer_config(const belle_sip
return &stack->timer_config;
}
void belle_sip_stack_set_timer_config(belle_sip_stack_t *stack,const belle_sip_timer_config_t *timer_config){
belle_sip_message("Setting timer config to T1 [%i], T2 [%i], T3 [%i], T4 [%i] on stack [%p]", timer_config->T1
, timer_config->T2
, timer_config->T3
, timer_config->T4
, stack);
stack->timer_config=*timer_config;
}
void belle_sip_stack_set_transport_timeout(belle_sip_stack_t *stack, int timeout_ms){
stack->transport_timeout=timeout_ms;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment