Commit db7c8754 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

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

Conflicts:
	build/android/liblinphone_tester.mk
	coreapi/friend.c
	coreapi/friendlist.c
	coreapi/linphonecore_jni.cc
parents bdc8dad0 01ee6e21
......@@ -98,3 +98,4 @@ tester/stereo-record.wav
git-clang-format.diff
*.log
.bc_tester_utils.tmp
tools/lp-test-ecc
......@@ -24,7 +24,8 @@ common_SRC_FILES := \
tunnel_tester.c \
upnp_tester.c \
multicast_call_tester.c \
vcard_tester.c
vcard_tester.c \
complex_sip_call_tester.c \
common_C_INCLUDES += \
$(LOCAL_PATH) \
......
......@@ -187,12 +187,12 @@
${project}/../../gtk/gtkrc.mac
</data>
<data dest="${bundle}/Contents/Resources/share/sounds/linphone/rings/oldphone.wav">
${prefix:linphone}/share/sounds/linphone/rings/oldphone.wav
<data dest="${bundle}/Contents/Resources/share/sounds/linphone/rings/oldphone-mono.wav">
${prefix:linphone}/share/sounds/linphone/rings/oldphone-mono.wav
</data>
<data dest="${bundle}/Contents/Resources/share/sounds/linphone/rings/toy-mono.wav">
${prefix:linphone}/share/sounds/linphone/rings/toy-mono.wav
<data dest="${bundle}/Contents/Resources/share/sounds/linphone/toy-mono.wav">
${prefix:linphone}/share/sounds/linphone/toy-mono.wav
</data>
<data dest="${bundle}/Contents/Resources/share/sounds/linphone/ringback.wav">
......
......@@ -39,6 +39,7 @@ AC_CONFIG_MACRO_DIR([m4])
dnl do not put anythingelse before AC_PROG_CC unless checking if macro still work for clang
AC_PROG_CXX(["xcrun clang++" g++])
AC_PROG_CC(["xcrun clang" gcc])
AC_PROG_OBJC(["xcrun clang" gcc])
gl_LD_OUTPUT_DEF
......@@ -595,6 +596,8 @@ AC_ARG_WITH(ffmpeg,
[ ffmpegdir=/usr ]
)
AM_CONDITIONAL([BUILD_MACOS], [test "x$build_macos" = "xyes"])
if test "$video" = "true"; then
if test "$enable_x11" = "true"; then
......
......@@ -110,122 +110,126 @@ void sal_process_incoming_message(SalOp *op,const belle_sip_request_event_t *eve
from_header=belle_sip_message_get_header_by_type(BELLE_SIP_MESSAGE(req),belle_sip_header_from_t);
content_type=belle_sip_message_get_header_by_type(BELLE_SIP_MESSAGE(req),belle_sip_header_content_type_t);
/* check if we have a xml/cipher message to be decrypted */
if (content_type && (cipher_xml=is_cipher_xml(content_type))) {
/* access the zrtp cache to get keys needed to decipher the message */
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
FILE *CACHEFD = fopen(lc->zrtp_secrets_cache, "rb+");
if (CACHEFD == NULL) {
ms_warning("Unable to access ZRTP ZID cache to decrypt message");
goto error;
} else {
size_t cacheSize;
char *cacheString;
int retval;
xmlDocPtr cacheXml;
cacheString=ms_load_file_content(CACHEFD, &cacheSize);
if (!cacheString){
ms_warning("Unable to load content of ZRTP ZID cache to decrypt message");
goto error;
}
cacheString[cacheSize] = '\0';
cacheSize += 1;
fclose(CACHEFD);
cacheXml = xmlParseDoc((xmlChar*)cacheString);
ms_free(cacheString);
retval = lime_decryptMultipartMessage(cacheXml, (uint8_t *)belle_sip_message_get_body(BELLE_SIP_MESSAGE(req)), &decryptedMessage);
if (retval != 0) {
ms_warning("Unable to decrypt message, reason : %s - op [%p]", lime_error_code_to_string(retval), op);
free(decryptedMessage);
xmlFreeDoc(cacheXml);
errcode = 488;
if (content_type){
/* check if we have a xml/cipher message to be decrypted */
if ((cipher_xml=is_cipher_xml(content_type))) {
/* access the zrtp cache to get keys needed to decipher the message */
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
FILE *CACHEFD = fopen(lc->zrtp_secrets_cache, "rb+");
if (CACHEFD == NULL) {
ms_warning("Unable to access ZRTP ZID cache to decrypt message");
goto error;
} else {
/* dump updated cache to a string */
xmlChar *xmlStringOutput;
int xmlStringLength;
xmlDocDumpFormatMemoryEnc(cacheXml, &xmlStringOutput, &xmlStringLength, "UTF-8", 0);
/* write it to the cache file */
CACHEFD = fopen(lc->zrtp_secrets_cache, "wb+");
if (fwrite(xmlStringOutput, 1, xmlStringLength, CACHEFD)<=0){
ms_warning("Fail to write cache");
size_t cacheSize;
char *cacheString;
int retval;
xmlDocPtr cacheXml;
cacheString=ms_load_file_content(CACHEFD, &cacheSize);
if (!cacheString){
ms_warning("Unable to load content of ZRTP ZID cache to decrypt message");
goto error;
}
xmlFree(xmlStringOutput);
cacheString[cacheSize] = '\0';
cacheSize += 1;
fclose(CACHEFD);
cacheXml = xmlParseDoc((xmlChar*)cacheString);
ms_free(cacheString);
retval = lime_decryptMultipartMessage(cacheXml, (uint8_t *)belle_sip_message_get_body(BELLE_SIP_MESSAGE(req)), &decryptedMessage);
if (retval != 0) {
ms_warning("Unable to decrypt message, reason : %s - op [%p]", lime_error_code_to_string(retval), op);
free(decryptedMessage);
xmlFreeDoc(cacheXml);
errcode = 488;
goto error;
} else {
/* dump updated cache to a string */
xmlChar *xmlStringOutput;
int xmlStringLength;
xmlDocDumpFormatMemoryEnc(cacheXml, &xmlStringOutput, &xmlStringLength, "UTF-8", 0);
/* write it to the cache file */
CACHEFD = fopen(lc->zrtp_secrets_cache, "wb+");
if (fwrite(xmlStringOutput, 1, xmlStringLength, CACHEFD)<=0){
ms_warning("Fail to write cache");
}
xmlFree(xmlStringOutput);
fclose(CACHEFD);
}
xmlFreeDoc(cacheXml);
}
xmlFreeDoc(cacheXml);
}
}
rcs_filetransfer=is_rcs_filetransfer(content_type);
if (content_type && ((plain_text=is_plain_text(content_type))
|| (external_body=is_external_body(content_type))
|| (decryptedMessage!=NULL)
|| rcs_filetransfer)) {
SalMessage salmsg;
char message_id[256]={0};
if (op->pending_server_trans) belle_sip_object_unref(op->pending_server_trans);
op->pending_server_trans=server_transaction;
belle_sip_object_ref(op->pending_server_trans);
external_body=is_external_body(content_type);
plain_text=is_plain_text(content_type);
rcs_filetransfer = is_rcs_filetransfer(content_type);
address=belle_sip_header_address_create(belle_sip_header_address_get_displayname(BELLE_SIP_HEADER_ADDRESS(from_header))
,belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(from_header)));
from=belle_sip_object_to_string(BELLE_SIP_OBJECT(address));
snprintf(message_id,sizeof(message_id)-1,"%s%i"
,belle_sip_header_call_id_get_call_id(call_id)
,belle_sip_header_cseq_get_seq_number(cseq));
salmsg.from=from;
/* if we just deciphered a message, use the deciphered part(which can be a rcs xml body pointing to the file to retreive from server)*/
if (cipher_xml) {
salmsg.text = (char *)decryptedMessage;
} else { /* message body wasn't ciphered */
salmsg.text=(plain_text||rcs_filetransfer)?belle_sip_message_get_body(BELLE_SIP_MESSAGE(req)):NULL;
}
salmsg.url=NULL;
salmsg.content_type = NULL;
if (rcs_filetransfer) { /* if we have a rcs file transfer, set the type, message body (stored in salmsg.text) contains all needed information to retrieve the file */
salmsg.content_type = "application/vnd.gsma.rcs-ft-http+xml";
}
if (external_body && belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")) {
size_t url_length=strlen(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL"));
salmsg.url = ms_strdup(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")+1); /* skip first "*/
((char*)salmsg.url)[url_length-2]='\0'; /*remove trailing "*/
}
salmsg.message_id=message_id;
salmsg.time=date ? belle_sip_header_date_get_time(date) : time(NULL);
op->base.root->callbacks.text_received(op,&salmsg);
if (external_body || plain_text || rcs_filetransfer || decryptedMessage!=NULL) {
SalMessage salmsg;
char message_id[256]={0};
if (op->pending_server_trans) belle_sip_object_unref(op->pending_server_trans);
op->pending_server_trans=server_transaction;
belle_sip_object_ref(op->pending_server_trans);
address=belle_sip_header_address_create(belle_sip_header_address_get_displayname(BELLE_SIP_HEADER_ADDRESS(from_header))
,belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(from_header)));
from=belle_sip_object_to_string(BELLE_SIP_OBJECT(address));
snprintf(message_id,sizeof(message_id)-1,"%s%i"
,belle_sip_header_call_id_get_call_id(call_id)
,belle_sip_header_cseq_get_seq_number(cseq));
salmsg.from=from;
/* if we just deciphered a message, use the deciphered part(which can be a rcs xml body pointing to the file to retreive from server)*/
if (cipher_xml) {
salmsg.text = (char *)decryptedMessage;
} else { /* message body wasn't ciphered */
salmsg.text=(plain_text||rcs_filetransfer)?belle_sip_message_get_body(BELLE_SIP_MESSAGE(req)):NULL;
}
salmsg.url=NULL;
salmsg.content_type = NULL;
if (rcs_filetransfer) { /* if we have a rcs file transfer, set the type, message body (stored in salmsg.text) contains all needed information to retrieve the file */
salmsg.content_type = "application/vnd.gsma.rcs-ft-http+xml";
}
if (external_body && belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")) {
size_t url_length=strlen(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL"));
salmsg.url = ms_strdup(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")+1); /* skip first "*/
((char*)salmsg.url)[url_length-2]='\0'; /*remove trailing "*/
}
salmsg.message_id=message_id;
salmsg.time=date ? belle_sip_header_date_get_time(date) : time(NULL);
op->base.root->callbacks.text_received(op,&salmsg);
free(decryptedMessage);
belle_sip_object_unref(address);
belle_sip_free(from);
if (salmsg.url) ms_free((char*)salmsg.url);
} else if (content_type && is_im_iscomposing(content_type)) {
SalIsComposing saliscomposing;
address=belle_sip_header_address_create(belle_sip_header_address_get_displayname(BELLE_SIP_HEADER_ADDRESS(from_header))
,belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(from_header)));
from=belle_sip_object_to_string(BELLE_SIP_OBJECT(address));
saliscomposing.from=from;
saliscomposing.text=belle_sip_message_get_body(BELLE_SIP_MESSAGE(req));
op->base.root->callbacks.is_composing_received(op,&saliscomposing);
resp = belle_sip_response_create_from_request(req,200);
belle_sip_server_transaction_send_response(server_transaction,resp);
belle_sip_object_unref(address);
belle_sip_free(from);
} else {
ms_error("Unsupported MESSAGE (content-type not recognized)");
resp = belle_sip_response_create_from_request(req,415);
add_message_accept((belle_sip_message_t*)resp);
belle_sip_server_transaction_send_response(server_transaction,resp);
sal_op_release(op);
return;
free(decryptedMessage);
belle_sip_object_unref(address);
belle_sip_free(from);
if (salmsg.url) ms_free((char*)salmsg.url);
} else if (is_im_iscomposing(content_type)) {
SalIsComposing saliscomposing;
address=belle_sip_header_address_create(belle_sip_header_address_get_displayname(BELLE_SIP_HEADER_ADDRESS(from_header))
,belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(from_header)));
from=belle_sip_object_to_string(BELLE_SIP_OBJECT(address));
saliscomposing.from=from;
saliscomposing.text=belle_sip_message_get_body(BELLE_SIP_MESSAGE(req));
op->base.root->callbacks.is_composing_received(op,&saliscomposing);
resp = belle_sip_response_create_from_request(req,200);
belle_sip_server_transaction_send_response(server_transaction,resp);
belle_sip_object_unref(address);
belle_sip_free(from);
}else{
ms_error("Unsupported MESSAGE (content-type not recognized)");
errcode = 415;
goto error;
}
}else {
ms_error("Unsupported MESSAGE (no Content-Type)");
goto error;
}
return;
error:
resp = belle_sip_response_create_from_request(req, errcode);
add_message_accept((belle_sip_message_t*)resp);
belle_sip_server_transaction_send_response(server_transaction,resp);
sal_op_release(op);
}
......@@ -241,6 +245,7 @@ int sal_message_send(SalOp *op, const char *from, const char *to, const char* co
size_t content_length = msg?strlen(msg):0;
time_t curtime=time(NULL);
uint8_t *multipartEncryptedMessage = NULL;
const char *body;
int retval;
if (op->dialog){
......@@ -321,7 +326,11 @@ int sal_message_send(SalOp *op, const char *from, const char *to, const char* co
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(belle_sip_header_content_type_parse(content_type_raw)));
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(belle_sip_header_content_length_create(content_length)));
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(belle_sip_header_date_create_from_time(&curtime)));
belle_sip_message_set_body(BELLE_SIP_MESSAGE(req),(multipartEncryptedMessage==NULL)?msg:(const char *)multipartEncryptedMessage,content_length);
body = (multipartEncryptedMessage==NULL) ? msg : (char*) multipartEncryptedMessage;
if (body){
/*don't call set_body() with null argument because it resets content type and content length*/
belle_sip_message_set_body(BELLE_SIP_MESSAGE(req), body, content_length);
}
retval = sal_op_send_request(op,req);
free(multipartEncryptedMessage);
......
/*
linphone
Copyright (C) 2012 Belledonne Communications, Grenoble, France
......@@ -125,7 +126,7 @@ static void add_rtcp_fb_attributes(belle_sdp_media_description_t *media_desc, co
uint16_t trr_int = 0;
general_trr_int = is_rtcp_fb_trr_int_the_same_for_all_payloads(stream, &trr_int);
if (general_trr_int == TRUE) {
if (general_trr_int == TRUE && trr_int != 0) {
add_rtcp_fb_trr_int_attribute(media_desc, -1, trr_int);
}
if (stream->rtcp_fb.generic_nack_enabled == TRUE) {
......@@ -143,7 +144,7 @@ static void add_rtcp_fb_attributes(belle_sdp_media_description_t *media_desc, co
avpf_params = payload_type_get_avpf_params(pt);
/* Add trr-int if not set generally. */
if (general_trr_int != TRUE) {
if (general_trr_int != TRUE && trr_int != 0) {
add_rtcp_fb_trr_int_attribute(media_desc, payload_type_get_number(pt), avpf_params.trr_interval);
}
......@@ -629,14 +630,15 @@ static void apply_rtcp_fb_attribute_to_payload(belle_sdp_rtcp_fb_attribute_t *fb
payload_type_set_avpf_params(pt, avpf_params);
}
static void sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_desc, SalStreamDescription *stream) {
static bool_t sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_desc, SalStreamDescription *stream) {
belle_sip_list_t *it;
belle_sdp_attribute_t *attribute;
belle_sdp_rtcp_fb_attribute_t *fb_attribute;
MSList *pt_it;
PayloadType *pt;
int8_t pt_num;
bool_t retval = FALSE;
/* Handle rtcp-fb attributes that concern all payload types. */
for (it = belle_sdp_media_description_get_attributes(media_desc); it != NULL; it = it->next) {
attribute = BELLE_SDP_ATTRIBUTE(it->data);
......@@ -646,6 +648,7 @@ static void sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_de
for (pt_it = stream->payloads; pt_it != NULL; pt_it = pt_it->next) {
pt = (PayloadType *)pt_it->data;
apply_rtcp_fb_attribute_to_payload(fb_attribute, stream, pt);
retval = TRUE;
}
}
}
......@@ -659,12 +662,14 @@ static void sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_de
pt_num = belle_sdp_rtcp_fb_attribute_get_id(fb_attribute);
for (pt_it = stream->payloads; pt_it != NULL; pt_it = pt_it->next) {
pt = (PayloadType *)pt_it->data;
retval = TRUE;
if (payload_type_get_number(pt) == (int)pt_num) {
apply_rtcp_fb_attribute_to_payload(fb_attribute, stream, pt);
}
}
}
}
return retval;
}
static void sal_init_rtcp_xr_description(OrtpRtcpXrConfiguration *config) {
......@@ -727,6 +732,7 @@ static SalStreamDescription * sdp_to_stream_description(SalMediaDescription *md,
belle_sip_list_t *custom_attribute_it;
const char* value;
const char *mtype,*proto;
bool_t has_avpf_attributes;
stream=&md->streams[md->nb_streams];
media=belle_sdp_media_description_get_media ( media_desc );
......@@ -830,12 +836,17 @@ static SalStreamDescription * sdp_to_stream_description(SalMediaDescription *md,
/* Get ICE candidate attributes if any */
sdp_parse_media_ice_parameters(media_desc, stream);
has_avpf_attributes = sdp_parse_rtcp_fb_parameters(media_desc, stream);
/* Get RTCP-FB attributes if any */
if (sal_stream_description_has_avpf(stream) || sal_stream_description_has_implicit_avpf(stream)) {
if (sal_stream_description_has_avpf(stream)) {
enable_avpf_for_stream(stream);
sdp_parse_rtcp_fb_parameters(media_desc, stream);
}
else if (has_avpf_attributes ){
stream->implicit_rtcp_fb = TRUE;
}
/* Get RTCP-XR attributes if any */
stream->rtcp_xr = md->rtcp_xr; // Use session parameters if no stream parameters are defined
......
......@@ -156,7 +156,7 @@ void* linphone_friend_get_user_data(const LinphoneFriend *lf){
}
bool_t linphone_friend_in_list(const LinphoneFriend *lf){
return lf->lc!=NULL;
return lf->in_list;
}
void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char **result){
......@@ -528,7 +528,7 @@ void linphone_friend_edit(LinphoneFriend *fr) {
void linphone_friend_done(LinphoneFriend *fr) {
ms_return_if_fail(fr);
if (!fr->lc) return;
if (!fr->lc || !fr->in_list) return;
linphone_friend_apply(fr, fr->lc);
linphone_friend_save(fr, fr->lc);
}
......@@ -548,7 +548,7 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf) {
lc->subscribers = ms_list_remove(lc->subscribers, lf);
linphone_friend_unref(lf);
}
lf->lc = lc;
lf->lc = lc; /*I would prefer this to be done in linphone_friend_list_add_friend()*/
if (linphone_core_ready(lc)) linphone_friend_apply(lf, lc);
else lf->commit = TRUE;
linphone_friend_save(lf, lc);
......
......@@ -291,7 +291,10 @@ void linphone_friend_list_set_rls_uri(LinphoneFriendList *list, const char *rls_
}
LinphoneFriendListStatus linphone_friend_list_add_friend(LinphoneFriendList *list, LinphoneFriend *lf) {
if ((lf->lc != NULL) || (lf->uri == NULL)) return LinphoneFriendListInvalidFriend;
if (lf->uri == NULL || lf->in_list) {
ms_error("linphone_friend_list_add_friend(): invalid friend");
return LinphoneFriendListInvalidFriend;
}
if (ms_list_find(list->friends, lf) != NULL) {
char *tmp = NULL;
const LinphoneAddress *addr = linphone_friend_get_address(lf);
......@@ -299,6 +302,7 @@ LinphoneFriendListStatus linphone_friend_list_add_friend(LinphoneFriendList *lis
ms_warning("Friend %s already in list [%s], ignored.", tmp ? tmp : "unknown", list->display_name);
if (tmp) ms_free(tmp);
} else {
lf->in_list = TRUE;
return linphone_friend_list_import_friend(list, lf);
}
return LinphoneFriendListOK;
......@@ -318,7 +322,8 @@ LinphoneFriendListStatus linphone_friend_list_remove_friend(LinphoneFriendList *
linphone_core_remove_friend_from_db(lf->lc, lf);
#endif
linphone_friend_unref((LinphoneFriend *)elem->data);
lf->in_list = FALSE;
linphone_friend_unref(lf);
list->friends = ms_list_remove_link(list->friends, elem);
return LinphoneFriendListOK;
}
......
......@@ -22,8 +22,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define LINPHONE_FRIENDLIST_H_
#ifdef IN_LINPHONE
#include "linphonefriend.h"
#include "linphonepresence.h"
#else
#include "linphone/linphonefriend.h"
#include "linphone/linphonepresence.h"
#endif
#ifdef __cplusplus
......
This diff is collapsed.
......@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* @defgroup real_time_text Real Time Text Sender
* @defgroup real_time_text_sender Real Time Text Sender
* @ingroup tutorials
This program just send chat message in real time to dest uri. Use realtimetext_receiver to receive message.
usage: ./realtimetext_sender sip:localhost:5060
......
......@@ -1452,6 +1452,7 @@ void linphone_call_fix_call_parameters(LinphoneCall *call, SalMediaDescription *
if (rmd) {
linphone_call_compute_streams_indexes(call, rmd);
linphone_call_update_biggest_desc(call, rmd);
call->params->implicit_rtcp_fb &= sal_media_description_has_implicit_avpf(rmd);
}
rcp = linphone_call_get_remote_params(call);
if (rcp){
......@@ -1767,9 +1768,8 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
break;
case LinphoneMediaEncryptionNone:
call->current_params->media_encryption=LinphoneMediaEncryptionNone;
break;
break;
}
call->current_params->avpf_enabled = linphone_call_all_streams_avpf_enabled(call) && sal_media_description_has_avpf(md);
if (call->current_params->avpf_enabled == TRUE) {
call->current_params->avpf_rr_interval = linphone_call_get_avpf_rr_interval(call);
......@@ -1780,6 +1780,7 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
const char *rtp_addr;
SalStreamDescription *sd=sal_media_description_find_best_stream(md,SalAudio);
call->current_params->audio_dir=sd ? media_direction_from_sal_stream_dir(sd->dir) : LinphoneMediaDirectionInactive;
if (call->current_params->audio_dir != LinphoneMediaDirectionInactive) {
rtp_addr = sd->rtp_addr[0]!='\0' ? sd->rtp_addr : call->resultdesc->addr;
......@@ -1788,6 +1789,7 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
call->current_params->audio_multicast_enabled = FALSE;
sd=sal_media_description_find_best_stream(md,SalVideo);
call->current_params->implicit_rtcp_fb = sd ? sal_stream_description_has_implicit_avpf(sd): FALSE;
call->current_params->video_dir=sd ? media_direction_from_sal_stream_dir(sd->dir) : LinphoneMediaDirectionInactive;
if (call->current_params->video_dir != LinphoneMediaDirectionInactive) {
rtp_addr = sd->rtp_addr[0]!='\0' ? sd->rtp_addr : call->resultdesc->addr;
......@@ -1795,7 +1797,8 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
} else
call->current_params->video_multicast_enabled = FALSE;
sd=sal_media_description_find_best_stream(md,SalText);
}
return call->current_params;
......@@ -2043,10 +2046,11 @@ void linphone_call_enable_camera (LinphoneCall *call, bool_t enable){
void linphone_call_send_vfu_request(LinphoneCall *call) {
#ifdef VIDEO_ENABLED
const LinphoneCallParams *current_params = linphone_call_get_current_params(call);
if (current_params->avpf_enabled && call->videostream && media_stream_get_state((const MediaStream *)call->videostream) == MSStreamStarted) {
if ((current_params->avpf_enabled || current_params->implicit_rtcp_fb )&& call->videostream && media_stream_get_state((const MediaStream *)call->videostream) == MSStreamStarted) { // || sal_media_description_has_implicit_avpf((const SalMediaDescription *)call->resultdesc)
ms_message("Request Full Intra Request on call [%p]", call);
video_stream_send_fir(call->videostream);
} else if (call->core->sip_conf.vfu_with_info) {
ms_message("Request SIP INFO FIR on call [%p]", call);
if (LinphoneCallStreamsRunning == linphone_call_get_state(call))
sal_call_send_vfu_request(call->op);
} else {
......
......@@ -116,11 +116,13 @@ static void toggle_video_preview(LinphoneCore *lc, bool_t val);
#define SOUNDS_PREFIX
#endif
/* relative path where is stored local ring*/
#define LOCAL_RING SOUNDS_PREFIX "rings/oldphone.wav"
#define LOCAL_RING SOUNDS_PREFIX "rings/oldphone-mono.wav"
#define LOCAL_RING_MKV SOUNDS_PREFIX "rings/notes_of_the_optimistic.mkv"
/* same for remote ring (ringback)*/
#define REMOTE_RING SOUNDS_PREFIX "ringback.wav"
#define HOLD_MUSIC SOUNDS_PREFIX "rings/toy-mono.wav"
#define HOLD_MUSIC SOUNDS_PREFIX "toy-mono.wav"
#define HOLD_MUSIC_MKV SOUNDS_PREFIX "dont_wait_too_long.mkv"
extern SalCallbacks linphone_sal_callbacks;
......@@ -815,6 +817,20 @@ static void build_sound_devices_table(LinphoneCore *lc){
if (old!=NULL) ms_free(old);
}
static const char *get_default_local_ring(LinphoneCore * lc){
if (linphone_core_file_format_supported(lc, "mkv")){
return PACKAGE_SOUND_DIR "/" LOCAL_RING_MKV;
}
return PACKAGE_SOUND_DIR "/" LOCAL_RING;
}
static const char *get_default_onhold_music(LinphoneCore * lc){
if (linphone_core_file_format_supported(lc, "mkv")){
return PACKAGE_SOUND_DIR "/" HOLD_MUSIC_MKV;
}
return PACKAGE_SOUND_DIR "/" HOLD_MUSIC;
}
static void sound_config_read(LinphoneCore *lc)
{
int tmp;
......@@ -870,15 +886,11 @@ static void sound_config_read(LinphoneCore *lc)
linphone_core_set_sound_source(lc,tmpbuf[0]);
*/
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
tmpbuf = get_default_local_ring(lc);
tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf);
if (ortp_file_exist(tmpbuf)==-1) {
ms_warning("%s does not exist",tmpbuf);
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
}
if (strstr(tmpbuf,".wav")==NULL){
/* it currently uses old sound files, so replace them */
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
tmpbuf = get_default_local_ring(lc);
}
linphone_core_set_ring(lc,tmpbuf);
......@@ -893,7 +905,7 @@ static void sound_config_read(LinphoneCore *lc)