]> sjero.net Git - linphone/commitdiff
Add warning when trying to set uPnP as firewall policy and uPnP is not available
authorYann Diorcet <yann.diorcet@belledonne-communications.com>
Wed, 13 Feb 2013 11:20:45 +0000 (12:20 +0100)
committerYann Diorcet <yann.diorcet@belledonne-communications.com>
Wed, 13 Feb 2013 11:20:45 +0000 (12:20 +0100)
coreapi/linphonecore.c

index 1be92ef30de86b1c408688c63baaa8cbdf9f75f9..1cd6436f9dd61708158ee81f9c668e07b7885e1a 100644 (file)
@@ -4206,6 +4206,12 @@ const char *linphone_core_get_nat_address_resolved(LinphoneCore *lc)
 }
 
 void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPolicy pol){
+#ifndef BUILD_UPNP
+       if(pol == LinphonePolicyUseUpnp) {
+               ms_warning("UPNP is not available, reset firewall policy to no firewall");
+               pol = LinphonePolicyNoFirewall;
+       }
+#endif //BUILD_UPNP
        lc->net_conf.firewall_policy=pol;
        if (lc->sip_conf.contact) update_primary_contact(lc);
        if (linphone_core_ready(lc))