Commit 4f3129d8 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Merge remote-tracking branch 'linphone/master'

parents 13562a50 9add72c2
......@@ -21,7 +21,7 @@
############################################################################
cmake_minimum_required(VERSION 3.0)
project(linphone VERSION 3.11.1 LANGUAGES C CXX)
project(linphone VERSION 3.11.2 LANGUAGES C CXX)
set(LINPHONE_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
......@@ -45,8 +45,8 @@ 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." YES)
option(ENABLE_LDAP "Enable LDAP support." NO)
option(ENABLE_LIME "Enable Instant Messaging Encryption." YES)
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_RELATIVE_PREFIX "Find resources relatively to the installation directory." NO)
option(ENABLE_STRICT "Build with strict compile options." YES)
......@@ -172,11 +172,12 @@ if(ENABLE_NLS)
find_package(Intl REQUIRED)
endif()
if(ENABLE_LIME)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_bzrtp_CONFIG_DIR}/BZRTPConfig.cmake")
else()
find_package(BZRTP)
endif()
#bzrtp is only required for LIME
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_bzrtp_CONFIG_DIR}/BZRTPConfig.cmake")
else()
find_package(BZRTP REQUIRED)
endif()
set(HAVE_LIME 1)
endif()
if(ENABLE_CXX_WRAPPER)
......@@ -204,9 +205,11 @@ include_directories(
set(LINPHONE_INCLUDE_DIRS
${BELLESIP_INCLUDE_DIRS}
${MEDIASTREAMER2_INCLUDE_DIRS}
${BZRTP_INCLUDE_DIRS}
${BCTOOLBOX_CORE_INCLUDE_DIRS}
)
if (BZRTP_FOUND)
list(APPEND LINPHONE_INCLUDE_DIRS ${BZRTP_INCLUDE_DIRS})
endif()
if(ANDROID)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/java)
endif()
......
......@@ -45,11 +45,7 @@ if(@ENABLE_SHARED@)
set(LINPHONE_LIBRARIES ${LINPHONE_TARGETNAME})
else()
set(LINPHONE_TARGETNAME linphone-static)
get_target_property(LINPHONE_LIBRARIES ${LINPHONE_TARGETNAME} LOCATION)
get_target_property(LINPHONE_LINK_LIBRARIES ${LINPHONE_TARGETNAME} INTERFACE_LINK_LIBRARIES)
if(LINPHONE_LINK_LIBRARIES)
list(APPEND LINPHONE_LIBRARIES ${LINPHONE_LINK_LIBRARIES})
endif()
bc_set_libraries_from_static_target(LINPHONE_LIBRARIES ${LINPHONE_TARGETNAME})
endif()
get_target_property(LINPHONE_INCLUDE_DIRS ${LINPHONE_TARGETNAME} INTERFACE_INCLUDE_DIRECTORIES)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
......
dnl Process this file with autoconf to produce a configure script.
AC_INIT([linphone],[3.11.1],[linphone-developers@nongnu.org])
AC_INIT([linphone],[3.11.2],[linphone-developers@nongnu.org])
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
......@@ -630,7 +630,7 @@ AC_ARG_ENABLE(alsa,
[alsa=true]
)
dnl this options are just for passing to mediastreamer2 subproject
AC_ARG_ENABLE(zrtp,
[AS_HELP_STRING([--enable-zrtp], [Turn on zrtp support])],
[case "${enableval}" in
......@@ -638,9 +638,22 @@ AC_ARG_ENABLE(zrtp,
no) zrtp=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-zrtp) ;;
esac],
[zrtp=false]
[zrtp=auto]
)
if test "$zrtp" != "false" ; then
PKG_CHECK_MODULES(LIBBZRTP, libbzrtp >= 1.0.0, found_zrtp=true, found_zrtp=false)
if test "$zrtp$found_zrtp" = "truefalse" ; then
AC_MSG_ERROR("Cound not find bZRTP library.")
fi
if test "$found_zrtp" = "true" ; then
zrtp=true
AC_DEFINE(HAVE_ZRTP, 1, [Defined if bzrtp is available])
else
zrtp=false
fi
fi
dnl this options are just for passing to mediastreamer2 subproject
AC_ARG_ENABLE(dtls,
[AS_HELP_STRING([--enable-dtls], [Turn on srtp-dtls support - requires polarssl > 1.4])],
......@@ -701,18 +714,21 @@ AC_ARG_ENABLE(lime,
no) lime=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-lime) ;;
esac],
[lime=false]
[lime=auto]
)
if test "$lime" = "true" ; then
if test "$zrtp" = "false" ; then
AC_MSG_ERROR([LIME requires zrtp])
fi
fi
if test "$lime" != "false" ; then
if test "x$found_polarssl" != "xyes" ; then
if test "$lime" = "true" ; then
AC_MSG_ERROR("LIME requires POLARSSL in version >= 1.3")
fi
lime=false
else
if test "$found_zrtp" = "true" ; then
AC_DEFINE(HAVE_LIME, 1, [Defined when LIME support is compiled])
lime=true
else
lime = false
fi
fi
......@@ -1091,6 +1107,7 @@ printf "* %-30s %s\n" "Console interface" $console_ui
printf "* %-30s %s\n" "Tools" $build_tools
printf "* %-30s %s\n" "Sqlite storage" $enable_sqlite_storage
printf "* %-30s %s\n" "VCard support" $enable_vcard
printf "* %-30s %s\n" "ZRTP" $zrtp
printf "* %-30s %s\n" "IM encryption" $lime
printf "* %-30s %s\n" "uPnP support" $build_upnp
printf "* %-30s %s\n" "LDAP support" $enable_ldap
......
......@@ -113,6 +113,7 @@ set(LINPHONE_SOURCE_FILES_C
siplogin.c
sipsetup.c
sqlite3_bctbx_vfs.c
video_definition.c
xml2lpc.c
xml.c
xmlrpc.c
......
......@@ -34,6 +34,7 @@ liblinphone_la_SOURCES=\
carddav.h \
call_log.c \
call_params.c \
carddav.c \
chat.c \
chat_file_transfer.c \
conference.cc conference_private.h \
......@@ -46,6 +47,7 @@ liblinphone_la_SOURCES=\
enum.c enum.h \
error_info.c \
event.c \
factory.c \
friend.c \
friendlist.c \
im_notif_policy.c \
......@@ -63,25 +65,24 @@ liblinphone_la_SOURCES=\
misc.c \
nat_policy.c \
offeranswer.c offeranswer.h\
payload_type.c \
player.c \
presence.c \
private.h \
proxy.c \
quality_reporting.c quality_reporting.h\
remote_provisioning.c \
ringtoneplayer.c \
sal.c \
siplogin.c \
sipsetup.c \
sqlite3_bctbx_vfs.c sqlite3_bctbx_vfs.h\
vcard_private.h \
vtables.c \
video_definition.c \
xml2lpc.c xml2lpc.h \
xml.c \
xmlrpc.c \
vtables.c \
carddav.c \
ringtoneplayer.c \
sqlite3_bctbx_vfs.c sqlite3_bctbx_vfs.h\
factory.c \
payload_type.c \
$(GITVERSION_FILE)
if BUILD_UPNP
......
......@@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/account_creator.h"
#include "linphone/core.h"
#include "linphone/lpconfig.h"
#include "private.h"
#if !_WIN32
#include "regex.h"
......@@ -46,7 +47,7 @@ static unsigned int validate_uri(const char* username, const char* domain, const
LinphoneAddress* addr;
int status = 0;
LinphoneProxyConfig* proxy = linphone_proxy_config_new();
linphone_proxy_config_set_identity(proxy, "sip:userame@domain.com");
linphone_proxy_config_set_identity(proxy, "sip:?@domain.com");
if (username) {
addr = linphone_proxy_config_normalize_sip_uri(proxy, username);
......@@ -107,13 +108,14 @@ static bool_t is_matching_regex(const char *entry, const char* regex) {
#endif
}
LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCreator *creator) {
LinphoneProxyConfig * linphone_account_creator_create_proxy_config(const LinphoneAccountCreator *creator) {
LinphoneAuthInfo *info;
LinphoneProxyConfig *cfg = creator->proxy_cfg;
LinphoneProxyConfig *cfg = linphone_core_create_proxy_config(creator->core);
char *identity_str = _get_identity(creator);
LinphoneAddress *identity = linphone_address_new(identity_str);
char *route = NULL;
char *domain = NULL;
ms_free(identity_str);
if (creator->display_name) {
linphone_address_set_display_name(identity, creator->display_name);
......@@ -122,7 +124,7 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
route = ms_strdup_printf("%s", creator->route);
}
if (creator->domain) {
domain = ms_strdup_printf("%s", creator->domain);
domain = ms_strdup_printf("%s;transport=%s", creator->domain, linphone_transport_to_string(creator->transport));
}
linphone_proxy_config_set_identity_address(cfg, identity);
if (creator->phone_country_code) {
......@@ -141,24 +143,6 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
linphone_proxy_config_enable_publish(cfg, FALSE);
linphone_proxy_config_enable_register(cfg, TRUE);
if (linphone_proxy_config_get_realm(cfg) != NULL
&& strcmp(linphone_proxy_config_get_realm(cfg), "sip.linphone.org") == 0) {
linphone_proxy_config_enable_avpf(cfg, TRUE);
// If account created on sip.linphone.org, we configure linphone to use TLS by default
if (linphone_core_sip_transport_supported(creator->core, LinphoneTransportTls)) {
LinphoneAddress *addr = linphone_address_new(linphone_proxy_config_get_server_addr(cfg));
char *tmp;
linphone_address_set_transport(addr, LinphoneTransportTls);
tmp = linphone_address_as_string(addr);
linphone_proxy_config_set_server_addr(cfg, tmp);
linphone_proxy_config_set_route(cfg, tmp);
ms_free(tmp);
linphone_address_unref(addr);
}
linphone_core_set_stun_server(creator->core, "stun.linphone.org");
linphone_core_set_firewall_policy(creator->core, LinphonePolicyUseIce);
}
info = linphone_auth_info_new(linphone_address_get_username(identity), // username
NULL, //user id
creator->password, // passwd
......@@ -177,6 +161,10 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
linphone_core_remove_auth_info(creator->core, info);
return NULL;
}
LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCreator *creator) {
return linphone_account_creator_create_proxy_config(creator);
}
/************************** End Misc **************************/
/************************** Start Account Creator Cbs **************************/
......@@ -310,6 +298,7 @@ LinphoneAccountCreator * _linphone_account_creator_new(LinphoneCore *core, const
creator->service = linphone_core_get_account_creator_service(core);
creator->cbs = linphone_account_creator_cbs_new();
creator->core = core;
creator->transport = LinphoneTransportTcp;
creator->xmlrpc_session = (xmlrpc_url) ? linphone_xml_rpc_session_new(core, xmlrpc_url) : NULL;
if (domain) {
linphone_account_creator_set_domain(creator, domain);
......@@ -518,19 +507,31 @@ const char * linphone_account_creator_get_email(const LinphoneAccountCreator *cr
return creator->email;
}
LinphoneAccountCreatorStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain) {
LinphoneAccountCreatorDomainStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain) {
if (domain && validate_uri(NULL, domain, NULL) != 0) {
return LinphoneAccountCreatorStatusRequestFailed;
return LinphoneAccountCreatorDomainInvalid;
}
set_string(&creator->domain, domain, TRUE);
return LinphoneAccountCreatorStatusRequestOk;
return LinphoneAccountCreatorDomainOk;
}
const char * linphone_account_creator_get_domain(const LinphoneAccountCreator *creator) {
return creator->domain;
}
LinphoneAccountCreatorTransportStatus linphone_account_creator_set_transport(LinphoneAccountCreator *creator, LinphoneTransportType transport) {
if (!linphone_core_sip_transport_supported(creator->core, transport)) {
return LinphoneAccountCreatorTransportUnsupported;
}
creator->transport = transport;
return LinphoneAccountCreatorTransportOk;
}
LinphoneTransportType linphone_account_creator_get_transport(const LinphoneAccountCreator *creator) {
return creator->transport;
}
LinphoneAccountCreatorStatus linphone_account_creator_set_route(LinphoneAccountCreator *creator, const char *route) {
if (!route || linphone_proxy_config_set_route(creator->proxy_cfg, route) != 0)
return LinphoneAccountCreatorStatusRequestFailed;
......@@ -799,11 +800,33 @@ LinphoneAccountCreatorStatus linphone_account_creator_activate_account_linphone(
}
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_phone_account",
LinphoneXmlRpcArgString, creator->phone_number,
LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number,
LinphoneXmlRpcArgString, creator->activation_code,
linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
LinphoneXmlRpcArgString, creator->phone_number,
LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number,
LinphoneXmlRpcArgString, creator->activation_code,
linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _activate_account_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
linphone_xml_rpc_request_unref(request);
return LinphoneAccountCreatorStatusRequestOk;
}
LinphoneAccountCreatorStatus linphone_account_creator_activate_email_account_linphone(LinphoneAccountCreator *creator) {
LinphoneXmlRpcRequest *request;
if (!creator->activation_code) {
if (creator->cbs->is_account_activated_response_cb != NULL) {
creator->cbs->is_account_activated_response_cb(creator, LinphoneAccountCreatorStatusMissingArguments, "Missing required parameters");
}
return LinphoneAccountCreatorStatusMissingArguments;
}
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_email_account",
LinphoneXmlRpcArgString, creator->username,
LinphoneXmlRpcArgString, creator->activation_code,
linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _activate_account_cb_custom);
......
......@@ -510,6 +510,7 @@ static int is_media_description_acceptable(SalMediaDescription *md){
static SalReason process_sdp_for_invite(SalOp* op,belle_sip_request_t* invite) {
belle_sdp_session_description_t* sdp;
SalReason reason = SalReasonNone;
SalErrorInfo sei = {0};
if (extract_sdp(op,BELLE_SIP_MESSAGE(invite),&sdp,&reason)==0) {
if (sdp){
......@@ -525,7 +526,9 @@ static SalReason process_sdp_for_invite(SalOp* op,belle_sip_request_t* invite) {
}
if (reason != SalReasonNone){
sal_call_decline(op,reason,NULL);
sal_error_info_set(&sei, reason,"SIP", 0, NULL, NULL);
sal_call_decline_with_error_info(op, &sei,NULL);
sal_error_info_reset(&sei);
}
return reason;
}
......@@ -943,6 +946,17 @@ int sal_call_accept(SalOp*h){
return 0;
}
static belle_sip_header_reason_t *sal_call_make_reason_header( const SalErrorInfo *info){
if (info != NULL){
belle_sip_header_reason_t* reason = BELLE_SIP_HEADER_REASON(belle_sip_header_reason_new());
belle_sip_header_reason_set_text(reason, info->status_string);
belle_sip_header_reason_set_protocol(reason,info->protocol);
belle_sip_header_reason_set_cause(reason,info->protocol_code);
return reason;
}
return NULL;
}
int sal_call_decline(SalOp *op, SalReason reason, const char *redirection /*optional*/){
belle_sip_response_t* response;
belle_sip_header_contact_t* contact=NULL;
......@@ -971,6 +985,41 @@ int sal_call_decline(SalOp *op, SalReason reason, const char *redirection /*opti
return 0;
}
int sal_call_decline_with_error_info(SalOp *op, const SalErrorInfo *info, const char *redirection /*optional*/){
belle_sip_response_t* response;
belle_sip_header_contact_t* contact=NULL;
int status = info->protocol_code;
belle_sip_transaction_t *trans;
if (info->reason==SalReasonRedirect){
if (redirection!=NULL) {
if (strstr(redirection,"sip:")!=0) status=302;
else status=380;
contact= belle_sip_header_contact_new();
belle_sip_header_address_set_uri(BELLE_SIP_HEADER_ADDRESS(contact),belle_sip_uri_parse(redirection));
} else {
ms_error("Cannot redirect to null");
}
}
trans=(belle_sip_transaction_t*)op->pending_server_trans;
if (!trans) trans=(belle_sip_transaction_t*)op->pending_update_server_trans;
if (!trans){
ms_error("sal_call_decline_with_error_info(): no pending transaction to decline.");
return -1;
}
response = sal_op_create_response_from_request(op,belle_sip_transaction_get_request(trans),status);
belle_sip_header_reason_t* reason_header = sal_call_make_reason_header(info->sub_sei);
if (reason_header) {
belle_sip_message_add_header(BELLE_SIP_MESSAGE(response),BELLE_SIP_HEADER(reason_header));
}
if (contact) {
belle_sip_message_add_header(BELLE_SIP_MESSAGE(response),BELLE_SIP_HEADER(contact));
}
belle_sip_server_transaction_send_response(BELLE_SIP_SERVER_TRANSACTION(trans),response);
return 0;
}
int sal_call_update(SalOp *op, const char *subject, bool_t no_user_consent){
belle_sip_request_t *update;
belle_sip_dialog_state_t state;
......@@ -1040,7 +1089,17 @@ int sal_call_send_dtmf(SalOp *h, char dtmf){
return 0;
}
int sal_call_terminate(SalOp *op){
int sal_call_terminate_with_error(SalOp *op, const SalErrorInfo *info){
SalErrorInfo sei = { 0 };
const SalErrorInfo *p_sei;
if (info == NULL){
sal_error_info_set(&sei,SalReasonDeclined, "SIP", 0, NULL, NULL);
p_sei = &sei;
} else{
p_sei = info;
}
belle_sip_dialog_state_t dialog_state=op->dialog?belle_sip_dialog_get_state(op->dialog):BELLE_SIP_DIALOG_NULL;
if (op->state==SalOpStateTerminating || op->state==SalOpStateTerminated) {
ms_error("Cannot terminate op [%p] in state [%s]",op,sal_op_state_to_string(op->state));
......@@ -1048,13 +1107,19 @@ int sal_call_terminate(SalOp *op){
}
switch(dialog_state) {
case BELLE_SIP_DIALOG_CONFIRMED: {
sal_op_send_request(op,belle_sip_dialog_create_request(op->dialog,"BYE"));
belle_sip_request_t * req = belle_sip_dialog_create_request(op->dialog,"BYE");
if (info != NULL){
belle_sip_header_reason_t* reason = sal_call_make_reason_header(info);
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(reason));
}
sal_op_send_request(op,req);
op->state=SalOpStateTerminating;
break;
}
case BELLE_SIP_DIALOG_NULL: {
if (op->dir == SalOpDirIncoming) {
sal_call_decline(op, SalReasonDeclined,NULL);
sal_call_decline_with_error_info(op, p_sei, NULL);
op->state=SalOpStateTerminated;
} else if (op->pending_client_trans){
if (belle_sip_transaction_get_state(BELLE_SIP_TRANSACTION(op->pending_client_trans)) == BELLE_SIP_TRANSACTION_PROCEEDING){
......@@ -1071,7 +1136,7 @@ int sal_call_terminate(SalOp *op){
}
case BELLE_SIP_DIALOG_EARLY: {
if (op->dir == SalOpDirIncoming) {
sal_call_decline(op, SalReasonDeclined,NULL);
sal_call_decline_with_error_info(op, p_sei,NULL);
op->state=SalOpStateTerminated;
} else {
cancelling_invite(op);
......@@ -1086,6 +1151,12 @@ int sal_call_terminate(SalOp *op){
return 0;
}
int sal_call_terminate(SalOp *op){
return sal_call_terminate_with_error(op, NULL);
}
bool_t sal_call_autoanswer_asked(SalOp *op){
return op->auto_answer_asked;
}
......
......@@ -561,7 +561,8 @@ const SalErrorInfo *sal_error_info_none(void){
"Ok",
200,
NULL,
NULL
NULL,
};
return &none;
}
......@@ -586,12 +587,18 @@ void sal_error_info_reset(SalErrorInfo *ei){
}
ei->protocol_code=0;
ei->reason=SalReasonNone;
ei->sub_sei = NULL;
}
void sal_error_info_set(SalErrorInfo *ei, SalReason reason, const char *protocol, int code, const char *status_string, const char *warning){
sal_error_info_reset(ei);
if (reason==SalReasonUnknown && strcmp(protocol, "SIP") == 0) ei->reason=_sal_reason_from_sip_code(code);
else ei->reason=reason;
if (reason==SalReasonUnknown && strcmp(protocol, "SIP") == 0 && code != 0) ei->reason=_sal_reason_from_sip_code(code);
else{
ei->reason=reason;
if (code == 0) {
code = sal_reason_to_sip_code(reason);
}
}
ei->protocol_code=code;
ei->status_string=status_string ? ms_strdup(status_string) : NULL;
ei->warnings=warning ? ms_strdup(warning) : NULL;
......@@ -606,7 +613,7 @@ void sal_error_info_set(SalErrorInfo *ei, SalReason reason, const char *protocol
void sal_op_set_reason_error_info(SalOp *op, belle_sip_message_t *msg){
belle_sip_header_reason_t* reason_header = belle_sip_message_get_header_by_type(msg,belle_sip_header_reason_t);
if (reason_header){
SalErrorInfo *ei=&op->reason_error_info;
SalErrorInfo *ei=&op->reason_error_info; // ?//
const char *protocol = belle_sip_header_reason_get_protocol(reason_header);
int code = belle_sip_header_reason_get_cause(reason_header);
const char *text = belle_sip_header_reason_get_text(reason_header);
......@@ -623,6 +630,7 @@ void sal_op_set_error_info_from_response(SalOp *op, belle_sip_response_t *respon
warnings=warning ? belle_sip_header_get_unparsed_value(warning) : NULL;
sal_error_info_set(ei,SalReasonUnknown,"SIP", code,reason_phrase,warnings);
sal_op_set_reason_error_info(op, BELLE_SIP_MESSAGE(response));
}
const SalErrorInfo *sal_op_get_error_info(const SalOp *op){
......@@ -633,6 +641,9 @@ const SalErrorInfo * sal_op_get_reason_error_info(const SalOp *op){
return &op->reason_error_info;
}
static void unlink_op_with_dialog(SalOp *op, belle_sip_dialog_t* dialog){
belle_sip_dialog_set_application_data(dialog,NULL);
sal_op_unref(op);
......
......@@ -193,6 +193,10 @@ MSVideoSize linphone_call_params_get_received_video_size(const LinphoneCallParam
return cp->recv_vsize;
}
const LinphoneVideoDefinition * linphone_call_params_get_received_video_definition(const LinphoneCallParams *cp) {
return cp->recv_vdef;
}
const char *linphone_call_params_get_record_file(const LinphoneCallParams *cp){
return cp->record_file;
}
......@@ -209,6 +213,10 @@ MSVideoSize linphone_call_params_get_sent_video_size(const LinphoneCallParams *c
return cp->sent_vsize;
}
const LinphoneVideoDefinition * linphone_call_params_get_sent_video_definition(const LinphoneCallParams *cp) {
return cp->sent_vdef;
}
const char *linphone_call_params_get_session_name(const LinphoneCallParams *cp){
return cp->session_name;
}
......@@ -348,6 +356,8 @@ static void _linphone_call_params_uninit(LinphoneCallParams *cp){
if (cp->custom_sdp_media_attributes[i]) sal_custom_sdp_attribute_free(cp->custom_sdp_media_attributes[i]);
}
if (cp->session_name) ms_free(cp->session_name);
if (cp->sent_vdef != NULL) linphone_video_definition_unref(cp->sent_vdef);
if (cp->recv_vdef != NULL) linphone_video_definition_unref(cp->recv_vdef);
}
static void _linphone_call_params_clone(LinphoneCallParams *dst, const LinphoneCallParams *src) {
......@@ -359,7 +369,9 @@ static void _linphone_call_params_clone(LinphoneCallParams *dst, const LinphoneC
belle_sip_object_t tmp = dst->base;
memcpy(dst, src, sizeof(LinphoneCallParams));
dst->base = tmp;
if (src->sent_vdef) dst->sent_vdef = linphone_video_definition_ref(src->sent_vdef);
if (src->recv_vdef) dst->recv_vdef = linphone_video_definition_ref(src->recv_vdef);
if (src->record_file) dst->record_file=ms_strdup(src->record_file);
if (src->session_name) dst->session_name=ms_strdup(src->session_name);
/*
......
......@@ -306,12 +306,15 @@ static void call_received(SalOp *h){
case LinphonePresenceActivityPermanentAbsence:
alt_contact = linphone_presence_model_get_contact(lc->presence_model);
if (alt_contact != NULL) {
sal_call_decline(h,SalReasonRedirect,alt_contact);
SalErrorInfo sei = { 0 };
sal_error_info_set(&sei,SalReasonRedirect, "SIP", 0, NULL, NULL);