Cleaning compilation and debug message

This commit is contained in:
yanmorin
2005-10-06 21:02:28 +00:00
parent 702b844520
commit b04dfa7c3f
12 changed files with 32 additions and 293 deletions

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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();

View File

@ -70,7 +70,7 @@ public:
private:
AudioRtpRTX* _RTXThread;
bool _symetric;
bool _symmetric;
};
#endif // __AUDIO_RTP_H__

View File

@ -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)

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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"