diff --git a/config.h.in b/config.h.in index f02cc79fbe78c37d852c38b9200915381b517dea..0962968911700cf59b15b3ff3e64c7ef917107e4 100644 --- a/config.h.in +++ b/config.h.in @@ -1,17 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define to 1 if you have the <Carbon/Carbon.h> header file. */ -#undef HAVE_CARBON_CARBON_H - -/* Define if you have the CoreAudio API */ -#undef HAVE_COREAUDIO - -/* Define to 1 if you have the <crt_externs.h> header file. */ -#undef HAVE_CRT_EXTERNS_H - -/* Defines if your system has the crypt function */ -#undef HAVE_CRYPT - /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H @@ -24,39 +12,15 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H -/* Define if you have libjpeg */ -#undef HAVE_LIBJPEG - -/* Define if you have libpng */ -#undef HAVE_LIBPNG - -/* Define if you have a working libpthread (will enable threaded code) */ -#undef HAVE_LIBPTHREAD - -/* Define if you have libz */ -#undef HAVE_LIBZ - /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H -/* Define if your system needs _NSGetEnviron to set up the environment */ -#undef HAVE_NSGETENVIRON - /* Define to 1 if you have the <ostream> header file. */ #undef HAVE_OSTREAM /* Define to 1 if you have the <portaudio.h> header file. */ #undef HAVE_PORTAUDIO_H -/* Define if you have res_init */ -#undef HAVE_RES_INIT - -/* Define if you have the res_init prototype */ -#undef HAVE_RES_INIT_PROTO - -/* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF - /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H @@ -69,21 +33,6 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H -/* Define if you have strlcat */ -#undef HAVE_STRLCAT - -/* Define if you have the strlcat prototype */ -#undef HAVE_STRLCAT_PROTO - -/* Define if you have strlcpy */ -#undef HAVE_STRLCPY - -/* Define if you have the strlcpy prototype */ -#undef HAVE_STRLCPY_PROTO - -/* Define to 1 if you have the <sys/bitypes.h> header file. */ -#undef HAVE_SYS_BITYPES_H - /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H @@ -93,12 +42,6 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if you have the `vsnprintf' function. */ -#undef HAVE_VSNPRINTF - -/* Suffix for lib directories */ -#undef KDELIBSUFF - /* Name of package */ #undef PACKAGE @@ -117,127 +60,8 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of a `char *', as computed by sizeof. */ -#undef SIZEOF_CHAR_P - -/* The size of a `int', as computed by sizeof. */ -#undef SIZEOF_INT - -/* The size of a `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of a `short', as computed by sizeof. */ -#undef SIZEOF_SHORT - -/* The size of a `size_t', as computed by sizeof. */ -#undef SIZEOF_SIZE_T - -/* The size of a `unsigned long', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_LONG - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION - -/* - * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system - * headers and I'm too lazy to write a configure test as long as only - * unixware is related - */ -#ifdef _UNIXWARE -#define HAVE_BOOLEAN -#endif - - - -/* - * AIX defines FD_SET in terms of bzero, but fails to include <strings.h> - * that defines bzero. - */ - -#if defined(_AIX) -#include <strings.h> -#endif - - - -#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) -# include <sys/time.h> -# include <crt_externs.h> -# define environ (*_NSGetEnviron()) -#endif - - - -#if !defined(HAVE_RES_INIT_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -int res_init(void); -#ifdef __cplusplus -} -#endif -#endif - - - -#if !defined(HAVE_STRLCAT_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -unsigned long strlcat(char*, const char*, unsigned long); -#ifdef __cplusplus -} -#endif -#endif - - - -#if !defined(HAVE_STRLCPY_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -unsigned long strlcpy(char*, const char*, unsigned long); -#ifdef __cplusplus -} -#endif -#endif - - - -/* - * On HP-UX, the declaration of vsnprintf() is needed every time ! - */ - -#if !defined(HAVE_VSNPRINTF) || defined(hpux) -#if __STDC__ -#include <stdarg.h> -#include <stdlib.h> -#else -#include <varargs.h> -#endif -#ifdef __cplusplus -extern "C" -#endif -int vsnprintf(char *str, size_t n, char const *fmt, va_list ap); -#ifdef __cplusplus -extern "C" -#endif -int snprintf(char *str, size_t n, char const *fmt, ...); -#endif - - - -#if defined(__SVR4) && !defined(__svr4__) -#define __svr4__ 1 -#endif - - -/* type to use in place of socklen_t if not defined */ -#undef kde_socklen_t - -/* type to use in place of socklen_t if not defined (deprecated, use - kde_socklen_t) */ -#undef ksize_t diff --git a/configure.ac b/configure.ac index c2f8bcafb905535f75c45872e112a06ca7470dd7..2f4b1ef02ffd443abf11cfc7f9207282703666d9 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_LANG_CPLUSPLUS AC_PROG_CXX AC_PROG_CC -AC_PATH_QT +dnl AC_PATH_QT dnl KDE_USE_QT(3.3) AC_CANONICAL_SYSTEM AC_ARG_PROGRAM @@ -73,7 +73,8 @@ PKG_CHECK_MODULES(libccrtp1, libccrtp1 >= ${LIBCCRT_MIN_VERSION}) SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccrtp1_CFLAGS" SFLPHONE_LIBS="$SFLPHONE_LIBS $libccrtp1_LIBS" -LIBOSIP2_MIN_VERSION=2.2.0 +dnl 2.2.0 is buggy, header corruption +LIBOSIP2_MIN_VERSION=2.2.1 PKG_CHECK_MODULES(libosip2, libosip2 >= ${LIBOSIP2_MIN_VERSION}) SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libosip2_CFLAGS" SFLPHONE_LIBS="$SFLPHONE_LIBS $libosip2_LIBS" @@ -87,29 +88,7 @@ AC_CHECK_LIB([eXosip2], [eXosip_init],[libexosip2_LIBS="-leXosip2 "],[ SFLPHONE_LIBS="$SFLPHONE_LIBS $libexosip2_LIBS" -AC_SUBST(LIBQT) - -dnl if test $ac_cv_header_gsm_h = no; then -dnl AC_MSG_ERROR([*** missing gsm.h. You need a working GSM 06.10 lossy speech compression installation. See http://kbs.cs.tu-berlin.de/~jutta/toast.html]) -dnl fi -dnl SFLPHONE_LIBS="$SFLPHONE_LIBS -lgsm" - -AC_MSG_CHECKING([whether to enable the maintener code]) -AC_ARG_ENABLE(maintener, -[ --enable-maintener Enable maintener code [default=no]], -[ -CXXFLAGS="$CXXFLAGS -DENABLE_MAINTENER" -AC_MSG_RESULT(yes) -maintener="yes" -], -[ -AC_MSG_RESULT(no) -maintener="no" -] -) - -AM_CONDITIONAL(MAINTENER_CODE, test x$maintener = xyes) - +dnl AC_SUBST(LIBQT) AC_MSG_CHECKING([whether to enable the new gui]) AC_ARG_ENABLE(newgui, diff --git a/src/Makefile.am b/src/Makefile.am index c670e9231c807fb866f433a31ed51d0b800ee345..cc53ed1b99ac4a0043f2dd4cbfea035a9c4b3a69 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,9 +1,5 @@ bin_PROGRAMS = sflphone -if MAINTENER_CODE -maintener_source = -endif - if USE_ZEROCONF ZEROCONFDIR = zeroconf ZEROCONFLIB = zeroconf/libzeroconf.la @@ -20,16 +16,13 @@ sflphone_SOURCES = call.cpp eventthread.cpp error.cpp main.cpp sipvoiplink.c sipcall.cpp managerimpl.cpp managerimpl.h manager.h global.h \ eventthread.h error.h \ sipvoiplink.h user_cfg.h call.h voIPLink.h sipcall.h \ - ${maintener_source} observer.cpp - - - + observer.cpp sflphone_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(ZEROCONFFLAGS) -sflphone_LDFLAGS = $(QT_LDFLAGS) $(X_LDFLAGS) -static -sflphone_LDADD = gui/libguiframework.la audio/libaudio.la ../stund/libstun.la ../utilspp/libutilspp.la -lpthread $(LIBQT) $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) config/libconfig.la +sflphone_LDFLAGS = -static +sflphone_LDADD = gui/libguiframework.la audio/libaudio.la ../stund/libstun.la ../utilspp/libutilspp.la -lpthread $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) config/libconfig.la KDE_CXXFLAGS = $(USE_EXCEPTIONS) -AM_CPPFLAGS = $(QT_INCLUDES) $(X_INCLUDES) -I$(top_srcdir) -Igui/qt -I$(srcdir)/audio/pacpp/include $(libccext2_CFLAGS) $(libccgnu2_CFLAGS) $(portaudio_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir)/audio/pacpp/include $(libccext2_CFLAGS) $(libccgnu2_CFLAGS) $(portaudio_CFLAGS) noinst_HEADERS = observer.h diff --git a/src/audio/audiortp.cpp b/src/audio/audiortp.cpp index 4bee10d241f001ae3533d08eb6ef6a4700ad2f02..6679891262217f4fd71015655b69f3e83c19abe3 100644 --- a/src/audio/audiortp.cpp +++ b/src/audio/audiortp.cpp @@ -55,15 +55,14 @@ int AudioRtp::createNewSession (SipCall *ca) { // Start RTP Send/Receive threads ca->enable_audio = 1; - if (!Manager::instance().useStun()) { - _symetric = false; + if (Manager::instance().getConfigInt(SIGNALISATION,SYMMETRIC)) { + _symmetric = true; } else { - _symetric = true; + _symmetric = false; } - _RTXThread = new AudioRtpRTX (ca, - Manager::instance().getAudioDriver(), - _symetric); + _RTXThread = new AudioRtpRTX (ca, Manager::instance().getAudioDriver(), + _symmetric); // Start PortAudio Manager::instance().getAudioDriver()->micRingBuffer().flush(); diff --git a/src/audio/audiortp.h b/src/audio/audiortp.h index d32960312cb7b550577b7ea4dbb5cd54460a3034..273136cdd6ae72ed4e0297f79bf7492632c6e1c5 100644 --- a/src/audio/audiortp.h +++ b/src/audio/audiortp.h @@ -70,7 +70,7 @@ public: private: AudioRtpRTX* _RTXThread; - bool _symetric; + bool _symmetric; }; #endif // __AUDIO_RTP_H__ diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 3ce1285f1ef1e1ef1c1f9a24f644446f78ed187d..29e071920f3943818419263928656a74178fd12b 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,14 +1,5 @@ -if NEWGUI_CODE -officialdir = official -endif -if MAINTENER_CODE serverdir = server serverlib = server/libsflphoneguiserver.la -else -serverdir = qt -serverlib = qt/libsflphoneqt.la -endif - SUBDIRS = $(serverdir) diff --git a/src/gui/server/requestmanager.cpp b/src/gui/server/requestmanager.cpp index 0ee3725ea19bedc9019229026fbfa6bc5169e3e8..d3391117bb956aa6738945cde9187035c5111b58 100644 --- a/src/gui/server/requestmanager.cpp +++ b/src/gui/server/requestmanager.cpp @@ -18,10 +18,9 @@ */ #include "requestmanager.h" -#include <iostream> - #include "tcpsessionio.h" #include "../../global.h" +#include <iostream> RequestManager::RequestManager() : _sessionIO(0) { @@ -40,9 +39,6 @@ int RequestManager::exec() { try { - // waiting for a new connection - std::cout << "waiting for a new connection..." << std::endl; - while(std::cin.good()) { // TCPSessionIO start a thread for the stream socket @@ -51,8 +47,6 @@ RequestManager::exec() _sessionIO = new TCPSessionIO(); _sessionMutex.leaveMutex(); } - // wait for the first message - std::cout << "accepting connection..." << std::endl; ResponseMessage outputResponse; // TCPStream output line std::string input; diff --git a/src/main.cpp b/src/main.cpp index d9119195e3808c91f96fe31fb0cf707bdbfc3957..6733d4837b401dbb016861bd1f5d1dafbc663832 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,27 +19,15 @@ */ #include "user_cfg.h" - -#if defined(ENABLE_MAINTENER) -# include "gui/server/guiserver.h" -#elif defined(GUI_QT) -# include <qapplication.h> -# include "gui/qt/qtGUImainwindow.h" -#elif defined(GUI_COCOA) -# error "GUI_COCOA not implemented yet." -#endif - +#include "gui/server/guiserver.h" #include "gui/guiframework.h" #include "manager.h" - int main (int argc, char **argv) { int exit_code = 0; - //Config::setTree(new ConfigurationTree()); GuiFramework *GUI; -#if defined(ENABLE_MAINTENER) { bool initOK = false; try { @@ -51,6 +39,7 @@ main (int argc, char **argv) { std::cerr << "An exception occured when initializing the system." << std::endl; + exit_code = -1; } if (initOK) { GUI = &(GUIServer::instance()); @@ -60,38 +49,9 @@ main (int argc, char **argv) { delete GUI; } } -#elif defined(GUI_QT) - { - QApplication a(argc, argv); - Manager::instance().initConfigFile(); - - try { - Manager::instance().init(); - } - catch (const exception &e) { - std::cerr << e.what() << std::endl; - } - catch (...) { - std::cerr << - "An unknown exception occured when initializing the system." << - std::endl; - } - - GUI = new QtGUIMainWindow (0, 0 , - Qt::WDestructiveClose | - Qt::WStyle_Customize | - Qt::WStyle_NoBorder); - Manager::instance().setGui(GUI); - - a.setMainWidget((QtGUIMainWindow*)GUI); - exit_code = a.exec(); - Manager::instance().terminate(); - } - -#endif return exit_code; } - // EOF + diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 3f628de698c84cd4db6ba3822b0e6b4e1fab67f9..2c61066dc405bcc3336fc1d88b68f32e6e140f0a 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -1156,6 +1156,7 @@ ManagerImpl::initConfigFile (void) std::string section; section = SIGNALISATION; fill_config_int(VOIP_LINK_ID, DFT_VOIP_LINK_STR); + fill_config_int(SYMMETRIC, YES_STR); fill_config_str(FULL_NAME, EMPTY_FIELD); fill_config_str(USER_PART, EMPTY_FIELD); fill_config_str(AUTH_USER_NAME, EMPTY_FIELD); diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index fd41020e4fcaea33053d198a1fb2cd690e9ebc03..2b4ae0ad4973ffa9d01c039e27937618d3adc321 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -101,13 +101,13 @@ SipVoIPLink::init (void) if (behindNat() != 1) { return 0; } - + // This method is used to replace contact address with the public address of your NAT. eXosip_masquerade_contact((Manager::instance().getFirewallAddress()).data(), Manager::instance().getFirewallPort()); - } - - // Set user agent - eXosip_set_user_agent(tmp.data()); + } else { + // Set user agent + eXosip_set_user_agent(tmp.data()); + } _evThread->start(); return 1; @@ -135,8 +135,6 @@ SipVoIPLink::setRegister (void) { ManagerImpl& manager = Manager::instance(); - _debug("SipVoIPLink::setRegister()\n"); - // all this will be inside the profil associate with the voip link std::string proxy = "sip:" + manager.getConfigString(SIGNALISATION, PROXY); std::string hostname = "sip:" + manager.getConfigString(SIGNALISATION, HOST_PART); @@ -563,8 +561,7 @@ SipVoIPLink::getEvent (void) } int returnValue = 0; - _debug("GetEvent : %d\n", event->type); - + _debug("GetEvent : %d ", event->type); switch (event->type) { // IP-Phone user receives a new call case EXOSIP_CALL_INVITE: // @@ -805,11 +802,11 @@ SipVoIPLink::getEvent (void) break; case EXOSIP_REGISTRATION_SUCCESS: // 1 - Manager::instance().displayStatus(LOGGED_IN_STATUS); + //Manager::instance().displayStatus(LOGGED_IN_STATUS); break; case EXOSIP_REGISTRATION_FAILURE: // 2 - Manager::instance().displayError("getEvent : Registration Failure"); + //Manager::instance().displayError("getEvent : Registration Failure"); break; case EXOSIP_MESSAGE_NEW: @@ -889,7 +886,7 @@ SipVoIPLink::getEvent (void) returnValue = -1; break; } - _debug("End of GetEvent : %d / %d\n", event->type, returnValue); + _debug(" : end event : %d / %d\n", event->type, returnValue); eXosip_event_free(event); return returnValue; @@ -1170,9 +1167,7 @@ SipVoIPLink::behindNat (void) stunSvrAddr.addr = 0; // Stun server - string svr = -Manager::instance().getConfigString(SIGNALISATION, -STUN_SERVER); + string svr = Manager::instance().getConfigString(SIGNALISATION, STUN_SERVER); // Convert char* to StunAddress4 structure bool ret = stunParseServerName ((char*)svr.data(), stunSvrAddr); diff --git a/src/sipvoiplink.h b/src/sipvoiplink.h index c5f2fd92fcf3b2a10a6d79ebd10855a3afe5b6aa..51ae748ea919275710b47c3a38d3f82f7243a86e 100644 --- a/src/sipvoiplink.h +++ b/src/sipvoiplink.h @@ -54,6 +54,7 @@ using namespace std; #define ADDR_INCOMPLETE 484 #define BUSY_HERE 486 #define REQ_TERMINATED 487 +#define NOT_ACCEPTABLE_HERE 488 // Not Acceptable Here // 5XX errors #define SERVICE_UNAVAILABLE 503 // 6XX errors diff --git a/src/user_cfg.h b/src/user_cfg.h index 144d2e976f10256adb72632a0537daf70498291d..6f04c2f9e2a5c0e80223a0f8f5475925fac06266 100644 --- a/src/user_cfg.h +++ b/src/user_cfg.h @@ -37,6 +37,8 @@ // Fields to fill #define VOIP_LINK_ID "VoIPLink.index" +#define SYMMETRIC "VoIPLink.symmetric" + #define FULL_NAME "SIP.fullName" #define USER_PART "SIP.userPart" #define AUTH_USER_NAME "SIP.username"