Ejemplo n.º 1
0
        private IntPtr CreateNatPolicy(NatPolicy natPolicy)
        {
            var result = NetworkModule.linphone_core_create_nat_policy(LinphoneCore);

            result = NetworkModule.linphone_nat_policy_ref(result);

            NetworkModule.linphone_nat_policy_enable_stun(result, natPolicy.UseSTUN);
            NetworkModule.linphone_nat_policy_enable_turn(result, natPolicy.UseTURN);
            NetworkModule.linphone_nat_policy_enable_ice(result, natPolicy.UseICE);
            NetworkModule.linphone_nat_policy_enable_upnp(result, natPolicy.UseUPNP);

            if (!string.IsNullOrEmpty(natPolicy.Server))
            {
                NetworkModule.linphone_nat_policy_set_stun_server(result, natPolicy.Server);
                NetworkModule.linphone_nat_policy_resolve_stun_server(result);
            }

            return(result);
        }