Commit 913486ae authored by Benjamin REIS's avatar Benjamin REIS
Browse files

Merge remote-tracking branch 'origin/master' into dev_conference_info

parents c33a2c30 b6952c1d
......@@ -38,34 +38,43 @@ include(CMakeDependentOption)
option(ENABLE_SHARED "Build shared library." YES)
option(ENABLE_STATIC "Build static library." YES)
option(ENABLE_CONSOLE_UI "Turn on or off compilation of console interface." YES)
option(ENABLE_DATE "Use build date in internal version number." NO)
option(ENABLE_CSHARP_WRAPPER "Build the C# wrapper for Liblinphone." OFF)
option(ENABLE_CXX_WRAPPER "Build the C++ wrapper for Liblinphone." YES)
option(ENABLE_DAEMON "Enable the linphone daemon interface." YES)
option(ENABLE_DATE "Use build date in internal version number." NO)
option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
option(ENABLE_DOC "Enable documentation generation with Doxygen." YES)
option(ENABLE_JAVADOC "Add a target to generate documentation for Java API" NO)
option(ENABLE_GTK_UI "Turn on or off compilation of gtk interface." NO)
option(ENABLE_JAVADOC "Add a target to generate documentation for Java API" NO)
option(ENABLE_LDAP "Enable LDAP support." NO)
option(ENABLE_SQLITE_STORAGE "Turn on compilation sqlite storage, for messages, contacts, history" YES)
cmake_dependent_option(ENABLE_LIME "Enable Instant Messaging Encryption." YES "ENABLE_SQLITE_STORAGE" NO)
cmake_dependent_option(ENABLE_NOTIFY "Enable libnotify support." YES "ENABLE_GTK_UI;NOT APPLE" NO)
option(ENABLE_NLS "Build with internationalisation support" YES)
option(ENABLE_RELATIVE_PREFIX "Find resources relatively to the installation directory." NO)
option(ENABLE_ROOTCA_DOWNLOAD "Download rootca.pem at build time." YES)
option(ENABLE_SOCI_STORAGE "Turn on compilation soci storage, for messages, contacts, history" YES)
option(ENABLE_SQLITE_STORAGE "Turn on compilation sqlite storage, for messages, contacts, history" YES)
option(ENABLE_STRICT "Build with strict compile options." YES)
option(ENABLE_TOOLS "Turn on or off compilation of tools." YES)
option(ENABLE_TUNNEL "Turn on compilation of tunnel support." NO)
option(ENABLE_TUTORIALS "Enable compilation of tutorials." YES)
option(ENABLE_UNIT_TESTS "Enable compilation of unit tests." YES)
option(ENABLE_UPDATE_CHECK "Enable update check." NO)
option(ENABLE_VCARD "Turn on compilation of vcard4 support." YES)
option(ENABLE_VIDEO "Build with video support." YES)
cmake_dependent_option(ENABLE_LIME "Enable Instant Messaging Encryption." YES "ENABLE_SQLITE_STORAGE" NO)
cmake_dependent_option(ENABLE_NOTIFY "Enable libnotify support." YES "ENABLE_GTK_UI;NOT APPLE" NO)
cmake_dependent_option(ENABLE_ASSISTANT "Turn on assistant compiling." YES "ENABLE_GTK_UI" NO)
option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
option(ENABLE_NLS "Build with internationalisation support" YES)
option(ENABLE_VCARD "Turn on compilation of vcard4 support." YES)
option(ENABLE_ROOTCA_DOWNLOAD "Download rootca.pem at build time." YES)
option(ENABLE_CXX_WRAPPER "Build the C++ wrapper for Liblinphone." YES)
option(ENABLE_CSHARP_WRAPPER "Build the C# wrapper for Liblinphone." OFF)
set(CMAKE_CXX_STANDARD 11)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG")
if(ENABLE_STATIC)
set(LINPHONE_LIBS_FOR_TOOLS linphone-static)
......@@ -125,7 +134,7 @@ else()
endif()
find_package(XML2 REQUIRED)
find_package(LibXsd REQUIRED)
find_package(Soci REQUIRED)
find_package(Soci)
find_package(Zlib)
if(ENABLE_TUNNEL)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
......@@ -258,7 +267,7 @@ if(LINPHONE_CPPFLAGS)
endif()
if(ENABLE_DEBUG_LOGS)
add_definitions("-DDEBUG")
add_definitions("-DDEBUG_LOGS")
endif()
set(STRICT_OPTIONS_CPP )
......
###############################################################################
# CMake module to search for SOCI library
#
# WARNING: This module is experimental work in progress.
#
# This module defines:
# SOCI_INCLUDE_DIRS = include dirs to be used when using the soci library
# SOCI_LIBRARIES = full path to the soci library
# SOCI_VERSION = the soci version found (not yet. soci does not provide that info.)
# SOCI_FOUND = true if soci was found
#
# For each component you specify in find_package(), the following variables are set.
#
# SOCI_${COMPONENT}_PLUGIN = full path to the soci plugin
# SOCI_${COMPONENT}_FOUND
#
# Copyright (c) 2011 Michael Jansen <info@michael-jansen.biz>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
###############################################################################
#
### Global Configuration Section
#
SET(_SOCI_ALL_PLUGINS mysql sqlite3)
SET(_SOCI_REQUIRED_VARS SOCI_INCLUDE_DIRS SOCI_LIBRARIES)
#
### FIRST STEP: Find the soci headers.
#
FIND_PATH(SOCI_INCLUDE_DIRS soci/soci.h
DOC "Soci (http://soci.sourceforge.net) include directory")
MARK_AS_ADVANCED(SOCI_INCLUDE_DIRS)
#
### SECOND STEP: Find the soci core library. Respect LIB_SUFFIX
#
FIND_LIBRARY(SOCI_LIBRARIES
NAMES soci_core
PATH_SUFFIXES lib lib64)
MARK_AS_ADVANCED(SOCI_LIBRARIES)
GET_FILENAME_COMPONENT(SOCI_LIBRARY_DIR ${SOCI_LIBRARIES} PATH)
MARK_AS_ADVANCED(SOCI_LIBRARY_DIR)
#
### THIRD STEP: Find all installed plugins if the library was found
#
IF(SOCI_INCLUDE_DIRS AND SOCI_LIBRARIES)
MESSAGE(STATUS "Soci found: Looking for plugins")
FOREACH(plugin IN LISTS _SOCI_ALL_PLUGINS)
FIND_LIBRARY(
SOCI_${plugin}_PLUGIN
NAMES soci_${plugin}
PATH_SUFFIXES lib lib64)
MARK_AS_ADVANCED(SOCI_${plugin}_PLUGIN)
IF(SOCI_${plugin}_PLUGIN)
MESSAGE(STATUS " * Plugin ${plugin} found ${SOCI_${plugin}_PLUGIN}.")
SET(SOCI_${plugin}_FOUND True)
ELSE()
MESSAGE(STATUS " * Plugin ${plugin} not found.")
SET(SOCI_${plugin}_FOUND False)
ENDIF()
ENDFOREACH()
#
### FOURTH CHECK: Check if the required components were all found
#
FOREACH(component ${Soci_FIND_COMPONENTS})
IF(NOT SOCI_${component}_FOUND)
MESSAGE(SEND_ERROR "Required component ${component} not found. It seems that Soci was built without support of ${component}, consider rebuilding it.")
ENDIF()
ENDFOREACH()
ENDIF()
#
### ADHERE TO STANDARDS
#
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Soci DEFAULT_MSG ${_SOCI_REQUIRED_VARS})
......@@ -159,7 +159,6 @@ set(LIBS
${XML2_LIBRARIES}
${BELR_LIBRARIES}
${LIBXSD_LIBRARIES}
${SOCI_LIBRARY}
)
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND LIBS "Ws2_32")
......@@ -170,6 +169,9 @@ endif()
if(ZLIB_FOUND)
list(APPEND LIBS ${ZLIB_LIBRARIES})
endif()
if(SOCI_FOUND)
list(APPEND LIBS ${SOCI_LIBRARIES})
endif()
if(SQLITE3_FOUND)
list(APPEND LIBS ${SQLITE3_LIBRARIES})
endif()
......
......@@ -59,31 +59,6 @@ void sal_op_set_privacy_from_message(SalOp* op,belle_sip_message_t* msg) {
}
static void set_tls_properties(Sal *ctx);
void _belle_sip_log(const char *domain, belle_sip_log_level lev, const char *fmt, va_list args) {
OrtpLogLevel ortp_level;
switch(lev) {
case BELLE_SIP_LOG_FATAL:
ortp_level=ORTP_FATAL;
break;
case BELLE_SIP_LOG_ERROR:
ortp_level=ORTP_ERROR;
break;
case BELLE_SIP_LOG_WARNING:
ortp_level=ORTP_WARNING;
break;
case BELLE_SIP_LOG_MESSAGE:
ortp_level=ORTP_MESSAGE;
break;
case BELLE_SIP_LOG_DEBUG:
default:
ortp_level=ORTP_DEBUG;
break;
}
if (ortp_log_level_enabled("belle-sip", ortp_level)){
ortp_logv("belle-sip", ortp_level,fmt,args);
}
}
void sal_enable_log(){
sal_set_log_level(ORTP_MESSAGE);
}
......@@ -93,24 +68,31 @@ void sal_disable_log() {
}
void sal_set_log_level(OrtpLogLevel level) {
belle_sip_log_level belle_sip_level;
belle_sip_log_level belle_sip_level = BELLE_SIP_LOG_MESSAGE;
if ((level&ORTP_FATAL) != 0) {
belle_sip_level = BELLE_SIP_LOG_FATAL;
} else if ((level&ORTP_ERROR) != 0) {
}
if ((level&ORTP_ERROR) != 0) {
belle_sip_level = BELLE_SIP_LOG_ERROR;
} else if ((level&ORTP_WARNING) != 0) {
}
if ((level&ORTP_WARNING) != 0) {
belle_sip_level = BELLE_SIP_LOG_WARNING;
} else if ((level&ORTP_MESSAGE) != 0) {
}
if ((level&ORTP_MESSAGE) != 0) {
belle_sip_level = BELLE_SIP_LOG_MESSAGE;
} else if (((level&ORTP_DEBUG) != 0) || ((level&ORTP_TRACE) != 0)) {
}
if (((level&ORTP_DEBUG) != 0) || ((level&ORTP_TRACE) != 0)) {
belle_sip_level = BELLE_SIP_LOG_DEBUG;
} else {
//well, this should never occurs but...
belle_sip_level = BELLE_SIP_LOG_MESSAGE;
}
belle_sip_set_log_level(belle_sip_level);
}
static BctbxLogFunc _belle_sip_log_handler = bctbx_logv_out;
void sal_set_log_handler(BctbxLogFunc log_handler) {
_belle_sip_log_handler = log_handler;
belle_sip_set_log_handler(log_handler);
}
void sal_add_pending_auth(Sal *sal, SalOp *op){
if (bctbx_list_find(sal->pending_auths,op)==NULL){
sal->pending_auths=bctbx_list_append(sal->pending_auths,op);
......@@ -505,7 +487,7 @@ Sal * sal_init(MSFactory *factory){
sal->auto_contacts=TRUE;
sal->factory = factory;
/*first create the stack, which initializes the belle-sip object's pool for this thread*/
belle_sip_set_log_handler(_belle_sip_log);
belle_sip_set_log_handler(_belle_sip_log_handler); //printf by default
sal->stack = belle_sip_stack_new(NULL);
sal->user_agent=belle_sip_header_user_agent_new();
......
......@@ -48,8 +48,17 @@ static void register_refresher_listener (belle_sip_refresher_t* refresher
if (service_route_address) belle_sip_object_unref(service_route_address);
sal_remove_pending_auth(op->base.root,op); /*just in case*/
if (contact) {
sal_op_set_contact_address(op,(SalAddress*)(BELLE_SIP_HEADER_ADDRESS(contact))); /*update contact with real value*/
const char *gruu;
belle_sip_parameters_t* p = (BELLE_SIP_PARAMETERS(contact));
if((gruu = belle_sip_parameters_get_parameter(p, "pub-gruu"))) {
char *unquoted = belle_sip_unquote_strdup(gruu);
sal_op_set_contact_address(op, (SalAddress*)belle_sip_header_address_parse(unquoted));
belle_sip_parameters_remove_parameter(p, "pub-gruu");
} else {
sal_op_set_contact_address(op, (SalAddress*)(BELLE_SIP_HEADER_ADDRESS(contact))); /*update contact with real value*/
}
}
op->base.root->callbacks.register_success(op,belle_sip_refresher_get_expires(op->refresher)>0);
} else if (status_code>=400) {
......
......@@ -60,7 +60,7 @@ static LinphoneDialPlan const dial_plans[]={
{"Burkina Faso" ,"BF" , "226" , 8 , "00" },
{"Burundi" ,"BI" , "257" , 8 , "011" },
{"Cambodia" ,"KH" , "855" , 9 , "00" },
{"Cameroon" ,"CM" , "237" , 8 , "00" },
{"Cameroon" ,"CM" , "237" , 9 , "00" },
{"Canada" ,"CA" , "1" , 10 , "011" },
{"Cape Verde" ,"CV" , "238" , 7 , "00" },
{"Cayman Islands" ,"KY" , "1" , 10 , "011" },
......@@ -168,7 +168,7 @@ static LinphoneDialPlan const dial_plans[]={
{"Montserrat" ,"MS" , "664" , 10 , "011" },
{"Morocco" ,"MA" , "212" , 9 , "00" },
{"Mozambique" ,"MZ" , "258" , 9 , "00" },
{"Myanmar" ,"MM" , "95" , 8 , "00" },
{"Myanmar" ,"MM" , "95" , 10 , "00" },
{"Namibia" ,"NA" , "264" , 9 , "00" },
{"Nauru" ,"NR" , "674" , 7 , "00" },
{"Nepal" ,"NP" , "43" , 10 , "00" },
......
......@@ -29,7 +29,7 @@ if (ENABLE_TOOLS)
string(REPLACE ".c" "" EXECUTABLE_NAME ${EXECUTABLE})
bc_apply_compile_flags(${EXECUTABLE} STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
add_executable(${EXECUTABLE_NAME} ${USE_BUNDLE} ${EXECUTABLE})
target_link_libraries(${EXECUTABLE_NAME} ${LINPHONE_LIBS_FOR_TOOLS} ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES})
target_link_libraries(${EXECUTABLE_NAME} ${LINPHONE_LIBS_FOR_TOOLS} ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES} ${BCTOOLBOX_CORE_LIBRARIES})
set_target_properties(${EXECUTABLE_NAME} PROPERTIES LINK_FLAGS "${LINPHONE_LDFLAGS}")
if (NOT IOS)
install(TARGETS ${EXECUTABLE_NAME}
......
......@@ -107,8 +107,8 @@ int main(int argc, char *argv[]){
password=argv[3];
}
signal(SIGINT,stop);
//#define DEBUG
#ifdef DEBUG
//#define DEBUG_LOGS
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
......
......@@ -59,8 +59,8 @@ int main(int argc, char *argv[]){
}
signal(SIGINT,stop);
//#define DEBUG
#ifdef DEBUG
//#define DEBUG_LOGS
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
......
......@@ -133,8 +133,8 @@ int main(int argc, char *argv[]){
big_file[sizeof(big_file)-1]=*"E";
signal(SIGINT,stop);
//#define DEBUG
#ifdef DEBUG
//#define DEBUG_LOGS
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
vtable.message_received=message_received;
......
......@@ -79,7 +79,7 @@ int main(int argc, char *argv[]){
signal(SIGINT,stop);
#ifdef DEBUG
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
......
......@@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#define DEBUG 1
#define DEBUG_LOGS 1
#include "linphone/core.h"
......@@ -102,7 +102,7 @@ int main(int argc, char *argv[]){
signal(SIGINT,stop);
#ifdef DEBUG
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
......
......@@ -82,7 +82,7 @@ int main(int argc, char *argv[]){
signal(SIGINT,stop);
#ifdef DEBUG
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
......
......@@ -59,7 +59,7 @@ int main(int argc, char *argv[]){
signal(SIGINT,stop);
#ifdef DEBUG
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
......
......@@ -76,7 +76,7 @@ int main(int argc, char *argv[]){
signal(SIGINT,stop);
#ifdef DEBUG
#ifdef DEBUG_LOGS
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
......
......@@ -4983,13 +4983,7 @@ static LinphoneAddress *get_fixed_contact(LinphoneCore *lc, LinphoneCall *call ,
void linphone_call_set_contact_op(LinphoneCall* call) {
LinphoneAddress *contact;
contact=get_fixed_contact(call->core,call,call->dest_proxy);
if (contact){
SalTransport tport=sal_address_get_transport((SalAddress*)contact);
sal_address_clean((SalAddress*)contact); /* clean out contact_params that come from proxy config*/
sal_address_set_transport((SalAddress*)contact,tport);
sal_op_set_contact_address(call->op, contact);
linphone_address_unref(contact);
}
sal_op_set_and_clean_contact_address(call->op, (SalAddress *)contact);
}
LinphonePlayer *linphone_call_get_player(LinphoneCall *call){
......
......@@ -469,7 +469,9 @@ void linphone_core_set_log_handler(OrtpLogFunc logfunc) {
void linphone_core_set_log_file(FILE *file) {
if (file == NULL) file = stdout;
ortp_set_log_file(file);
bctbx_set_log_file(file); /*gather everythings*/
sal_set_log_handler(NULL); /*disable default log handler*/
ortp_set_log_handler(NULL); /*disable default log handler*/
}
void linphone_core_set_log_level(OrtpLogLevel loglevel) {
......@@ -498,15 +500,13 @@ void linphone_core_set_log_level(OrtpLogLevel loglevel) {
}
void linphone_core_set_log_level_mask(unsigned int loglevel) {
ortp_set_log_level_mask(NULL, loglevel);
bctbx_set_log_level_mask(NULL, loglevel);
if (loglevel == 0) {
sal_disable_log();
} else {
sal_enable_log();
}
//we only have 2 domain for now ortp and belle-sip
bctbx_set_log_level_mask(ORTP_LOG_DOMAIN, loglevel);
sal_set_log_level((OrtpLogLevel)loglevel);
}
unsigned int linphone_core_get_log_level_mask(void) {
return bctbx_get_log_level_mask(ORTP_LOG_DOMAIN);
}
static int _open_log_collection_file_with_idx(int idx) {
struct stat statbuf;
char *log_filename;
......@@ -1388,7 +1388,7 @@ static void sip_config_read(LinphoneCore *lc) {
sal_enable_sip_update_method(lc->sal,lp_config_get_int(lc->config,"sip","sip_update",1));
lc->sip_conf.vfu_with_info=lp_config_get_int(lc->config,"sip","vfu_with_info",1);
linphone_core_set_sip_transport_timeout(lc, lp_config_get_int(lc->config, "sip", "transport_timeout", 63000));
sal_set_supported_tags(lc->sal,lp_config_get_string(lc->config,"sip","supported","replaces, outbound"));
sal_set_supported_tags(lc->sal,lp_config_get_string(lc->config,"sip","supported","replaces, outbound, gruu"));
lc->sip_conf.save_auth_info = lp_config_get_int(lc->config, "sip", "save_auth_info", 1);
linphone_core_create_im_notif_policy(lc);
}
......@@ -3512,14 +3512,9 @@ void linphone_configure_op_with_proxy(LinphoneCore *lc, SalOp *op, const Linphon
sal_op_set_realm(op,linphone_proxy_config_get_realm(proxy));
if (with_contact && proxy && proxy->op){
const SalAddress *contact;
if ((contact=sal_op_get_contact_address(proxy->op))){
SalTransport tport=sal_address_get_transport((SalAddress*)contact);
SalAddress *new_contact=sal_address_clone(contact);
sal_address_clean(new_contact); /* clean out contact_params that come from proxy config*/
sal_address_set_transport(new_contact,tport);
sal_op_set_contact_address(op,new_contact);
sal_address_destroy(new_contact);
}
contact=sal_op_get_contact_address(proxy->op);
SalAddress *new_contact = contact ? sal_address_clone(contact) : NULL;
sal_op_set_and_clean_contact_address(proxy->op, new_contact);
}
sal_op_cnx_ip_to_0000_if_sendonly_enable(op,lp_config_get_default_int(lc->config,"sip","cnx_ip_to_0000_if_sendonly_enabled",0)); /*also set in linphone_call_new_incoming*/
}
......
......@@ -4284,6 +4284,15 @@ extern "C" jobject Java_org_linphone_core_LinphoneFriendImpl_getCore(JNIEnv* en
return NULL;
}
extern "C" jstring Java_org_linphone_core_LinphoneFriendImpl_getVcardToString(JNIEnv* env
,jobject thiz
,jlong ptr) {
LinphoneFriend *lf = (LinphoneFriend*)ptr;
LinphoneVcard *lvc = linphone_friend_get_vcard(lf);
const char* vcard = linphone_vcard_as_vcard4_string(lvc);
return vcard ? env->NewStringUTF(vcard) : NULL;
}
extern "C" jobject Java_org_linphone_core_LinphoneFriendListImpl_getCore(JNIEnv* env
,jobject thiz
,jlong ptr) {
......@@ -7846,6 +7855,21 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCallImpl_setListener(JNIEn
linphone_call_set_next_video_frame_decoded_callback(call, _next_video_frame_decoded_callback, listener);
}
extern "C" void Java_org_linphone_core_LinphoneCallImpl_setVideoWindowId(JNIEnv* env
,jobject thiz
,jlong lc
,jobject obj) {
jobject oldWindow = (jobject) linphone_call_get_native_video_window_id((LinphoneCall*)lc);
if (obj != NULL) {
obj = env->NewGlobalRef(obj);
ms_message("Java_org_linphone_core_LinphoneCallImpl_setVideoWindowId(): NewGlobalRef(%p)",obj);
}else ms_message("Java_org_linphone_core_LinphoneCallImpl_setVideoWindowId(): setting to NULL");
linphone_call_set_native_video_window_id((LinphoneCall*)lc,(void *)obj);
if (oldWindow != NULL) {
ms_message("Java_org_linphone_core_LinphoneCallImpl_setVideoWindowId(): DeleteGlobalRef(%p)",oldWindow);
env->DeleteGlobalRef(oldWindow);
}
}
/*
* returns the java TunnelConfig associated with a C LinphoneTunnelConfig.
......
......@@ -517,6 +517,20 @@ void sal_op_set_contact_address(SalOp *op, const SalAddress *address){
if (((SalOpBase*)op)->contact_address) sal_address_destroy(((SalOpBase*)op)->contact_address);
((SalOpBase*)op)->contact_address=address?sal_address_clone(address):NULL;
}
void sal_op_set_and_clean_contact_address(SalOp *op, SalAddress *contact) {
if (contact){
SalTransport tport = sal_address_get_transport((SalAddress*)contact);
const char* gruu = bctbx_strdup(sal_address_get_uri_param(contact, "gr"));
sal_address_clean((SalAddress*)contact); /* clean out contact_params that come from proxy config*/
sal_address_set_transport((SalAddress*)contact,tport);
if(gruu)
sal_address_set_uri_param(contact, "gr", gruu);
sal_op_set_contact_address(op, contact);
sal_address_unref(contact);
}
}
const SalAddress* sal_op_get_contact_address(const SalOp *op) {
return ((SalOpBase*)op)->contact_address;
}
......
......@@ -101,8 +101,9 @@ void linphone_video_definition_set_name(LinphoneVideoDefinition *vdef, const cha
}
bool_t linphone_video_definition_equals(const LinphoneVideoDefinition *vdef1, const LinphoneVideoDefinition *vdef2) {
return (((vdef1->width == vdef2->width) && (vdef1->height == vdef2->height))
|| ((vdef1->width == vdef2->height) && (vdef1->height == vdef2->width)));
return ((vdef1 != NULL && vdef2 != NULL)
&& (((vdef1->width == vdef2->width) && (vdef1->height == vdef2->height))
|| ((vdef1->width == vdef2->height) && (vdef1->height == vdef2->width))));
}
bool_t linphone_video_definition_strict_equals(const LinphoneVideoDefinition *vdef1, const LinphoneVideoDefinition *vdef2) {
......
......@@ -119,7 +119,7 @@ target_link_libraries(linphone-daemon ${LINPHONE_LIBS_FOR_TOOLS} ${MEDIASTREAMER
set_target_properties(linphone-daemon PROPERTIES LINK_FLAGS "${LINPHONE_LDFLAGS}")
add_executable(linphone-daemon-pipetest ${DAEMON_PIPETEST_SOURCE_FILES})
target_link_libraries(linphone-daemon-pipetest ${LINPHONE_LIBS_FOR_TOOLS} ${ORTP_LIBRARIES})
target_link_libraries(linphone-daemon-pipetest ${LINPHONE_LIBS_FOR_TOOLS} ${ORTP_LIBRARIES} ${BCTOOLBOX_CORE_LIBRARIES})
set_target_properties(linphone-daemon-pipetest PROPERTIES LINK_FLAGS "${LINPHONE_LDFLAGS}")
set(INSTALL_TARGETS linphone-daemon linphone-daemon-pipetest)
......
......@@ -803,6 +803,14 @@ LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel);
*/
LINPHONE_PUBLIC void linphone_core_set_log_level_mask(unsigned int loglevel);
/**
* Get defined log level mask.
*
* @return The loglevel parameter is a bitmask parameter. Therefore to enable only warning and error
* messages, use ORTP_WARNING | ORTP_ERROR. To disable logs, simply set loglevel to 0.
*/
LINPHONE_PUBLIC unsigned int linphone_core_get_log_level_mask(void);
/**
* Enable logs in supplied FILE*.
* @param file a C FILE* where to fprintf logs. If null stdout is used.
......
......@@ -148,6 +148,8 @@ const char *sal_address_get_header(const SalAddress *addr, const char *name);
LINPHONE_PUBLIC Sal * sal_init(MSFactory *factory);
LINPHONE_PUBLIC void sal_uninit(Sal* sal);
void sal_set_log_handler(BctbxLogFunc log_handler);
void sal_set_user_pointer(Sal *sal, void *user_data);
void *sal_get_user_pointer(const Sal *sal);
......@@ -672,6 +674,7 @@ SalOp * sal_op_new(Sal *sal);
/*generic SalOp API, working for all operations */
Sal *sal_op_get_sal(const SalOp *op);