Commit 3995ab27 authored by Sandrine Avakian's avatar Sandrine Avakian
Browse files

Merge branch 'master' of git://git.linphone.org/linphone

parents 2eb42219 8eb81718
......@@ -215,8 +215,7 @@ static void linphone_chat_message_process_response_from_post_file(void *data,
linphone_content_get_subtype(msg->file_transfer_information)));
/* insert it in a multipart body handler which will manage the boundaries of multipart msg */
bh = belle_sip_multipart_body_handler_new(linphone_chat_message_file_transfer_on_progress, msg,
first_part_bh);
bh = belle_sip_multipart_body_handler_new(linphone_chat_message_file_transfer_on_progress, msg, first_part_bh, NULL);
linphone_chat_message_ref(msg);
_release_http_request(msg);
......
......@@ -2929,6 +2929,16 @@ static RtpSession * create_audio_rtp_io_session(LinphoneCall *call) {
return rtp_session;
}
static void linphone_call_set_on_hold_file(LinphoneCall *call, const char *file){
if (call->onhold_file){
ms_free(call->onhold_file);
call->onhold_file = NULL;
}
if (file){
call->onhold_file = ms_strdup(file);
}
}
static void linphone_call_start_audio_stream(LinphoneCall *call, LinphoneCallState next_state, bool_t use_arc){
LinphoneCore *lc=call->core;
int used_pt=-1;
......@@ -3069,12 +3079,6 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, LinphoneCallSta
&io);
if (err == 0){
post_configure_audio_streams(call, (call->all_muted || call->audio_muted) && !call->playing_ringbacktone);
if (file_to_play){
MSFilter *player = audio_stream_open_remote_play(call->audiostream, file_to_play);
if (player){
ms_filter_call_method_noarg(player, MS_PLAYER_START);
}
}
}
}
......@@ -3097,6 +3101,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, LinphoneCallSta
call->current_params->low_bandwidth=call->params->low_bandwidth;
}else ms_warning("No audio stream accepted ?");
}
linphone_call_set_on_hold_file(call, file_to_play);
}
#ifdef VIDEO_ENABLED
......@@ -3428,6 +3433,13 @@ void linphone_call_start_media_streams(LinphoneCall *call, LinphoneCallState nex
if (call->audiostream) audio_stream_link_video(call->audiostream,call->videostream);
linphone_call_start_video_stream(call, next_state);
}
/*the onhold file is to be played once both audio and video are ready.*/
if (call->onhold_file && !call->params->in_conference && call->audiostream){
MSFilter *player = audio_stream_open_remote_play(call->audiostream, call->onhold_file);
if (player){
ms_filter_call_method_noarg(player, MS_PLAYER_START);
}
}
call->up_bw=linphone_core_get_upload_bandwidth(lc);
......
......@@ -520,7 +520,7 @@ static void process_response_from_post_file_log_collection(void *data, const bel
(belle_sip_header_t *)belle_sip_header_content_type_create(linphone_content_get_type(core->log_collection_upload_information), linphone_content_get_subtype(core->log_collection_upload_information)));
/* Insert it in a multipart body handler which will manage the boundaries of multipart message */
bh = belle_sip_multipart_body_handler_new(log_collection_upload_on_progress, core, (belle_sip_body_handler_t *)first_part_bh);
bh = belle_sip_multipart_body_handler_new(log_collection_upload_on_progress, core, (belle_sip_body_handler_t *)first_part_bh, NULL);
ua = ms_strdup_printf("%s/%s", linphone_core_get_user_agent_name(), linphone_core_get_user_agent_version());
uri = belle_generic_uri_parse(linphone_core_get_log_collection_upload_server_url(core));
req = belle_http_request_create("POST", uri, belle_sip_header_create("User-Agent", ua), NULL);
......@@ -1609,7 +1609,7 @@ static void linphone_core_register_default_codecs(LinphoneCore *lc){
linphone_core_register_payload_type(lc,&payload_type_speex_nb,"vbr=on",TRUE);
linphone_core_register_payload_type(lc,&payload_type_pcmu8000,NULL,TRUE);
linphone_core_register_payload_type(lc,&payload_type_pcma8000,NULL,TRUE);
/* Text codecs in order or preference (RED first (more robust), then T140) */
linphone_core_register_payload_type(lc, &payload_type_t140_red, NULL, TRUE);
linphone_core_register_payload_type(lc, &payload_type_t140, NULL, TRUE);
......@@ -2576,7 +2576,7 @@ void linphone_core_iterate(LinphoneCore *lc){
lc->prevtime_ms = curtime_ms;
}else{
lc->prevtime_ms += 1000;
}
}
......@@ -6732,7 +6732,7 @@ const char *linphone_reason_to_string(LinphoneReason err){
case LinphoneReasonIOError:
return "IO error";
case LinphoneReasonDoNotDisturb:
return "Do not distrub";
return "Do not disturb";
case LinphoneReasonUnauthorized:
return "Unauthorized";
case LinphoneReasonNotAcceptable:
......
......@@ -3360,11 +3360,11 @@ LINPHONE_PUBLIC bool_t linphone_core_video_supported(LinphoneCore *lc);
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_enable_video(LinphoneCore *lc, bool_t vcap_enabled, bool_t display_enabled);
/**
* Returns TRUE if video is enabled, FALSE otherwise.
* Returns TRUE if either capture or display is enabled, FALSE otherwise.
* same as ( #linphone_core_video_capture_enabled | #linphone_core_video_display_enabled )
* @ingroup media_parameters
* @deprecated Use #linphone_core_video_capture_enabled and #linphone_core_video_display_enabled instead.
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED bool_t linphone_core_video_enabled(LinphoneCore *lc);
LINPHONE_PUBLIC bool_t linphone_core_video_enabled(LinphoneCore *lc);
/**
* Enable or disable video capture.
......
......@@ -6570,4 +6570,23 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getSipTransportTi
return linphone_core_get_sip_transport_timeout((LinphoneCore*)pcore);
}
/*
* Class: org_linphone_core_LinphoneCoreImpl
* Method: setNortpTimeout
* Signature: (JI)V
*/
JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_setNortpTimeout(JNIEnv *env, jobject obj, jlong core, jint timeout){
linphone_core_set_nortp_timeout((LinphoneCore*)core, timeout);
}
/*
* Class: org_linphone_core_LinphoneCoreImpl
* Method: getNortpTimeout
* Signature: (J)I
*/
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getNortpTimeout(JNIEnv *env, jobject obj, jlong core){
return linphone_core_get_nortp_timeout((LinphoneCore*)core);
}
......@@ -213,7 +213,6 @@ struct _LinphoneChatMessage {
LinphoneChatMessageCbs *callbacks;
LinphoneChatMessageDir dir;
char* message;
LinphoneChatMessageStateChangedCb message_state_changed_cb;
void* message_state_changed_user_data;
void* message_userdata;
char* appdata;
......@@ -231,6 +230,15 @@ struct _LinphoneChatMessage {
belle_http_request_t *http_request; /**< keep a reference to the http_request in case of file transfer in order to be able to cancel the transfer */
belle_http_request_listener_t *http_listener; /* our listener, only owned by us*/
char *file_transfer_filepath;
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#pragma GCC diagnostic push
#endif
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
LinphoneChatMessageStateChangedCb message_state_changed_cb;
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#pragma GCC diagnostic pop
#endif
};
BELLE_SIP_DECLARE_VPTR(LinphoneChatMessage);
......@@ -310,6 +318,7 @@ struct _LinphoneCall{
belle_sip_source_t *dtmfs_timer; /*DTMF timer needed to send a DTMF sequence*/
char *dtls_certificate_fingerprint; /**> This fingerprint is computed during stream init and is stored in call to be used when making local media description */
char *onhold_file; /*set if a on-hold file is to be played*/
LinphoneChatRoom *chat_room;
bool_t refer_pending;
bool_t expect_media_in_ack;
......@@ -1386,6 +1395,8 @@ bool_t linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc);
BELLE_SIP_DECLARE_VPTR(LinphoneTunnelConfig);
int linphone_core_get_default_proxy_config_index(LinphoneCore *lc);
#ifdef __cplusplus
}
#endif
......
......@@ -93,7 +93,7 @@ void linphone_proxy_config_write_all_to_config_file(LinphoneCore *lc){
}
/*to ensure removed configs are erased:*/
linphone_proxy_config_write_to_config_file(lc->config,NULL,i);
lp_config_set_int(lc->config,"sip","default_proxy",linphone_core_get_default_proxy(lc,NULL));
lp_config_set_int(lc->config,"sip","default_proxy",linphone_core_get_default_proxy_config_index(lc));
}
static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *cfg) {
......@@ -1167,7 +1167,7 @@ void linphone_core_clear_proxy_config(LinphoneCore *lc){
linphone_proxy_config_write_all_to_config_file(lc);
}
static int linphone_core_get_default_proxy_config_index(LinphoneCore *lc) {
int linphone_core_get_default_proxy_config_index(LinphoneCore *lc) {
int pos = -1;
if (lc->default_proxy != NULL) {
pos = ms_list_position(lc->sip_conf.proxies, ms_list_find(lc->sip_conf.proxies, (void *)lc->default_proxy));
......
......@@ -652,7 +652,7 @@ gboolean linphone_gtk_directory_search_focus_in(GtkWidget *entry){
void linphone_gtk_directory_search_activate(GtkWidget *entry){
LinphoneProxyConfig *cfg;
GtkWidget *w;
linphone_core_get_default_proxy(linphone_gtk_get_core(),&cfg);
cfg = linphone_core_get_default_proxy_config(linphone_gtk_get_core());
w=linphone_gtk_show_buddy_lookup_window(linphone_proxy_config_get_sip_setup_context(cfg));
if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(entry),"active"))==1)
linphone_gtk_buddy_lookup_set_keyword(w,gtk_entry_get_text(GTK_ENTRY(entry)));
......@@ -809,7 +809,7 @@ static GtkWidget *linphone_gtk_create_contact_menu(GtkWidget *contact_list){
SipSetupContext * ssc=NULL;
bool_t show_menu_separator=FALSE;
linphone_core_get_default_proxy(lc,&cfg);
cfg = linphone_core_get_default_proxy_config(lc);
if (cfg){
ssc=linphone_proxy_config_get_sip_setup_context(cfg);
}
......
......@@ -914,7 +914,7 @@ void linphone_gtk_draw_mute_button(GtkButton *button, gboolean active){
void linphone_gtk_mute_clicked(GtkButton *button){
int active=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),"active"));
linphone_core_mute_mic(linphone_gtk_get_core(),!active);
linphone_core_enable_mic(linphone_gtk_get_core(),active);
linphone_gtk_draw_mute_button(button,!active);
}
......
......@@ -143,7 +143,7 @@ void linphone_gtk_exit_login_frame(void){
void linphone_gtk_logout_clicked(void){
LinphoneCore *lc=linphone_gtk_get_core();
LinphoneProxyConfig *cfg=NULL;
linphone_core_get_default_proxy(lc,&cfg);
cfg = linphone_core_get_default_proxy_config(lc);
if (cfg){
SipSetupContext *ss=linphone_proxy_config_get_sip_setup_context(cfg);
if (ss){
......
......@@ -69,11 +69,7 @@ static void linphone_gtk_registration_state_changed(LinphoneCore *lc, LinphonePr
static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid);
static void linphone_gtk_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf, const char *url);
static void linphone_gtk_auth_info_requested(LinphoneCore *lc, const char *realm, const char *username, const char *domain);
static void linphone_gtk_display_status(LinphoneCore *lc, const char *status);
static void linphone_gtk_configuring_status(LinphoneCore *lc, LinphoneConfiguringState status, const char *message);
static void linphone_gtk_display_message(LinphoneCore *lc, const char *msg);
static void linphone_gtk_display_warning(LinphoneCore *lc, const char *warning);
static void linphone_gtk_display_url(LinphoneCore *lc, const char *msg, const char *url);
static void linphone_gtk_call_log_updated(LinphoneCore *lc, LinphoneCallLog *cl);
static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cs, const char *msg);
static void linphone_gtk_call_encryption_changed(LinphoneCore *lc, LinphoneCall *call, bool_t enabled, const char *token);
......@@ -267,12 +263,7 @@ static void linphone_gtk_init_liblinphone(const char *config_file,
vtable.notify_presence_received=linphone_gtk_notify_recv;
vtable.new_subscription_requested=linphone_gtk_new_unknown_subscriber;
vtable.auth_info_requested=linphone_gtk_auth_info_requested;
vtable.display_status=linphone_gtk_display_status;
vtable.display_message=linphone_gtk_display_message;
vtable.display_warning=linphone_gtk_display_warning;
vtable.display_url=linphone_gtk_display_url;
vtable.call_log_updated=linphone_gtk_call_log_updated;
//vtable.text_received=linphone_gtk_text_received;
vtable.message_received=linphone_gtk_text_received;
vtable.is_composing_received=linphone_gtk_is_composing_received;
vtable.refer_received=linphone_gtk_refer_received;
......@@ -1133,34 +1124,12 @@ static void linphone_gtk_dtmf_received(LinphoneCore *lc, LinphoneCall *call, int
ms_message("Dtmf %c received.",dtmf);
}
static void linphone_gtk_display_status(LinphoneCore *lc, const char *status){
GtkWidget *w=linphone_gtk_get_main_window();
GtkWidget *status_bar=linphone_gtk_get_widget(w,"status_bar");
gtk_statusbar_push(GTK_STATUSBAR(status_bar),
gtk_statusbar_get_context_id(GTK_STATUSBAR(status_bar),""),
status);
}
static void linphone_gtk_configuring_status(LinphoneCore *lc, LinphoneConfiguringState status, const char *message) {
if (config_fetching_dialog) linphone_gtk_close_config_fetching(config_fetching_dialog, status);
config_fetching_dialog=NULL;
}
static void linphone_gtk_display_message(LinphoneCore *lc, const char *msg){
linphone_gtk_display_something(GTK_MESSAGE_INFO,msg);
}
static void linphone_gtk_display_warning(LinphoneCore *lc, const char *warning){
linphone_gtk_display_something(GTK_MESSAGE_WARNING,warning);
}
static void linphone_gtk_display_url(LinphoneCore *lc, const char *msg, const char *url){
char richtext[4096];
snprintf(richtext,sizeof(richtext),"%s %s",msg,url);
linphone_gtk_display_something(GTK_MESSAGE_INFO,richtext);
}
static void linphone_gtk_call_log_updated(LinphoneCore *lc, LinphoneCallLog *cl){
GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"call_logs");
if (w) linphone_gtk_call_log_update(w);
......@@ -1624,7 +1593,7 @@ void linphone_gtk_load_identities(void){
store=GTK_LIST_STORE(gtk_combo_box_get_model(box));
}
gtk_list_store_clear(store);
linphone_core_get_default_proxy(linphone_gtk_get_core(),&def);
def = linphone_core_get_default_proxy_config(linphone_gtk_get_core());
def_identity=g_strdup_printf(_("%s (Default)"),linphone_core_get_primary_contact(linphone_gtk_get_core()));
gtk_list_store_append(store,&iter);
gtk_list_store_set(store,&iter,0,def_identity,1,NULL,2,NULL,-1);
......@@ -1651,7 +1620,7 @@ static void linphone_gtk_dtmf_pressed(GtkButton *button){
gtk_editable_insert_text(GTK_EDITABLE(uri_bar),label,1,&pos);
linphone_core_play_dtmf (linphone_gtk_get_core(),label[0],-1);
if (linphone_core_in_call(linphone_gtk_get_core())){
linphone_core_send_dtmf(linphone_gtk_get_core(),label[0]);
linphone_call_send_dtmf(linphone_core_get_current_call(linphone_gtk_get_core()),label[0]);
}
}
......@@ -1738,8 +1707,7 @@ static void linphone_gtk_configure_main_window(void){
void linphone_gtk_manage_login(void){
LinphoneCore *lc=linphone_gtk_get_core();
LinphoneProxyConfig *cfg=NULL;
linphone_core_get_default_proxy(lc,&cfg);
LinphoneProxyConfig *cfg=linphone_core_get_default_proxy_config(lc);
if (cfg){
SipSetup *ss=linphone_proxy_config_get_sip_setup(cfg);
if (ss && (sip_setup_get_capabilities(ss) & SIP_SETUP_CAP_LOGIN)){
......
......@@ -2220,4 +2220,15 @@ public interface LinphoneCore {
**/
public int getHttpProxyPort();
/*
* Set the nortp timeout (timeout after which call is closed if no RTP or RTCP packets are received).
*/
public void setNortpTimeout(int seconds);
/**
* Get the nortp timeout.
* @return
*/
public int getNortpTimeout();
}
......@@ -1111,7 +1111,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private native void setSipDscp(long nativePtr, int dscp);
@Override
public synchronized void setSipDscp(int dscp) {
setSipDscp(nativePtr,dscp);
setSipDscp(nativePtr, dscp);
}
private native int getSipDscp(long nativePtr);
......@@ -1276,7 +1276,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private native void setMtu(long nativePtr, int mtu);
@Override
public synchronized void setMtu(int mtu) {
setMtu(nativePtr,mtu);
setMtu(nativePtr, mtu);
}
private native int getMtu(long nativePtr);
@Override
......@@ -1285,7 +1285,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
@Override
public synchronized void enableSdp200Ack(boolean enable) {
enableSdp200Ack(nativePtr,enable);
enableSdp200Ack(nativePtr, enable);
}
@Override
public synchronized boolean isSdp200AckEnabled() {
......@@ -1340,7 +1340,7 @@ class LinphoneCoreImpl implements LinphoneCore {
@Override
public synchronized void enableAdaptiveRateControl(boolean enable) {
enableAdaptiveRateControl(nativePtr,enable);
enableAdaptiveRateControl(nativePtr, enable);
}
@Override
......@@ -1423,7 +1423,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private native void setPreferredFramerate(long nativePtr, float fps);
@Override
public void setPreferredFramerate(float fps) {
setPreferredFramerate(nativePtr,fps);
setPreferredFramerate(nativePtr, fps);
}
private native float getPreferredFramerate(long nativePtr);
@Override
......@@ -1578,5 +1578,15 @@ class LinphoneCoreImpl implements LinphoneCore {
public int getSipTransportTimeout(){
return getSipTransportTimeout(nativePtr);
}
private native void setNortpTimeout(long nativePtr, int timeout);
@Override
public void setNortpTimeout(int timeout){
setNortpTimeout(nativePtr, timeout);
}
private native int getNortpTimeout(long nativePtr);
@Override
public int getNortpTimeout(){
return getNortpTimeout(nativePtr);
}
}
......@@ -10,6 +10,7 @@ mediastreamer2/src/audiofilters/dtmfgen.c
mediastreamer2/src/audiofilters/equalizer.c
mediastreamer2/src/audiofilters/gsm.c
mediastreamer2/src/audiofilters/genericplc.c
mediastreamer2/src/audiofilters/msgenericplc.c
mediastreamer2/src/audiofilters/macsnd.c
mediastreamer2/src/audiofilters/msconf.c
mediastreamer2/src/audiofilters/msfileplayer.c
......
......@@ -5613,6 +5613,40 @@ static void call_with_ice_and_rtcp_mux_without_reinvite(void){
_call_with_rtcp_mux(TRUE, TRUE, TRUE,FALSE);
}
static void call_with_zrtp_configured_calling_base(LinphoneCoreManager *marie, LinphoneCoreManager *pauline) {
bool_t call_ok;
linphone_core_set_media_encryption(marie->lc, LinphoneMediaEncryptionZRTP);
BC_ASSERT_TRUE((call_ok=call(pauline,marie)));
liblinphone_tester_check_rtcp(marie,pauline);
BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(linphone_core_get_current_call(marie->lc)))
, LinphoneMediaEncryptionNone, int, "%i");
BC_ASSERT_EQUAL(linphone_call_params_get_media_encryption(linphone_call_get_current_params(linphone_core_get_current_call(pauline->lc)))
, LinphoneMediaEncryptionNone, int, "%i");
end_call(pauline, marie);
}
static void call_with_zrtp_configured_calling_side(void) {
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
call_with_zrtp_configured_calling_base(marie,pauline);
linphone_core_set_user_agent(pauline->lc, "Natted Linphone", NULL);
linphone_core_set_user_agent(marie->lc, "Natted Linphone", NULL);
call_with_zrtp_configured_calling_base(marie,pauline);
linphone_core_set_firewall_policy(marie->lc,LinphonePolicyUseIce);
linphone_core_set_firewall_policy(pauline->lc,LinphonePolicyUseIce);
call_with_zrtp_configured_calling_base(marie,pauline);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
test_t call_tests[] = {
{ "Early declined call", early_declined_call },
{ "Call declined", call_declined },
......@@ -5776,7 +5810,8 @@ test_t call_tests[] = {
{ "Call with rtcp-mux", call_with_rtcp_mux},
{ "Call with rtcp-mux not accepted", call_with_rtcp_mux_not_accepted},
{ "Call with ICE and rtcp-mux", call_with_ice_and_rtcp_mux},
{ "Call with ICE and rtcp-mux without ICE re-invite", call_with_ice_and_rtcp_mux_without_reinvite}
{ "Call with ICE and rtcp-mux without ICE re-invite", call_with_ice_and_rtcp_mux_without_reinvite},
{ "call with ZRTP configured calling side only", call_with_zrtp_configured_calling_side}
};
test_suite_t call_test_suite = {"Single Call", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
......
......@@ -96,7 +96,7 @@ LinphoneBuffer * tester_file_transfer_send(LinphoneChatMessage *msg, const Linph
size_t size_to_send;
uint8_t *buf;
FILE *file_to_send = linphone_chat_message_get_user_data(msg);
BC_ASSERT_PTR_NOT_NULL(file_to_send);
if (file_to_send == NULL){
return NULL;
......@@ -802,6 +802,37 @@ static void lime_text_message(void) {
linphone_core_manager_destroy(pauline);
}
static void lime_text_message_to_non_lime(void) {
FILE *ZIDCachePaulineFD;
LinphoneChatRoom* chat_room;
char* filepath;
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
/* make sure lime is enabled */
linphone_core_enable_lime(marie->lc, 0);
linphone_core_enable_lime(pauline->lc, 1);
/* set the zid caches files : create two ZID cache from this valid one inserting the auto-generated sip URI for the peer account as keys in ZID cache are indexed by peer sip uri */
ZIDCachePaulineFD = fopen_from_write_dir("tmpZIDCachePauline.xml", "w");
fprintf(ZIDCachePaulineFD, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<cache><selfZID>005dbe0399643d953a2202dd</selfZID><peer><ZID>ef7692d0792a67491ae2d44e</ZID><rs1>9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045</rs1><aux>f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e</aux><rs2>2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899</rs2><uri>%s</uri><rcvKey>08df5907d30959b8cb70f6fff2d8febd88fb41b0c8afc39e4b972f86dd5cfe2d</rcvKey><sndKey>60f020a3fe11dc2cc0e1e8ed9341b4cd14944db806ca4fc95456bbe45d95c43a</sndKey><rcvSId>5f9aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b77193</rcvSId><sndSId>bcffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b77193</sndSId><rcvIndex>00000078</rcvIndex><sndIndex>000001cf</sndIndex><pvs>01</pvs></peer><peer><ZID>1234567889643d953a2202ee</ZID><rs1>9b5c8f06f3b6c2c695f2dfc3c26f31f5fef8661f8c5fe7c95aeb5c5b0435b045</rs1><aux>f8324dd18ea905171ec2be89f879d01d5994132048d92ea020778cbdf31c605e</aux><rs2>2fdcef69380937c2cf221f7d11526f286c39f49641452ba9012521c705094899</rs2><uri>%s</uri><sndKey>81e6e6362c34dc974263d1f77cbb9a8d6d6a718330994379099a8fa19fb12faa</sndKey><rcvKey>25d9ac653a83c4559cb0ae7394e7cd3b2d3c57bb28e62068d2df23e8f9b77193</rcvKey><sndSId>f69aa1e5e4c7ec88fa389a9f6b8879b42d3c57bb28e62068d2df23e8f9b77193</sndSId><rcvSId>22ffd51e7316a6c6f53a50fcf01b01bf2d3c57bb28e62068d2df23e8f9b77193</rcvSId><sndIndex>0000002e</sndIndex><rcvIndex>00000000</rcvIndex><pvs>01</pvs></peer></cache>", linphone_address_as_string_uri_only(marie->identity), linphone_address_as_string_uri_only(marie->identity));
fclose(ZIDCachePaulineFD);
filepath = bc_tester_file("tmpZIDCachePauline.xml");
linphone_core_set_zrtp_secrets_file(pauline->lc, filepath);
ms_free(filepath);
chat_room = linphone_core_get_chat_room(pauline->lc, marie->identity);
linphone_chat_room_send_message(chat_room,"Bla bla bla bla");
//since we cannot decrypt message, we should not receive any message
BC_ASSERT_FALSE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceived,1));
BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageReceivedLegacy,0, int, "%d");
BC_ASSERT_PTR_NOT_NULL(linphone_core_get_chat_room(marie->lc,pauline->identity));
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
void lime_transfer_message_base(bool_t encrypt_file) {
FILE *ZIDCacheMarieFD, *ZIDCachePaulineFD;
LinphoneCoreManager *marie, *pauline;
......@@ -1295,7 +1326,7 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCallParams *marie_params = NULL;
LinphoneCall *pauline_call, *marie_call;
if (mess_with_marie_payload_number) {
MSList *elem;
for (elem = marie->lc->codecs_conf.text_codecs; elem != NULL; elem = elem->next) {
......@@ -1315,12 +1346,12 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo
}
}
}
if (ice_enabled) {
linphone_core_set_firewall_policy(marie->lc, LinphonePolicyUseIce);
linphone_core_set_firewall_policy(pauline->lc, LinphonePolicyUseIce);
}
if (srtp_enabled) {
BC_ASSERT_TRUE(linphone_core_media_encryption_supported(marie->lc, LinphoneMediaEncryptionSRTP));
linphone_core_set_media_encryption(marie->lc, LinphoneMediaEncryptionSRTP);
......@@ -1336,7 +1367,7 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo
linphone_core_set_nortp_timeout(marie->lc, 10);
linphone_core_set_nortp_timeout(pauline->lc, 10);
}
BC_ASSERT_TRUE(call_with_caller_params(marie, pauline, marie_params));
pauline_call = linphone_core_get_current_call(pauline->lc);
marie_call = linphone_core_get_current_call(marie->lc);
......@@ -1353,7 +1384,7 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo
int i;
LinphoneChatMessage* rtt_message = linphone_chat_room_create_message(pauline_chat_room,NULL);
LinphoneChatRoom *marie_chat_room = linphone_call_get_chat_room(marie_call);
for (i = 0; i < strlen(message); i++) {
linphone_chat_message_put_char(rtt_message, message[i]);
BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000));
......@@ -1369,7 +1400,7 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo
BC_ASSERT_FALSE(marie->stat.number_of_LinphoneCallEnd > 0);
BC_ASSERT_FALSE(pauline->stat.number_of_LinphoneCallEnd > 0);
}
if (ice_enabled) {
BC_ASSERT_TRUE(check_ice(pauline,marie,LinphoneIceStateHostConnection));
}
......@@ -1505,7 +1536,7 @@ static void real_time_text_message_compat(bool_t end_with_crlf, bool_t end_with_
marie_params = linphone_core_create_call_params(marie->lc, NULL);
linphone_call_params_enable_realtime_text(marie_params,TRUE);
BC_ASSERT_TRUE(call_with_caller_params(marie, pauline, marie_params));
pauline_call=linphone_core_get_current_call(pauline->lc);
marie_call=linphone_core_get_current_call(marie->lc);
......@@ -1527,7 +1558,7 @@ static void real_time_text_message_compat(bool_t end_with_crlf, bool_t end_with_
BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000));
BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message[i], char, "%c");
}
if (end_with_crlf) {
linphone_chat_message_put_char(rtt_message, crlf);
} else if (end_with_lf) {
......@@ -1560,7 +1591,7 @@ static void real_time_text_message_accented_chars(void) {
marie_params = linphone_core_create_call_params(marie->lc, NULL);
linphone_call_params_enable_realtime_text(marie_params,TRUE);
BC_ASSERT_TRUE(call_with_caller_params(marie, pauline, marie_params));
pauline_call=linphone_core_get_current_call(pauline->lc);
marie_call=linphone_core_get_current_call(marie->lc);
......@@ -1589,7 +1620,7 @@ static void real_time_text_message_accented_chars(void) {
BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000));
BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message[i], unsigned long, "%lu");
}
linphone_chat_room_send_chat_message(pauline_chat_room, rtt_message);
BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1));
BC_ASSERT_EQUAL(strcmp(marie->stat.last_received_chat_message->message, "ãæçéîøùÿ"), 0, int, "%i");
......@@ -1618,7 +1649,7 @@ static void real_time_text_copy_paste(void) {
marie_params = linphone_core_create_call_params(marie->lc, NULL);
linphone_call_params_enable_realtime_text(marie_params,TRUE);
BC_ASSERT_TRUE(call_with_caller_params(marie, pauline, marie_params));
pauline_call = linphone_core_get_current_call(pauline->lc);
marie_call = linphone_core_get_current_call(marie->lc);
......@@ -1632,7 +1663,7 @@ static void real_time_text_copy_paste(void) {
int i;
LinphoneChatMessage* rtt_message = linphone_chat_room_create_message(pauline_chat_room,NULL);
LinphoneChatRoom *marie_chat_room = linphone_call_get_chat_room(marie_call);
for (i = 1; i <= strlen(message); i++) {
linphone_chat_message_put_char(rtt_message, message[i-1]);
if (i % 4 == 0) {
......@@ -1688,6 +1719,7 @@ test_t message_tests[] = {
{"IsComposing notification", is_composing_notification},
#ifdef HAVE_LIME