Commit 141ce1a0 authored by jehan's avatar jehan

start linphone integration

parent 724ee2bc
......@@ -42,18 +42,6 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="test" path="tester" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>test</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.macosx.base.557244179.959032290">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.macosx.base.557244179.959032290" moduleId="org.eclipse.cdt.core.settings" name="debug">
......@@ -94,18 +82,6 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="test" path="tester" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>test</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
......@@ -114,6 +90,25 @@
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/belle-sip"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="install" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="test" path="tester" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>test</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
......@@ -199,7 +194,7 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.macosx.base.557244179.959032290;cdt.managedbuild.toolchain.gnu.macosx.base.557244179.959032290.;cdt.managedbuild.tool.gnu.c.compiler.macosx.base.3940526;cdt.managedbuild.tool.gnu.c.compiler.input.2089521215">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.macosx.base.557244179;cdt.managedbuild.toolchain.gnu.macosx.base.557244179.779699347;cdt.managedbuild.tool.gnu.c.compiler.macosx.base.1327025999;cdt.managedbuild.tool.gnu.c.compiler.input.1517483722">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
......@@ -242,7 +237,7 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.macosx.base.557244179;cdt.managedbuild.toolchain.gnu.macosx.base.557244179.779699347;cdt.managedbuild.tool.gnu.c.compiler.macosx.base.1327025999;cdt.managedbuild.tool.gnu.c.compiler.input.1517483722">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.macosx.base.557244179.959032290;cdt.managedbuild.toolchain.gnu.macosx.base.557244179.959032290.;cdt.managedbuild.tool.gnu.c.compiler.macosx.base.3940526;cdt.managedbuild.tool.gnu.c.compiler.input.2089521215">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
......
SUBDIRS=include src tester
test:
cd tester && $(MAKE) test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = belle-sip.pc
\ No newline at end of file
# This is a comment
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
Name: belle-sip
Description: A c based implementation of the SIP (RFC 3261) telephony protocol
Requires.private: @TLS_PC@
Version: @VERSION@
Libs: -L@libdir@ -lbellesip
Cflags: -I@includedir@
\ No newline at end of file
......@@ -93,16 +93,18 @@ AC_SUBST(ANTLR_CFLAGS)
AC_SUBST(ANTLR_LIBS)
PKG_CHECK_MODULES(GNUTLS, gnutls, [found_gnutls=yes],foo=bar)
PKG_CHECK_MODULES(OPENSSL, openssl, [found_openssl=yes],foo=bar)
#PKG_CHECK_MODULES(OPENSSL, openssl, [found_openssl=yes],foo=bar)
AM_CONDITIONAL([BUILD_TLS], [test "x$found_gnutls" = "xyes" || test "x$found_openssl" = "xyes"])
TLS_CFLAGS=""
TLS_LIBS=""
TLS_PC=""
if test "x$found_gnutls" = "xyes" ; then
GNUTLS_LIBS+="$GNUTLS_LIBS -lgnutls-openssl "
AC_DEFINE(HAVE_GNUTLS,1,[Defined when gnutls api is available])
TLS_CFLAGS=$GNUTLS_CFLAGS
TLS_LIBS=$GNUTLS_LIBS
TLS_PC=gnutls
elif test "x$found_openssl" = "xyes" ; then
AC_DEFINE(HAVE_OPENSSL,1,[Defined when openssl api is available])
TLS_CFLAGS=$OPENSSL_CFLAGS
......@@ -110,6 +112,7 @@ elif test "x$found_openssl" = "xyes" ; then
fi
AC_SUBST(TLS_CFLAGS)
AC_SUBST(TLS_LIBS)
AC_SUBST(TLS_PC)
PKG_CHECK_MODULES(CUNIT, cunit, [found_cunit=yes],[found_cunit=no])
......@@ -130,8 +133,8 @@ case "$target_os" in
esac
AC_SUBST(CUNIT_CFLAGS)
AC_SUBST(CUNIT_LIBS)
#AC_SUBST(CUNIT_CFLAGS)
#AC_SUBST(CUNIT_LIBS)
if test "$found_cunit" = "no" ; then
AC_MSG_WARN([Could not find cunit framework, tests are not compiled.])
......@@ -153,5 +156,6 @@ include/Makefile
include/belle-sip/Makefile
src/Makefile
tester/Makefile
belle-sip.pc
])
AC_OUTPUT
......@@ -134,42 +134,9 @@ void belle_sip_set_log_level(int level);
char * belle_sip_random_token(char *ret, size_t size);
#if defined(WIN32) || defined(WIN32_WCE)
typedef SOCKET belle_sip_fd_t;
static inline void close_socket(belle_sip_fd_t s){
closesocket(s);
}
static inline int get_socket_error(void){
return WSAGetLastError();
}
const char *getSocketErrorString();
#define belle_sip_get_socket_error_string() getSocketErrorString()
#define belle_sip_get_socket_error_string_from_code(code) getSocketErrorString()
#define usleep(us) Sleep((us)/1000)
static inline int inet_aton(const char *ip, struct in_addr *p){
*(long*)p=inet_addr(ip);
return 0;
}
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EINPROGRESS WSAEINPROGRESS
#else
typedef int belle_sip_fd_t;
static inline void close_socket(belle_sip_fd_t s){
close(s);
}
static inline int get_socket_error(void){
return errno;
}
#define belle_sip_get_socket_error_string() strerror(errno)
#define belle_sip_get_socket_error_string_from_code(code) strerror(code)
#endif
BELLE_SIP_END_DECLS
......
......@@ -61,6 +61,42 @@
#include "config.h"
#endif
#if defined(WIN32) || defined(WIN32_WCE)
static inline void close_socket(belle_sip_fd_t s){
closesocket(s);
}
static inline int get_socket_error(void){
return WSAGetLastError();
}
const char *getSocketErrorString();
#define belle_sip_get_socket_error_string() getSocketErrorString()
#define belle_sip_get_socket_error_string_from_code(code) getSocketErrorString()
#define usleep(us) Sleep((us)/1000)
static inline int inet_aton(const char *ip, struct in_addr *p){
*(long*)p=inet_addr(ip);
return 0;
}
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EINPROGRESS WSAEINPROGRESS
#else
static inline void close_socket(belle_sip_fd_t s){
close(s);
}
static inline int get_socket_error(void){
return errno;
}
#define belle_sip_get_socket_error_string() strerror(errno)
#define belle_sip_get_socket_error_string_from_code(code) strerror(code)
#endif
/*etc*/
#define BELLE_SIP_INTERFACE_GET_METHODS(obj,interface) \
......
......@@ -157,7 +157,7 @@ BELLE_SIP_INSTANCIATE_VPTR(belle_sip_provider_t,belle_sip_object_t,belle_sip_pro
belle_sip_provider_t *belle_sip_provider_new(belle_sip_stack_t *s, belle_sip_listening_point_t *lp){
belle_sip_provider_t *p=belle_sip_object_new(belle_sip_provider_t);
p->stack=s;
belle_sip_provider_add_listening_point(p,lp);
if (lp) belle_sip_provider_add_listening_point(p,lp);
return p;
}
......@@ -165,6 +165,11 @@ int belle_sip_provider_add_listening_point(belle_sip_provider_t *p, belle_sip_li
p->lps=belle_sip_list_append(p->lps,belle_sip_object_ref(lp));
return 0;
}
void belle_sip_provider_remove_listening_point(belle_sip_provider_t *p, belle_sip_listening_point_t *lp) {
p->lps=belle_sip_list_remove(p->lps,lp);
belle_sip_object_unref(lp);
return;
}
belle_sip_listening_point_t *belle_sip_provider_get_listening_point(belle_sip_provider_t *p, const char *transport){
belle_sip_list_t *l;
......
......@@ -22,6 +22,9 @@
#include <gnutls/gnutls.h>
#endif
static void belle_sip_stack_destroy(belle_sip_stack_t *stack){
#ifdef HAVE_GNUTLS
gnutls_global_deinit ();
#endif
belle_sip_object_unref(stack->ml);
}
......@@ -56,7 +59,7 @@ belle_sip_stack_t * belle_sip_stack_new(const char *properties){
/*gnutls_global_set_log_level(9);*/
gnutls_global_set_log_function(_gnutls_log_func);
if ((result = gnutls_global_init ()) <0) {
belle_sip_fatal("Cannot initialize gnu tls vaused by [%s]",gnutls_strerror(result));
belle_sip_fatal("Cannot initialize gnu tls caused by [%s]",gnutls_strerror(result));
}
#endif
return stack;
......
......@@ -128,7 +128,7 @@ static int process_data(belle_sip_channel_t *obj,unsigned int revents){
belle_sip_source_set_events((belle_sip_source_t*)channel,BELLE_SIP_EVENT_READ|BELLE_SIP_EVENT_ERROR);
channel->socket_connected=1;
}
/*connected, now etablishing TLS connection*/
/*connected, now establishing TLS connection*/
#if HAVE_GNUTLS
gnutls_transport_set_ptr2(channel->session, (gnutls_transport_ptr_t)channel,(gnutls_transport_ptr_t) (0xFFFFFFFFULL&fd));
result = gnutls_handshake(channel->session);
......@@ -150,9 +150,6 @@ static int process_data(belle_sip_channel_t *obj,unsigned int revents){
goto process_error;
}
}
#endif /*HAVE_OPENSSL*/
#ifdef HAVE_OPENSSL
if (!SSL_set_fd(channel->ssl,fd)) {
;
belle_sip_error("TLS connection failed to set fd caused by [%s]",ERR_error_string(ERR_get_error(),ssl_error_string));
......@@ -206,7 +203,7 @@ belle_sip_channel_t * belle_sip_channel_new_tls(belle_sip_tls_listening_point_t
belle_sip_error("Cannot set direct priority for channel [%p] caused by [%s] at position [%s]",obj,gnutls_strerror(result),err_pos);
goto error;
}
/* put the anonymous credentials to the current session
/* put the credentials to the current session
*/
result = gnutls_credentials_set (obj->session, GNUTLS_CRD_CERTIFICATE, obj->xcred);
if (result<0) {
......
......@@ -2,6 +2,7 @@
if BUILD_TESTS
noinst_PROGRAMS=belle_sip_tester belle_sip_object_describe
TESTS=belle_sip_tester
belle_sip_tester_SOURCES= belle_sip_tester.c \
belle_sdp_tester.c \
......
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