Commit 044ddc63 authored by jehan's avatar jehan
Browse files

add sip option reuse_authorization to reuse authorization header for subsequente register

parent 8ba552ab
......@@ -466,6 +466,7 @@ static void sip_config_read(LinphoneCore *lc)
sal_use_rport(lc->sal,lp_config_get_int(lc->config,"sip","use_rport",1));
sal_use_101(lc->sal,lp_config_get_int(lc->config,"sip","use_101",1));
sal_reuse_authorization(lc->sal, lp_config_get_int(lc->config,"sip","reuse_authorization",0));
tmp=lp_config_get_int(lc->config,"sip","use_rfc2833",0);
linphone_core_set_use_rfc2833_for_dtmf(lc,tmp);
......
......@@ -329,3 +329,4 @@ void sal_auth_info_delete(const SalAuthInfo* auth_info) {
if (auth_info->password) ms_free(auth_info->password);
ms_free((void*)auth_info);
}
......@@ -267,6 +267,7 @@ void sal_set_keepalive_period(Sal *ctx,unsigned int value);
unsigned int sal_get_keepalive_period(Sal *ctx);
void sal_use_session_timers(Sal *ctx, int expires);
void sal_use_double_registrations(Sal *ctx, bool_t enabled);
void sal_reuse_authorization(Sal *ctx, bool_t enabled);
void sal_use_one_matching_codec_policy(Sal *ctx, bool_t one_matching_codec);
void sal_use_rport(Sal *ctx, bool_t use_rports);
void sal_use_101(Sal *ctx, bool_t use_101);
......
......@@ -279,6 +279,7 @@ Sal * sal_init(){
sal->double_reg=TRUE;
sal->use_rports=TRUE;
sal->use_101=TRUE;
sal->reuse_authorization=FALSE;
return sal;
}
......@@ -793,7 +794,7 @@ int sal_call_terminate(SalOp *h){
eXosip_lock();
err=eXosip_call_terminate(h->cid,h->did);
eXosip_unlock();
pop_auth_from_exosip();
if (!h->base.root->reuse_authorization) pop_auth_from_exosip();
if (err!=0){
ms_warning("Exosip could not terminate the call: cid=%i did=%i", h->cid,h->did);
}
......@@ -816,7 +817,7 @@ void sal_op_authenticate(SalOp *h, const SalAuthInfo *info){
eXosip_default_action(h->pending_auth);
eXosip_unlock();
ms_message("eXosip_default_action() done");
pop_auth_from_exosip();
if (!h->base.root->reuse_authorization) pop_auth_from_exosip();
if (h->auth_info) sal_auth_info_delete(h->auth_info); /*if already exist*/
h->auth_info=sal_auth_info_clone(info); /*store auth info for subsequent request*/
......@@ -2206,3 +2207,6 @@ int sal_call_update(SalOp *h, const char *subject){
eXosip_unlock();
return err;
}
void sal_reuse_authorization(Sal *ctx, bool_t value) {
ctx->reuse_authorization=value;
}
......@@ -44,6 +44,7 @@ struct Sal{
bool_t double_reg;
bool_t use_rports;
bool_t use_101;
bool_t reuse_authorization;
};
struct SalOp{
......
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