diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 651eca134..ee7c7b90c 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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); diff --git a/coreapi/sal.c b/coreapi/sal.c index 92b82d52c..b237e9ad9 100644 --- a/coreapi/sal.c +++ b/coreapi/sal.c @@ -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); } + diff --git a/coreapi/sal.h b/coreapi/sal.h index af1ddc367..647353214 100644 --- a/coreapi/sal.h +++ b/coreapi/sal.h @@ -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); diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 42574dc8f..9836c7dfe 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -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; +} diff --git a/coreapi/sal_eXosip2.h b/coreapi/sal_eXosip2.h index a050f5133..201cb65a9 100644 --- a/coreapi/sal_eXosip2.h +++ b/coreapi/sal_eXosip2.h @@ -44,6 +44,7 @@ struct Sal{ bool_t double_reg; bool_t use_rports; bool_t use_101; + bool_t reuse_authorization; }; struct SalOp{