--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,22 +13,15 @@
 PROJECT(bayonne)
 INCLUDE(CheckIncludeFiles)
 INCLUDE(CheckFunctionExists)
-INCLUDE(CheckLibraryExists)
-
-set (VERSION 2.99.2)
-
-set(RC_VERSION ${VERSION})
-STRING(REGEX REPLACE "[.]" "," RC_VERSION ${RC_VERSION})
-set(RC_VERSION "${RC_VERSION},0")
-
-set(SOVERSION ${VERSION})
-STRING(REGEX REPLACE "[.].*$" "" SOVERSION ${SOVERSION})
+
+set (VERSION 3.0.0)
 
 # when we override default install prefix, assume full path is used...
 
 set(INSTALL_INCLUDEDIR include)
 set(INSTALL_BINDIR bin)
 set(INSTALL_SBINDIR sbin)
+set(INSTALL_LIBEXEC libexec)
 
 if(WIN32)
     set(INSTALL_MANDIR man)
@@ -39,7 +32,6 @@
     set(SYSCONFDIR "etc" CACHE PATH "config directory")
     set(STATEDIR "var" CACHE PATH "state directory")
 else()
-    set(INSTALL_DATADIR share)
     set(INSTALL_MANDIR share/man)
     set(INSTALL_LOCALE share/locale)
     set(INSTALL_DOCDIR share/doc/${PROJECT_NAME})
@@ -50,18 +42,19 @@
 endif()
 
 if(WIN32)
-    set(BAYONNE_CFGPATH "${CMAKE_INSTALL_PREFIX}/${SYSCONFDIR}")
-    set(BAYONNE_LIBEXEC ${CMAKE_INSTALL_PREFIX}/libexec)
+    set(DEFAULT_CFGPATH "${CMAKE_INSTALL_PREFIX}/${SYSCONFDIR}")
     set(DEFAULT_VARPATH "${CMAKE_INSTALL_PREFIX}/${STATEDIR}")
-else()
-    set(BAYONNE_CFGPATH ${SYSCONFDIR}/bayonne)
-    set(BAYONNE_LIBEXEC ${CMAKE_INSTALL_PREFIX}/libexec/bayonne)
+    set(DEFAULT_DATADIR ${CMAKE_INSTALL_PREFIX})
+else()
+    set(DEFAULT_CFGPATH ${SYSCONFDIR})
     set(DEFAULT_VARPATH ${STATEDIR})
-endif()
-
-set(DEFAULT_DATADIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_DATADIR})
+    set(DEFAULT_DATADIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_DATADIR})
+endif()
+
 set(DEFAULT_PAGING 4096)
 set(DEFAULT_LIBPATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBDIR})
+set(DEFAULT_SCRPATH ${DEFAULT_CFGPATH}/bayonne.d)
+set(DEFAULT_LIBEXEC ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBEXEC})
 
 if (WIN32)
     set(BUILD_STATIC ON CACHE BOOL "static linking only" FORCE)
@@ -80,14 +73,10 @@
 else()
     option(BUILD_STATIC "Set to ON to build static libraries" OFF)
     option(HAVE_SIGWAIT2 "Set to OFF to build with single argument" ON)
-    MARK_AS_ADVANCED(HAVE_SIGWAIT2)
     set(HAVE_SIGWAIT true)
     option(EXOSIP2_TLS "Set to OFF to disable eXosip2 TLS support check" ON)
 endif()
 
-MARK_AS_ADVANCED(EXOSIP2_TLS)
-
-option(BUILD_TESTING "Set to ON to build test programs" OFF)
 MESSAGE( STATUS "Configuring GNU bayonne ${VERSION}...")
 
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME} server")
@@ -136,7 +125,7 @@
 
 # Set defaults and pass common options.  Common build options can be passed
 # to cmake using cmake -DWITH_CFLAGS="...", WITH_LIBS, and WITH_INCLUDES
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc ${WITH_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/server)
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/inc ${WITH_INCLUDES})
 add_definitions(${WITH_CFLAGS})
 link_libraries(${WITH_LIBS})
 
@@ -144,7 +133,7 @@
     message(STATUS "  Using local ucommon dependency")
 else()
     find_package(PkgConfig)
-    pkg_check_modules(USES_UCOMMON REQUIRED ucommon>=6.0.0)
+    pkg_check_modules(USES_UCOMMON REQUIRED ucommon>=4.0.1)
 endif()
 
 include_directories(${USES_UCOMMON_INCLUDE_DIRS})
@@ -164,56 +153,13 @@
     set(BUILD_RUNTIME_TYPE ${BUILD_LIBRARY_TYPE})
 endif()
 
-check_include_files(sys/inotify.h HAVE_SYS_INOTIFY_H)
 check_include_files(sys/resource.h HAVE_SYS_RESOURCE_H)
 check_include_files(pwd.h HAVE_PWD_H)
-check_include_files(speex/speex.h HAVE_SPEEX_SPEEX_H)
-check_include_files(gsm.h HAVE_GSM_H)
-check_include_files(gsm/gsm.h HAVE_GSM_GSM_H)
-check_include_files(endian.h HAVE_ENDIAN_H)
-check_include_files(math.h HAVE_MATH_H)
-check_include_files(stdint.h HAVE_STDINT_H)
-check_include_files(termios.h HAVE_TERMIOS_H)
-check_include_files(ioctl.h HAVE_IOCTL_H)
-check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H)
-check_include_files(sys/poll.h HAVE_SYS_POLL_H)
-check_include_files(sys/uio.h HAVE_SYS_UIO_H)
 check_include_files(eXosip2/eXosip.h HAVE_EXOSIP2)
-check_include_files(srtp/srtp.h HAVE_SRTP)
-check_include_files(ortp/ortp.h HAVE_ORTP)
-#check_include_files(vpbapi.h HAVE_VPBAPI)
-#check_include_files(capi20.h HAVE_CAPI20)
-#check_include_files(sys/telephony.h HAVE_SYS_TELEPHONY_H)
-#check_include_files(linux/telephony.h HAVE_LINUX_TELEPHONY_H)
-#check_include_files(sys/ixjuser.h HAVE_SYS_IXJUSER_H)
-#check_include_files(linux/ixjuser.h HAVE_LINUX_IXJUSER_H)
 check_function_exists(setrlimit HAVE_SETRLIMIT)
 check_function_exists(setpgrp HAVE_SETPGRP)
 check_function_exists(getuid HAVE_GETUID)
 check_function_exists(mkfifo HAVE_MKFIFO)
-
-check_library_exists(m sqrt "" MATH_LIB)
-if(MATH_LIB)
-    set(EXPORT_LIBS ${EXPORT_LIBS} m)
-endif()
-
-if(WIN32 AND NOT MINGW AND NOT MSYS AND NOT CYGWIN)
-    if(HAVE_SPEEX_SPEEX_H)
-        set(EXPORT_LIBS ${EXPORT_LIBS} libspeex)
-    endif()
-
-    if(HAVE_GSM_H OR HAVE_GSM_GSM_H)
-        set(EXPORT_LIBS ${EXPORT_LIBS} libgsm)
-    endif()
-else()
-    if(HAVE_SPEEX_SPEEX_H)
-        set(EXPORT_LIBS ${EXPORT_LIBS} speex)
-    endif()
-
-    if(HAVE_GSM_H OR HAVE_GSM_GSM_H)
-        set(EXPORT_LIBS ${EXPORT_LIBS} gsm)
-    endif()
-endif()
 
 if(NOT HAVE_EXOSIP2)
     set(EXOSIP2_TLS OFF CACHE BOOL "no tls if no exosip2" FORCE)
@@ -234,46 +180,26 @@
     set(EXOSIP2_LIBS eXosip2 osip2 osipparser2)
 endif()
 
-if(HAVE_ORTP)
-    if(WIN32)
-        set(ORTP_LIBS ortp winmm)
-    else()
-        set(ORTP_LIBS ortp)
-    endif()
-endif()
-
 check_include_files(resolv.h HAVE_RESOLV)
 if(HAVE_RESOLV)
     set(EXOSIP2_LIBS ${EXOSIP2_LIBS} resolv)
 endif()
 
 if(HAVE_EXOSIP2 AND WIN32 AND NOT CYGWIN)
-    set(EXOSIP2_LIBS ${EXOSIP2_LIBS} iphlpapi dnsapi)
-endif()
-
-configure_file(bayonne-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/bayonne-config.h)
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
-file(GLOB runtime_src runtime/*.cpp)
-file(GLOB runtime_inc inc/bayonne.h)
-
-add_library(bayonne-runtime ${BUILD_RUNTIME_TYPE} ${runtime_src} ${runtime_inc})
+    set(EXOSIP2_LIBS ${EXOSIP2_LIBS} Iphlpapi dnsapi)
+endif()
+
+configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+
+file(GLOB engine_src engine/*.cpp)
+file(GLOB engine_inc inc/bayonne.h)
+
+add_library(bayonne-runtime ${BUILD_RUNTIME_TYPE} ${engine_src} ${engine_inc})
 set_target_properties(bayonne-runtime PROPERTIES OUTPUT_NAME bayonne)
 add_dependencies(bayonne-runtime ucommon)
-target_link_libraries(bayonne-runtime ${EXPORT_LIBS} ${USES_UCOMMON_LIBRARIES})
-
-add_subdirectory(server)
-add_subdirectory(utils)
-
-if(BUILD_TESTING)
-    ENABLE_TESTING()
-    add_subdirectory(test)
-endif()
-
-if(HAVE_EXOSIP2 AND HAVE_ORTP)
-    add_subdirectory(sipwitch)
-endif()
+target_link_libraries(bayonne-runtime ${USES_UCOMMON_LIBRARIES})
 
 install(TARGETS bayonne-runtime DESTINATION ${INSTALL_LIBDIR})
 
 
+