Commit 3d4b68c5 authored by yanmorin's avatar yanmorin

New libiax2 implementation
parent f67704cb
......@@ -11,35 +11,43 @@ ZEROCONFLIB =
ZEROCONFFLAGS =
endif
IAX_LIBS = $(top_builddir)/libs/libiax2/src/libiax.la
IAX_FLAGS = -DUSE_IAX
IAX_CFLAGS = -I$(top_srcdir)/libs/libiax2/src/
IAXSOURCES = iaxvoiplink.cpp
IAXHEADERS = iaxvoiplink.h
SUBDIRS = audio config gui $(ZEROCONFDIR)
sflphoned_SOURCES = eventthread.cpp main.cpp voIPLink.cpp \
managerimpl.cpp observer.cpp \
account.cpp sipaccount.cpp iaxaccount.cpp accountcreator.cpp iaxvoiplink.cpp \
sipvoiplink.cpp call.cpp sipcall.cpp
account.cpp sipaccount.cpp iaxaccount.cpp accountcreator.cpp \
sipvoiplink.cpp call.cpp sipcall.cpp \
$(IAXSOURCES)
sflphoned_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(ZEROCONFFLAGS)
sflphoned_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(ZEROCONFFLAGS) $(IAX_FLAGS)
#sflphoned_LDFLAGS = -static
sflphoned_LDADD = ./libsflphone.la $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD)
#KDE_CXXFLAGS = $(USE_EXCEPTIONS)
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libs -I$(srcdir)/audio/pacpp/include $(libccext2_CFLAGS) $(libccgnu2_CFLAGS) $(portaudio_CFLAGS) -I$(top_srcdir)/libs/portaudio/pa_common
sflphoned_LDADD = ./libsflphone.la $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS)
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libs -I$(srcdir)/audio/pacpp/include $(libccext2_CFLAGS) $(libccgnu2_CFLAGS) $(portaudio_CFLAGS) -I$(top_srcdir)/libs/portaudio/pa_common $(IAX_CFLAGS)
#libsflphone_la_LDFLAGS= -version-info 0:1:0
libsflphone_la_LIBADD = \
$(top_builddir)/libs/eXosip2/libeXosip2.la \
$(top_builddir)/libs/portaudio/libportaudio.la \
$(top_builddir)/libs/stund/libstun.la \
$(top_builddir)/libs/utilspp/libutilspp.la \
$(top_builddir)/libs/portaudio/libportaudio.la \
./audio/libaudio.la \
./gui/libguiframework.la \
./config/libconfig.la
./config/libconfig.la \
$(IAX_LIBS)
libsflphone_la_SOURCES =
noinst_LTLIBRARIES = libsflphone.la
noinst_HEADERS = managerimpl.h manager.h global.h observer.h eventthread.h user_cfg.h \
voIPLink.h \
account.h sipaccount.h iaxaccount.h accountcreator.h iaxvoiplink.h \
sipvoiplink.h call.h sipcall.h
account.h sipaccount.h iaxaccount.h accountcreator.h \
sipvoiplink.h call.h sipcall.h \
$(IAXHEADERS)
......@@ -17,6 +17,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "iaxvoiplink.h"
#include "global.h" // for _debug
#define IAX_SUCCESS 0
#define IAX_FAILURE -1
IAXVoIPLink::IAXVoIPLink(const AccountID& accountID)
: VoIPLink(accountID)
......@@ -28,4 +32,30 @@ IAXVoIPLink::~IAXVoIPLink()
{
}
bool
IAXVoIPLink::init()
{
bool returnValue = false;
//_localAddress = "127.0.0.1";
// port 0 is default
iax_enable_debug();
int port = iax_init(IAX_DEFAULT_PORTNO);
if (port == IAX_FAILURE) {
_debug("IAX Failure: Error when initializing\n");
} else if ( port == 0 ) {
_debug("IAX Warning: already initialize\n");
} else {
_debug("IAX Info: listening on port %d\n", port);
_localPort = port;
returnValue = true;
}
return returnValue;
}
void
IAXVoIPLink::terminate()
{
// iaxc_shutdown();
// hangup all call
// iax_hangup(calls[callNo].session,"Dumped Call");
}
......@@ -20,6 +20,7 @@
#define IAXVOIPLINK_H
#include "voIPLink.h"
#include "iax-client.h"
class AudioCodec;
......@@ -36,9 +37,9 @@ public:
~IAXVoIPLink();
void getEvent (void) { }
bool init (void) { return false; }
bool init (void);
bool checkNetwork (void) { return false; }
void terminate (void) { }
void terminate (void);
bool setRegister (void) { return false; }
bool setUnregister (void) { return false; }
......
......@@ -46,7 +46,6 @@ bool
SIPAccount::createVoIPLink()
{
if (!_link) {
//_link = new SipVoIPLink();
_link = new SIPVoIPLink(_accountID);
}
return (_link != 0 ? true : false);
......@@ -117,13 +116,13 @@ SIPAccount::initConfig(Conf::ConfigTree& config)
config.addConfigTreeItem(section, Conf::ConfigTreeItem(CONFIG_ACCOUNT_TYPE, "SIP", type_str));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(CONFIG_ACCOUNT_ENABLE,"1", type_int));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(CONFIG_ACCOUNT_AUTO_REGISTER, "1", type_int));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(SIP_FULL_NAME, "", type_str));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(SIP_USER_PART, "", type_str));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(SIP_HOST_PART, "", type_str));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(SIP_AUTH_NAME, "", type_str));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(SIP_PASSWORD, "", type_str));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(SIP_PROXY, "", type_str));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(CONFIG_ACCOUNT_AUTO_REGISTER, "1", type_int));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(SIP_STUN_SERVER, "stun.fwdnet.net:3478", type_str));
config.addConfigTreeItem(section, Conf::ConfigTreeItem(SIP_USE_STUN, "0", type_int));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment