mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 04:58:14 +00:00
Disable keep alive when using uPnP
This commit is contained in:
parent
9cb68a7d8d
commit
61e01c6bc1
1 changed files with 10 additions and 3 deletions
|
|
@ -4239,7 +4239,9 @@ void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPolicy
|
|||
ms_warning("UPNP is not available, reset firewall policy to no firewall");
|
||||
pol = LinphonePolicyNoFirewall;
|
||||
}
|
||||
#else //BUILD_UPNP
|
||||
#endif //BUILD_UPNP
|
||||
lc->net_conf.firewall_policy=pol;
|
||||
#ifdef BUILD_UPNP
|
||||
if(pol == LinphonePolicyUseUpnp) {
|
||||
if(lc->upnp == NULL) {
|
||||
lc->upnp = linphone_upnp_context_new(lc);
|
||||
|
|
@ -4249,9 +4251,9 @@ void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPolicy
|
|||
linphone_upnp_context_destroy(lc->upnp);
|
||||
lc->upnp = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
linphone_core_enable_keep_alive(lc, (lc->sip_conf.keepalive_period > 0));
|
||||
#endif //BUILD_UPNP
|
||||
lc->net_conf.firewall_policy=pol;
|
||||
if (lc->sip_conf.contact) update_primary_contact(lc);
|
||||
if (linphone_core_ready(lc))
|
||||
lp_config_set_int(lc->config,"net","firewall_policy",pol);
|
||||
|
|
@ -5490,6 +5492,11 @@ const char *linphone_error_to_string(LinphoneReason err){
|
|||
* Enables signaling keep alive
|
||||
*/
|
||||
void linphone_core_enable_keep_alive(LinphoneCore* lc,bool_t enable) {
|
||||
#ifdef BUILD_UPNP
|
||||
if (linphone_core_get_firewall_policy(lc)==LinphonePolicyUseUpnp) {
|
||||
enable = FALSE;
|
||||
}
|
||||
#endif //BUILD_UPNP
|
||||
if (enable > 0) {
|
||||
sal_use_tcp_tls_keepalive(lc->sal,lc->sip_conf.tcp_tls_keepalive);
|
||||
sal_set_keepalive_period(lc->sal,lc->sip_conf.keepalive_period);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue