Commit e597db56 authored by jehan's avatar jehan
Browse files

add sal keep alive implementation

parent 94dc3527
......@@ -472,6 +472,7 @@ int sal_add_listen_port(Sal *ctx, SalAddress* addr){
,sal_address_get_port_int(addr)
,sal_transport_to_string(sal_address_get_transport(addr)));
if (lp) {
belle_sip_listening_point_set_keep_alive(lp,ctx->keep_alive);
result = belle_sip_provider_add_listening_point(ctx->prov,lp);
} else {
return -1;
......@@ -511,7 +512,11 @@ void sal_set_user_agent(Sal *ctx, const char *user_agent){
}
/*keepalive period in ms*/
void sal_set_keepalive_period(Sal *ctx,unsigned int value){
ms_error("sal_set_keepalive_period not implemented yet");
const belle_sip_list_t* iterator;
ctx->keep_alive=value;
for (iterator=belle_sip_provider_get_listening_points(ctx->prov);iterator!=NULL;iterator=iterator->next) {
belle_sip_listening_point_set_keep_alive((belle_sip_listening_point_t*)iterator->data,ctx->keep_alive);
}
return ;
}
/**
......@@ -519,8 +524,7 @@ void sal_set_keepalive_period(Sal *ctx,unsigned int value){
* 0 desactiaved
* */
unsigned int sal_get_keepalive_period(Sal *ctx){
ms_fatal("sal_get_keepalive_period not implemented yet");
return -1;
return ctx->keep_alive;
}
void sal_use_session_timers(Sal *ctx, int expires){
ctx->session_expires=expires;
......
......@@ -33,6 +33,7 @@ struct Sal{
void *up; /*user pointer*/
int session_expires;
bool_t one_matching_codec;
unsigned int keep_alive;
};
typedef enum SalOpSate {
......
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