diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index cc85eb679d7f30509ab5b69f685a640331887203..40de59c1847d7cdbf2d53c7ab6ca2f9b08c21e92 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1395,6 +1395,9 @@ static void sip_config_read(LinphoneCore *lc) { /*this is to filter out unsupported encryption schemes*/ linphone_core_set_media_encryption(lc,linphone_core_get_media_encryption(lc)); + /*enable the reconnection to the primary server when it is up again asap*/ + lc->sal->enable_reconnect_to_primary_asap(!!lp_config_get_int(lc->config,"sip","reconnect_to_primary_asap",0)); + /*for tuning or test*/ lc->sip_conf.sdp_200_ack = !!lp_config_get_int(lc->config,"sip","sdp_200_ack",0); lc->sip_conf.register_only_when_network_is_up= diff --git a/src/sal/sal.h b/src/sal/sal.h index bf9322d4842235f335ba56a405af286cfed2e2e9..3e48bc48127409960dc7cfbb0f050cfa9db72c38 100644 --- a/src/sal/sal.h +++ b/src/sal/sal.h @@ -171,6 +171,7 @@ public: void enable_test_features(bool_t enabled) {this->_enable_test_features=enabled;} void use_no_initial_route(bool_t enabled) {this->no_initial_route=enabled;} void enable_unconditional_answer(int value) {belle_sip_provider_enable_unconditional_answer(this->prov,value);} + void enable_reconnect_to_primary_asap(bool_t enabled) {belle_sip_stack_enable_reconnect_to_primary_asap(this->stack,enabled);} bctbx_list_t *get_pending_auths() const {return bctbx_list_copy(this->pending_auths);}