From 80e4341e05c2410d4b3e64ac8c2b997910ef7075 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 18 Jun 2012 16:56:48 +0200 Subject: [PATCH 01/47] add setHttpProxy wrapper --- coreapi/linphonecore_jni.cc | 27 ++++++++++++------- .../org/linphone/core/LinphoneCallLog.java | 2 -- .../org/linphone/core/LinphoneCore.java | 1 + 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 4393e3a3b..5d0b61b70 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1685,33 +1685,42 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setMaxCalls(JNIEnv *env, extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelAddServerAndMirror(JNIEnv *env,jobject thiz,jlong pCore, jstring jHost, jint port, jint mirror, jint delay) { -#ifdef TUNNEL_ENABLED - LinphoneTunnel *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return; + LinphoneTunnel *tunnel=((LinphoneCore *) pCore)->tunnel; + if (!tunnel) return; const char* cHost=env->GetStringUTFChars(jHost, NULL); linphone_tunnel_add_server_and_mirror(tunnel, cHost, port, mirror, delay); env->ReleaseStringUTFChars(jHost, cHost); -#endif } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelSetHttpProxy(JNIEnv *env,jobject thiz,jlong pCore, + jstring jHost, jint port, jstring username, jstring password) { + + LinphoneTunnel *tunnel=((LinphoneCore *) pCore)->tunnel; + if (!tunnel) return; + const char* cHost=(jHost!=NULL) ? env->GetStringUTFChars(jHost, NULL) : NULL; + const char* cUsername= (username!=NULL) ? env->GetStringUTFChars(username, NULL) : NULL; + const char* cPassword= (password!=NULL) ? env->GetStringUTFChars(password, NULL) : NULL; + linphone_tunnel_set_http_proxy(tunnel,cHost, port,cUsername,cPassword); + if (cHost) env->ReleaseStringUTFChars(jHost, cHost); + if (cUsername) env->ReleaseStringUTFChars(username, cUsername); + if (cPassword) env->ReleaseStringUTFChars(password, cPassword); +} + + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelAutoDetect(JNIEnv *env,jobject thiz,jlong pCore) { -#ifdef TUNNEL_ENABLED LinphoneTunnel *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return; linphone_tunnel_auto_detect(tunnel); -#endif + } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelCleanServers(JNIEnv *env,jobject thiz,jlong pCore) { -#ifdef TUNNEL_ENABLED LinphoneTunnel *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return; linphone_tunnel_clean_servers(tunnel); -#endif } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_tunnelEnable(JNIEnv *env,jobject thiz,jlong pCore, jboolean enable) { -#ifdef TUNNEL_ENABLED LinphoneTunnel *tunnel=((LinphoneCore *) pCore)->tunnel; if (!tunnel) return; linphone_tunnel_enable(tunnel, enable); -#endif } diff --git a/java/common/org/linphone/core/LinphoneCallLog.java b/java/common/org/linphone/core/LinphoneCallLog.java index 98bf40c50..40299e6d9 100644 --- a/java/common/org/linphone/core/LinphoneCallLog.java +++ b/java/common/org/linphone/core/LinphoneCallLog.java @@ -95,8 +95,6 @@ public interface LinphoneCallLog { */ public CallStatus getStatus(); - public long getNativePtr(); - /** * @return a human readble String with the start date/time of the call */ diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 86559f43f..f4bcc7ef8 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -743,6 +743,7 @@ public interface LinphoneCore { void tunnelEnable(boolean enable); void tunnelAutoDetect(); void tunnelCleanServers(); + void tunnelSetHttpProxy(String proxy_host, int port, String username, String password); /** * @param host tunnel server ip address * @param port tunnel server tls port, recommended value is 443 From 9e3835ff16a7f5fdaf02e7e767bb9de01850e487 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 21 Jun 2012 10:39:50 +0200 Subject: [PATCH 02/47] fix makefile (include linphone_tunnel.cc always) --- build/android/common.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/android/common.mk b/build/android/common.mk index 38b6c22cd..c85318ee4 100644 --- a/build/android/common.mk +++ b/build/android/common.mk @@ -43,7 +43,8 @@ LOCAL_SRC_FILES := \ callbacks.c \ linphonecall.c \ conference.c \ - ec-calibrator.c + ec-calibrator.c \ + linphone_tunnel.cc ifndef MY_LOG_DOMAIN MY_LOG_DOMAIN = \"Linphone\" @@ -91,7 +92,7 @@ LOCAL_STATIC_LIBRARIES := \ ifeq ($(BUILD_TUNNEL),1) LOCAL_CFLAGS +=-DTUNNEL_ENABLED LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../tunnel/include $(LOCAL_PATH)/../../tunnel/src -LOCAL_SRC_FILES += linphone_tunnel.cc TunnelManager.cc +LOCAL_SRC_FILES += TunnelManager.cc ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) LOCAL_SHARED_LIBRARIES += libtunnelclient else From f5555cc7ff8f7673899c129a2502436c1dbff6f6 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 21 Jun 2012 12:13:10 +0200 Subject: [PATCH 03/47] enhance documentation --- coreapi/linphonecall.c | 27 +++++++++------ coreapi/linphonecore.c | 21 ++++++++++-- coreapi/linphonecore.h | 76 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 98 insertions(+), 26 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index ac8460291..ec006dd58 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -68,14 +68,6 @@ LinphoneCore *linphone_call_get_core(const LinphoneCall *call){ return call->core; } -const LinphoneCallStats *linphone_call_get_audio_stats(const LinphoneCall *call) { - return &call->stats[LINPHONE_CALL_STATS_AUDIO]; -} - -const LinphoneCallStats *linphone_call_get_video_stats(const LinphoneCall *call) { - return &call->stats[LINPHONE_CALL_STATS_VIDEO]; -} - const char* linphone_call_get_authentication_token(LinphoneCall *call){ return call->auth_token; } @@ -1518,7 +1510,7 @@ bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call){ **/ /** - * Returns the measured sound volume played locally (received from remote) + * Returns the measured sound volume played locally (received from remote). * It is expressed in dbm0. **/ float linphone_call_get_play_volume(LinphoneCall *call){ @@ -1533,7 +1525,7 @@ float linphone_call_get_play_volume(LinphoneCall *call){ } /** - * Returns the measured sound volume recorded locally (sent to remote) + * Returns the measured sound volume recorded locally (sent to remote). * It is expressed in dbm0. **/ float linphone_call_get_record_volume(LinphoneCall *call){ @@ -1583,6 +1575,21 @@ float linphone_call_get_average_quality(LinphoneCall *call){ return -1; } +/** + * Access last known statistics for audio stream, for a given call. +**/ +const LinphoneCallStats *linphone_call_get_audio_stats(const LinphoneCall *call) { + return &call->stats[LINPHONE_CALL_STATS_AUDIO]; +} + +/** + * Access last known statistics for video stream, for a given call. +**/ +const LinphoneCallStats *linphone_call_get_video_stats(const LinphoneCall *call) { + return &call->stats[LINPHONE_CALL_STATS_VIDEO]; +} + + /** * @} **/ diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 41b9e2dda..d48c2fa28 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3473,7 +3473,6 @@ LinphoneFirewallPolicy linphone_core_get_firewall_policy(const LinphoneCore *lc) * @ingroup call_logs **/ const MSList * linphone_core_get_call_logs(LinphoneCore *lc){ - lc->missed_calls=0; return lc->call_logs; } @@ -3489,17 +3488,31 @@ void linphone_core_clear_call_logs(LinphoneCore *lc){ call_logs_write_to_config_file(lc); } +/** + * Returns number of missed calls. + * Once checked, this counter can be reset with linphone_core_reset_missed_calls_count(). +**/ int linphone_core_get_missed_calls_count(LinphoneCore *lc) { return lc->missed_calls; } +/** + * Resets the counter of missed calls. +**/ void linphone_core_reset_missed_calls_count(LinphoneCore *lc) { lc->missed_calls=0; } -void linphone_core_remove_call_log(LinphoneCore *lc, void *data) { - lc->call_logs = ms_list_remove(lc->call_logs, data); +/** + * Remove a specific call log from call history list. + * This function destroys the call log object. It must not be accessed anymore by the application after calling this function. + * @param lc the linphone core object + * @param a LinphoneCallLog object. +**/ +void linphone_core_remove_call_log(LinphoneCore *lc, LinphoneCallLog *cl){ + lc->call_logs = ms_list_remove(lc->call_logs, cl); call_logs_write_to_config_file(lc); + linphone_call_log_destroy(cl); } static void toggle_video_preview(LinphoneCore *lc, bool_t val){ @@ -3572,6 +3585,7 @@ bool_t linphone_core_video_enabled(LinphoneCore *lc){ * This policy defines whether: * - video shall be initiated by default for outgoing calls * - video shall be accepter by default for incoming calls + * @ingroup media_parameters **/ void linphone_core_set_video_policy(LinphoneCore *lc, const LinphoneVideoPolicy *policy){ lc->video_policy=*policy; @@ -3584,6 +3598,7 @@ void linphone_core_set_video_policy(LinphoneCore *lc, const LinphoneVideoPolicy /** * Get the default policy for video. * See linphone_core_set_video_policy() for more details. + * @ingroup media_parameters **/ const LinphoneVideoPolicy *linphone_core_get_video_policy(LinphoneCore *lc){ return &lc->video_policy; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index c9c6fc1a1..79d6204a0 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -157,12 +157,19 @@ typedef struct _LinphoneCallLog{ struct _LinphoneCore *lc; } LinphoneCallLog; + +/** + * Enum describing type of media encryption types. +**/ enum LinphoneMediaEncryption { LinphoneMediaEncryptionNone, LinphoneMediaEncryptionSRTP, LinphoneMediaEncryptionZRTP }; +/** + * Enum describing type of media encryption types. +**/ typedef enum LinphoneMediaEncryption LinphoneMediaEncryption; /*public: */ @@ -174,13 +181,13 @@ const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl); const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl); char * linphone_call_log_to_str(LinphoneCallLog *cl); +struct _LinphoneCallParams; /** * The LinphoneCallParams is an object containing various call related parameters. * It can be used to retrieve parameters from a currently running call or modify the call's characteristics * dynamically. **/ -struct _LinphoneCallParams; typedef struct _LinphoneCallParams LinphoneCallParams; const PayloadType* linphone_call_params_get_used_audio_codec(const LinphoneCallParams *cp); @@ -209,12 +216,17 @@ enum _LinphoneReason{ LinphoneReasonNotAnswered }; +/** + * Enum describing failure reasons. + * @ingroup initializing +**/ typedef enum _LinphoneReason LinphoneReason; const char *linphone_reason_to_string(LinphoneReason err); /** * Structure describing policy regarding video streams establishments. + * @ingroup media_parameters **/ struct _LinphoneVideoPolicy{ bool_t automatically_initiate; /** Date: Tue, 26 Jun 2012 10:43:54 +0200 Subject: [PATCH 04/47] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 415269b15..715331b75 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 415269b15fb64aec82328332602591abac2d782d +Subproject commit 715331b7581aea11aac476cfc549d53640fdc703 From d93727e87c3d872951a74de1681b7475bcfb2614 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 26 Jun 2012 11:03:17 +0200 Subject: [PATCH 05/47] Fix compilation issue --- coreapi/linphonecore_jni.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 5d0b61b70..79c7facf0 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -657,7 +657,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_resetMissedCallsCount(JN extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeCallLog(JNIEnv* env ,jobject thiz ,jlong lc, jlong log) { - linphone_core_remove_call_log((LinphoneCore*)lc, (void*) log); + linphone_core_remove_call_log((LinphoneCore*)lc, (LinphoneCallLog*) log); } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearCallLogs(JNIEnv* env From f5169e0066c86530d23fedc11f8dd94ef20d9c7f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 26 Jun 2012 13:11:07 +0200 Subject: [PATCH 06/47] ignore tunnel transmissions errors (usually when not ready) for SIP --- coreapi/TunnelManager.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/coreapi/TunnelManager.cc b/coreapi/TunnelManager.cc index 44d12251c..e3c7e6595 100644 --- a/coreapi/TunnelManager.cc +++ b/coreapi/TunnelManager.cc @@ -31,15 +31,16 @@ Mutex TunnelManager::sMutex; int TunnelManager::eXosipSendto(int fd,const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen,void* userdata){ TunnelManager* lTunnelMgr=(TunnelManager*)userdata; - int err; + sMutex.lock(); if (lTunnelMgr->mSipSocket==NULL){ sMutex.unlock(); - return len;//let ignore the error + return len; } - err=lTunnelMgr->mSipSocket->sendto(buf,len,to,tolen); + lTunnelMgr->mSipSocket->sendto(buf,len,to,tolen); sMutex.unlock(); - return err; + //ignore the error in all cases, retransmissions might be successful. + return len; } int TunnelManager::eXosipRecvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen,void* userdata){ From ace189f5f2e6364eb1e85a2244d00131f9119cb5 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 26 Jun 2012 23:12:38 +0200 Subject: [PATCH 07/47] change the way call log dates are stored in linphonerc --- coreapi/linphonecore.c | 51 +++++++++++++++++++++++++++++------------- coreapi/linphonecore.h | 1 + coreapi/lpconfig.c | 19 ++++++++++++++++ coreapi/lpconfig.h | 17 ++++++++++++++ 4 files changed, 73 insertions(+), 15 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index d48c2fa28..174f6c9c6 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define _GNU_SOURCE + #include "linphonecore.h" #include "sipsetup.h" #include "lpconfig.h" @@ -85,23 +87,24 @@ static size_t my_strftime(char *s, size_t max, const char *fmt, const struct t #endif /*_WIN32_WCE*/ } -static void set_call_log_date(LinphoneCallLog *cl, const struct tm *loctime){ - my_strftime(cl->start_date,sizeof(cl->start_date),"%c",loctime); +static void set_call_log_date(LinphoneCallLog *cl, time_t start_time){ + struct tm loctime; +#ifdef WIN32 +#if !defined(_WIN32_WCE) + loctime=*localtime(&start_time); + /*FIXME*/ +#endif /*_WIN32_WCE*/ +#else + localtime_r(&start_time,&loctime); +#endif + my_strftime(cl->start_date,sizeof(cl->start_date),"%c",&loctime); } LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, LinphoneAddress *from, LinphoneAddress *to){ LinphoneCallLog *cl=ms_new0(LinphoneCallLog,1); - struct tm loctime; cl->dir=call->dir; -#ifdef WIN32 -#if !defined(_WIN32_WCE) - loctime=*localtime(&call->start_time); - /*FIXME*/ -#endif /*_WIN32_WCE*/ -#else - localtime_r(&call->start_time,&loctime); -#endif - set_call_log_date(cl,&loctime); + cl->start_date_time=call->start_time; + set_call_log_date(cl,cl->start_date_time); cl->from=from; cl->to=to; cl->status=LinphoneCallAborted; /*default status*/ @@ -120,6 +123,7 @@ void call_logs_write_to_config_file(LinphoneCore *lc){ for(i=0,elem=lc->call_logs;elem!=NULL;elem=elem->next,++i){ LinphoneCallLog *cl=(LinphoneCallLog*)elem->data; snprintf(logsection,sizeof(logsection),"call_log_%i",i); + lp_config_clean_section(cfg,logsection); lp_config_set_int(cfg,logsection,"dir",cl->dir); lp_config_set_int(cfg,logsection,"status",cl->status); tmp=linphone_address_as_string(cl->from); @@ -128,7 +132,7 @@ void call_logs_write_to_config_file(LinphoneCore *lc){ tmp=linphone_address_as_string(cl->to); lp_config_set_string(cfg,logsection,"to",tmp); ms_free(tmp); - lp_config_set_string(cfg,logsection,"start_date",cl->start_date); + lp_config_set_int64(cfg,logsection,"start_date_time",(int64_t)cl->start_date_time); lp_config_set_int(cfg,logsection,"duration",cl->duration); if (cl->refkey) lp_config_set_string(cfg,logsection,"refkey",cl->refkey); lp_config_set_float(cfg,logsection,"quality",cl->quality); @@ -140,10 +144,17 @@ void call_logs_write_to_config_file(LinphoneCore *lc){ } } +static time_t string_to_time(const char *date){ + struct tm tmtime={0}; + strptime(date,"%c",&tmtime); + return mktime(&tmtime); +} + static void call_logs_read_from_config_file(LinphoneCore *lc){ char logsection[32]; int i; const char *tmp; + uint64_t sec; LpConfig *cfg=lc->config; for(i=0;;++i){ snprintf(logsection,sizeof(logsection),"call_log_%i",i); @@ -155,8 +166,18 @@ static void call_logs_read_from_config_file(LinphoneCore *lc){ if (tmp) cl->from=linphone_address_new(tmp); tmp=lp_config_get_string(cfg,logsection,"to",NULL); if (tmp) cl->to=linphone_address_new(tmp); - tmp=lp_config_get_string(cfg,logsection,"start_date",NULL); - if (tmp) strncpy(cl->start_date,tmp,sizeof(cl->start_date)); + sec=lp_config_get_int64(cfg,logsection,"start_date_time",0); + if (sec) { + /*new call log format with date expressed in seconds */ + cl->start_date_time=(time_t)sec; + set_call_log_date(cl,cl->start_date_time); + }else{ + tmp=lp_config_get_string(cfg,logsection,"start_date",NULL); + if (tmp) { + strncpy(cl->start_date,tmp,sizeof(cl->start_date)); + cl->start_date_time=string_to_time(cl->start_date); + } + } cl->duration=lp_config_get_int(cfg,logsection,"duration",0); tmp=lp_config_get_string(cfg,logsection,"refkey",NULL); if (tmp) cl->refkey=ms_strdup(tmp); diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 79d6204a0..81044fff5 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -155,6 +155,7 @@ typedef struct _LinphoneCallLog{ float quality; int video_enabled; struct _LinphoneCore *lc; + time_t start_date_time; /**Start date of the call in seconds as expressed in a time_t */ } LinphoneCallLog; diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index d12166ec4..4cd7202cc 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -277,6 +277,18 @@ int lp_config_get_int(LpConfig *lpconfig,const char *section, const char *key, i else return default_value; } +int64_t lp_config_get_int64(LpConfig *lpconfig,const char *section, const char *key, int64_t default_value){ + const char *str=lp_config_get_string(lpconfig,section,key,NULL); + if (str!=NULL) { +#ifdef WIN32 + return (int64_t)_atoi64(str); +#else + return atoll(str); +#endif + } + else return default_value; +} + float lp_config_get_float(LpConfig *lpconfig,const char *section, const char *key, float default_value){ const char *str=lp_config_get_string(lpconfig,section,key,NULL); float ret=default_value; @@ -312,6 +324,13 @@ void lp_config_set_int(LpConfig *lpconfig,const char *section, const char *key, lp_config_set_string(lpconfig,section,key,tmp); } +void lp_config_set_int64(LpConfig *lpconfig,const char *section, const char *key, int64_t value){ + char tmp[30]; + snprintf(tmp,sizeof(tmp),"%lli",(long long)value); + lp_config_set_string(lpconfig,section,key,tmp); +} + + void lp_config_set_float(LpConfig *lpconfig,const char *section, const char *key, float value){ char tmp[30]; snprintf(tmp,sizeof(tmp),"%f",value); diff --git a/coreapi/lpconfig.h b/coreapi/lpconfig.h index ed7a66b1e..c1821d2aa 100644 --- a/coreapi/lpconfig.h +++ b/coreapi/lpconfig.h @@ -66,6 +66,16 @@ int lp_config_read_file(LpConfig *lpconfig, const char *filename); * The default integer value is returned if the config item isn't found. **/ int lp_config_get_int(LpConfig *lpconfig,const char *section, const char *key, int default_value); + +/** + * Retrieves a configuration item as a 64 bit integer, given its section, key, and default value. + * + * @ingroup misc + * The default integer value is returned if the config item isn't found. +**/ +int64_t lp_config_get_int64(LpConfig *lpconfig,const char *section, const char *key, int64_t default_value); + + int lp_config_read_file(LpConfig *lpconfig, const char *filename); /** * Retrieves a configuration item as a float, given its section, key, and default value. @@ -86,6 +96,13 @@ void lp_config_set_string(LpConfig *lpconfig,const char *section, const char *ke * @ingroup misc **/ void lp_config_set_int(LpConfig *lpconfig,const char *section, const char *key, int value); +/** + * Sets a 64 bits integer config item + * + * @ingroup misc +**/ +void lp_config_set_int64(LpConfig *lpconfig,const char *section, const char *key, int64_t value); + /** * Sets a float config item * From fb9d2bebd321c5fde40a0d4604bbaea1a6403978 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 27 Jun 2012 10:16:00 +0200 Subject: [PATCH 08/47] takeSnapshot and zoomVideo methods exported throught JNI --- coreapi/linphonecore_jni.cc | 13 +++++++++++++ java/common/org/linphone/core/LinphoneCall.java | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 79c7facf0..3d59daffd 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1199,6 +1199,19 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCallLog( JNIEnv* en return (jlong)linphone_call_get_call_log((LinphoneCall*)ptr); } +extern "C" void Java_org_linphone_core_LinphoneCallImpl_takeSnapshot( JNIEnv* env + ,jobject thiz + ,jlong ptr, jstring path) { + const char* filePath = path != NULL ? env->GetStringUTFChars(path, NULL) : NULL; + linphone_call_take_video_snapshot((LinphoneCall*)ptr, filePath); +} + +extern "C" void Java_org_linphone_core_LinphoneCallImpl_zoomVideo( JNIEnv* env + ,jobject thiz + ,jlong ptr, jfloat zoomFactor, jfloat cx, jfloat cy) { + linphone_call_zoom_video((LinphoneCall*)ptr, zoomFactor, cx, cy); +} + extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isIncoming( JNIEnv* env ,jobject thiz ,jlong ptr) { diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index 4d8e23d80..c42ebb740 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -244,4 +244,14 @@ public interface LinphoneCall { boolean isInConference(); float getPlayVolume(); + + /** + * Take a photo of currently received video and write it into a jpeg file. + */ + void takeSnapshot(String path); + + /** + * Scale the video by factor, and center it using cx,cy point + */ + void zoomVideo(float factor, float cx, float cy); } From e2510af6ae112852306d58f43967b172faa5c3d4 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 27 Jun 2012 10:58:35 +0200 Subject: [PATCH 09/47] Fix zoom JNI export --- coreapi/linphonecore_jni.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 3d59daffd..1c320ce7b 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1209,7 +1209,7 @@ extern "C" void Java_org_linphone_core_LinphoneCallImpl_takeSnapshot( JNIEnv* e extern "C" void Java_org_linphone_core_LinphoneCallImpl_zoomVideo( JNIEnv* env ,jobject thiz ,jlong ptr, jfloat zoomFactor, jfloat cx, jfloat cy) { - linphone_call_zoom_video((LinphoneCall*)ptr, zoomFactor, cx, cy); + linphone_call_zoom_video((LinphoneCall*)ptr, zoomFactor, &cx, &cy); } extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isIncoming( JNIEnv* env From 31e9e71fc28edb5292020773330298b3eccab4ae Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 27 Jun 2012 12:26:54 +0200 Subject: [PATCH 10/47] fix missing strptime for windows, make call logs full backward compatible --- coreapi/linphonecore.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 174f6c9c6..97296ea6e 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -132,11 +132,13 @@ void call_logs_write_to_config_file(LinphoneCore *lc){ tmp=linphone_address_as_string(cl->to); lp_config_set_string(cfg,logsection,"to",tmp); ms_free(tmp); - lp_config_set_int64(cfg,logsection,"start_date_time",(int64_t)cl->start_date_time); + if (cl->start_date_time) + lp_config_set_int64(cfg,logsection,"start_date_time",(int64_t)cl->start_date_time); + else lp_config_set_string(cfg,logsection,"start_date",cl->start_date); lp_config_set_int(cfg,logsection,"duration",cl->duration); if (cl->refkey) lp_config_set_string(cfg,logsection,"refkey",cl->refkey); lp_config_set_float(cfg,logsection,"quality",cl->quality); - lp_config_set_int(cfg,logsection,"video_enabled", cl->video_enabled); + lp_config_set_int(cfg,logsection,"video_enabled", cl->video_enabled); } for(;imax_call_logs;++i){ snprintf(logsection,sizeof(logsection),"call_log_%i",i); @@ -145,9 +147,13 @@ void call_logs_write_to_config_file(LinphoneCore *lc){ } static time_t string_to_time(const char *date){ +#ifndef WIN32 struct tm tmtime={0}; strptime(date,"%c",&tmtime); return mktime(&tmtime); +#else + return 0; +#endif } static void call_logs_read_from_config_file(LinphoneCore *lc){ @@ -182,7 +188,7 @@ static void call_logs_read_from_config_file(LinphoneCore *lc){ tmp=lp_config_get_string(cfg,logsection,"refkey",NULL); if (tmp) cl->refkey=ms_strdup(tmp); cl->quality=lp_config_get_float(cfg,logsection,"quality",-1); - cl->video_enabled=lp_config_get_int(cfg,logsection,"video_enabled",0); + cl->video_enabled=lp_config_get_int(cfg,logsection,"video_enabled",0); lc->call_logs=ms_list_append(lc->call_logs,cl); }else break; } From fc2940d526e93ea733fcebf4baa28631aa215564 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 27 Jun 2012 14:45:26 +0200 Subject: [PATCH 11/47] ms2 updated --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 715331b75..84b9ef050 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 715331b7581aea11aac476cfc549d53640fdc703 +Subproject commit 84b9ef050c6abd26446901c2532573f2589a435b From 8b74551ac814e7382c2ae9d15b8388e2b62b18bf Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 27 Jun 2012 16:09:03 +0200 Subject: [PATCH 12/47] improve display of call logs for i18n dates. --- gtk/calllogs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gtk/calllogs.c b/gtk/calllogs.c index bd5969ec8..63c00b9a5 100644 --- a/gtk/calllogs.c +++ b/gtk/calllogs.c @@ -58,6 +58,14 @@ void linphone_gtk_call_log_update(GtkWidget *w){ gchar *logtxt, *minutes, *seconds; gchar quality[20]; const char *status=NULL; + gchar *start_date=NULL; + + if (cl->start_date_time){ + GDateTime *dt=g_date_time_new_from_unix_local(cl->start_date_time); + start_date=g_date_time_format(dt,"%c"); + g_date_time_unref(dt); + } + display=linphone_address_get_display_name (la); if (display==NULL){ @@ -91,14 +99,15 @@ void linphone_gtk_call_log_update(GtkWidget *w){ _("%s\t%s\t" "Quality: %s\n%s\t%s %s\t"), display, addr, cl->quality!=-1 ? quality : _("n/a"), - cl->start_date, minutes, seconds); + start_date ? start_date : cl->start_date, minutes, seconds); else logtxt=g_markup_printf_escaped( _("%s\t%s\t" "\n%s\t%s"), display, addr, - cl->start_date, status); + start_date ? start_date : cl->start_date, status); g_free(minutes); g_free(seconds); + if (start_date) g_free(start_date); gtk_list_store_append (store,&iter); gtk_list_store_set (store,&iter, 0, cl->dir==LinphoneCallOutgoing ? GTK_STOCK_GO_UP : GTK_STOCK_GO_DOWN, From 20c23f8b8e267f5c82d7cd8595300f6875614676 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 28 Jun 2012 09:59:53 +0200 Subject: [PATCH 13/47] fix for old glib version --- gtk/calllogs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/calllogs.c b/gtk/calllogs.c index 63c00b9a5..9494dbfa2 100644 --- a/gtk/calllogs.c +++ b/gtk/calllogs.c @@ -60,12 +60,13 @@ void linphone_gtk_call_log_update(GtkWidget *w){ const char *status=NULL; gchar *start_date=NULL; +#if GLIB_CHECK_VERSION(2,26,0) if (cl->start_date_time){ GDateTime *dt=g_date_time_new_from_unix_local(cl->start_date_time); start_date=g_date_time_format(dt,"%c"); g_date_time_unref(dt); } - +#endif display=linphone_address_get_display_name (la); if (display==NULL){ From cf9332d400cf4ac1b50e679bdd27ab851b5ceea7 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 28 Jun 2012 13:17:55 +0200 Subject: [PATCH 14/47] add notifyReceived + refreshRegisters to java api --- java/common/org/linphone/core/LinphoneCore.java | 8 ++++++++ java/common/org/linphone/core/LinphoneCoreListener.java | 9 +++++++++ mediastreamer2 | 2 +- oRTP | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index f4bcc7ef8..6f0ce2c65 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -180,6 +180,9 @@ public interface LinphoneCore { this.tcp = t.tcp; this.tls = t.tls; } + public String toString() { + return "udp["+udp+"] tcp["+tcp+"] tls["+tls+"]"; + } } /** * Media (RTP) encryption enum-like. @@ -776,4 +779,9 @@ public interface LinphoneCore { * Set missed calls count to zero */ public void resetMissedCallsCount(); + /** + * re-initiates registration if network is up. + */ + public void refreshRegisters(); + } diff --git a/java/common/org/linphone/core/LinphoneCoreListener.java b/java/common/org/linphone/core/LinphoneCoreListener.java index cfe43895e..400e942c3 100644 --- a/java/common/org/linphone/core/LinphoneCoreListener.java +++ b/java/common/org/linphone/core/LinphoneCoreListener.java @@ -103,5 +103,14 @@ public interface LinphoneCoreListener { * @param data */ void ecCalibrationStatus(LinphoneCore lc,LinphoneCore.EcCalibratorStatus status, int delay_ms, Object data); + /** + * Report Notified message received for this identity. + * @param lc LinphoneCore + * @param call LinphoneCall in case the notify is part of a dialog, may be null + * @param from LinphoneAddress the message comes from + * @param event String the raw body of the notify event. + * + */ + void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event); } diff --git a/mediastreamer2 b/mediastreamer2 index 84b9ef050..75eb1fcf8 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 84b9ef050c6abd26446901c2532573f2589a435b +Subproject commit 75eb1fcf8d6097e51bcb507be339dd397c6b4dd5 diff --git a/oRTP b/oRTP index 2590e21d8..41d13b7e4 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 2590e21d864b43d6ac3a2ece0cf3b4d0e208e866 +Subproject commit 41d13b7e491c7fc418987b63ff6ef80c7e8895a4 From 9f5ad3739e58f8296a8e6ad6667ba865304d5d33 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 28 Jun 2012 13:26:35 +0200 Subject: [PATCH 15/47] Revert "add notifyReceived + refreshRegisters to java api" This reverts commit cf9332d400cf4ac1b50e679bdd27ab851b5ceea7. --- java/common/org/linphone/core/LinphoneCore.java | 8 -------- java/common/org/linphone/core/LinphoneCoreListener.java | 9 --------- mediastreamer2 | 2 +- oRTP | 2 +- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 6f0ce2c65..f4bcc7ef8 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -180,9 +180,6 @@ public interface LinphoneCore { this.tcp = t.tcp; this.tls = t.tls; } - public String toString() { - return "udp["+udp+"] tcp["+tcp+"] tls["+tls+"]"; - } } /** * Media (RTP) encryption enum-like. @@ -779,9 +776,4 @@ public interface LinphoneCore { * Set missed calls count to zero */ public void resetMissedCallsCount(); - /** - * re-initiates registration if network is up. - */ - public void refreshRegisters(); - } diff --git a/java/common/org/linphone/core/LinphoneCoreListener.java b/java/common/org/linphone/core/LinphoneCoreListener.java index 400e942c3..cfe43895e 100644 --- a/java/common/org/linphone/core/LinphoneCoreListener.java +++ b/java/common/org/linphone/core/LinphoneCoreListener.java @@ -103,14 +103,5 @@ public interface LinphoneCoreListener { * @param data */ void ecCalibrationStatus(LinphoneCore lc,LinphoneCore.EcCalibratorStatus status, int delay_ms, Object data); - /** - * Report Notified message received for this identity. - * @param lc LinphoneCore - * @param call LinphoneCall in case the notify is part of a dialog, may be null - * @param from LinphoneAddress the message comes from - * @param event String the raw body of the notify event. - * - */ - void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event); } diff --git a/mediastreamer2 b/mediastreamer2 index 75eb1fcf8..84b9ef050 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 75eb1fcf8d6097e51bcb507be339dd397c6b4dd5 +Subproject commit 84b9ef050c6abd26446901c2532573f2589a435b diff --git a/oRTP b/oRTP index 41d13b7e4..2590e21d8 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 41d13b7e491c7fc418987b63ff6ef80c7e8895a4 +Subproject commit 2590e21d864b43d6ac3a2ece0cf3b4d0e208e866 From 7d105b10d934e194796bdaaabdfd9f185261d309 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 28 Jun 2012 13:31:51 +0200 Subject: [PATCH 16/47] add notifyReceived + refreshRegisters to java api 2 --- java/common/org/linphone/core/LinphoneCore.java | 8 ++++++++ java/common/org/linphone/core/LinphoneCoreListener.java | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index f4bcc7ef8..6f0ce2c65 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -180,6 +180,9 @@ public interface LinphoneCore { this.tcp = t.tcp; this.tls = t.tls; } + public String toString() { + return "udp["+udp+"] tcp["+tcp+"] tls["+tls+"]"; + } } /** * Media (RTP) encryption enum-like. @@ -776,4 +779,9 @@ public interface LinphoneCore { * Set missed calls count to zero */ public void resetMissedCallsCount(); + /** + * re-initiates registration if network is up. + */ + public void refreshRegisters(); + } diff --git a/java/common/org/linphone/core/LinphoneCoreListener.java b/java/common/org/linphone/core/LinphoneCoreListener.java index cfe43895e..400e942c3 100644 --- a/java/common/org/linphone/core/LinphoneCoreListener.java +++ b/java/common/org/linphone/core/LinphoneCoreListener.java @@ -103,5 +103,14 @@ public interface LinphoneCoreListener { * @param data */ void ecCalibrationStatus(LinphoneCore lc,LinphoneCore.EcCalibratorStatus status, int delay_ms, Object data); + /** + * Report Notified message received for this identity. + * @param lc LinphoneCore + * @param call LinphoneCall in case the notify is part of a dialog, may be null + * @param from LinphoneAddress the message comes from + * @param event String the raw body of the notify event. + * + */ + void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event); } From 693ee8d265ab255785d7756d4fd855ec8f573451 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 28 Jun 2012 14:38:16 +0200 Subject: [PATCH 17/47] Fix java tutorials --- .../java/org/linphone/core/tutorials/TutorialBuddyStatus.java | 1 + .../help/java/org/linphone/core/tutorials/TutorialChatRoom.java | 1 + .../java/org/linphone/core/tutorials/TutorialHelloWorld.java | 2 +- .../java/org/linphone/core/tutorials/TutorialRegistration.java | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/coreapi/help/java/org/linphone/core/tutorials/TutorialBuddyStatus.java b/coreapi/help/java/org/linphone/core/tutorials/TutorialBuddyStatus.java index e7db170b8..58a75e56b 100644 --- a/coreapi/help/java/org/linphone/core/tutorials/TutorialBuddyStatus.java +++ b/coreapi/help/java/org/linphone/core/tutorials/TutorialBuddyStatus.java @@ -98,6 +98,7 @@ public class TutorialBuddyStatus implements LinphoneCoreListener { public void callState(LinphoneCore lc, LinphoneCall call, State cstate, String msg) {} public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {} public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {} + public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){} public static void main(String[] args) { diff --git a/coreapi/help/java/org/linphone/core/tutorials/TutorialChatRoom.java b/coreapi/help/java/org/linphone/core/tutorials/TutorialChatRoom.java index 5837876cb..c81823e8a 100644 --- a/coreapi/help/java/org/linphone/core/tutorials/TutorialChatRoom.java +++ b/coreapi/help/java/org/linphone/core/tutorials/TutorialChatRoom.java @@ -76,6 +76,7 @@ public class TutorialChatRoom implements LinphoneCoreListener { public void callState(LinphoneCore lc, LinphoneCall call, State cstate, String msg){} public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {} public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {} + public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){} public void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from, String message) { write("Message ["+message+"] received from ["+from.asString()+"]"); diff --git a/coreapi/help/java/org/linphone/core/tutorials/TutorialHelloWorld.java b/coreapi/help/java/org/linphone/core/tutorials/TutorialHelloWorld.java index 30510fd84..6daa65711 100644 --- a/coreapi/help/java/org/linphone/core/tutorials/TutorialHelloWorld.java +++ b/coreapi/help/java/org/linphone/core/tutorials/TutorialHelloWorld.java @@ -70,7 +70,7 @@ public class TutorialHelloWorld implements LinphoneCoreListener { public void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from, String message) {} public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {} public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {} - + public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){} /* * Call state notification listener */ diff --git a/coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java b/coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java index 8af45162c..674044471 100644 --- a/coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java +++ b/coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java @@ -81,6 +81,7 @@ public class TutorialRegistration implements LinphoneCoreListener { public void callState(LinphoneCore lc, LinphoneCall call, State cstate, String msg) {} public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {} public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {} + public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){} public static void main(String[] args) { // Check tutorial was called with the right number of arguments From 9f02a12f4641989a225ee77bf6f403cd1c57d9e6 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 28 Jun 2012 14:54:54 +0200 Subject: [PATCH 18/47] Added missing JNI method refreshRegisters --- coreapi/linphonecore_jni.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 1c320ce7b..c6e774d23 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -492,6 +492,10 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_clearAuthInfos(JNIEnv* linphone_core_clear_all_auth_info((LinphoneCore*)lc); } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_refreshRegisters(JNIEnv* env, jobject thiz,jlong lc) { + linphone_core_refresh_registers((LinphoneCore*)lc); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addAuthInfo( JNIEnv* env ,jobject thiz ,jlong lc From 3860e1c493cba9a8a546a866499469eb3b137ebc Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 29 Jun 2012 11:49:32 +0200 Subject: [PATCH 19/47] attempt workaround for GtkEntry bug under windows and chinese language. --- gtk/main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gtk/main.c b/gtk/main.c index 2a6c307b6..fa04a24e0 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -77,6 +77,7 @@ static gboolean iconified=FALSE; static gchar *workingdir=NULL; static char *progpath=NULL; gchar *linphone_logfile=NULL; +static gboolean workaround_gtk_entry_chinese_bug=FALSE; static GOptionEntry linphone_options[]={ { @@ -347,6 +348,11 @@ GtkWidget *linphone_gtk_create_widget(const char *filename, const char *widget_n return w; } +static void entry_unmapped(GtkWidget *entry){ + g_message("Entry is unmapped, calling unrealize to workaround chinese bug."); + gtk_widget_unrealize(entry); +} + GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){ GtkBuilder *builder=(GtkBuilder*)g_object_get_data(G_OBJECT(window),"builder"); GObject *w; @@ -358,6 +364,15 @@ GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){ if (w==NULL){ g_error("No widget named %s found in xml interface.",name); } + if (workaround_gtk_entry_chinese_bug){ + if (strcmp(G_OBJECT_TYPE_NAME(w),"GtkEntry")==0){ + if (g_object_get_data(G_OBJECT(w),"entry_bug_workaround")==NULL){ + g_object_set_data(G_OBJECT(w),"entry_bug_workaround",GINT_TO_POINTER(1)); + g_message("%s is a GtkEntry",name); + g_signal_connect(G_OBJECT(w),"unmap",(GCallback)entry_unmapped,NULL); + } + } + } return GTK_WIDGET(w); } @@ -1765,6 +1780,9 @@ int main(int argc, char *argv[]){ char tmp[128]; snprintf(tmp,sizeof(tmp),"LANG=%s",lang); _putenv(tmp); + if (strncmp(lang,"zh",2)==0){ + workaround_gtk_entry_chinese_bug=TRUE; + } #else setenv("LANG",lang,1); #endif From 179727a5f65c4f9043b8534e59be8ecf508073ad Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Fri, 29 Jun 2012 18:30:02 +0200 Subject: [PATCH 20/47] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 84b9ef050..e7b1615cb 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 84b9ef050c6abd26446901c2532573f2589a435b +Subproject commit e7b1615cb545ad7a9cc00bdb31d703a1be64087f From 9496394c88dbdf6e6dd120b5657a2846b603d612 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 4 Jul 2012 11:40:17 +0200 Subject: [PATCH 21/47] update ms2: use VOICE_COMMUNICATION source for android recorder if sdk version > 10 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index e7b1615cb..3ad17dab4 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit e7b1615cb545ad7a9cc00bdb31d703a1be64087f +Subproject commit 3ad17dab4138c1a4fa1536388caced23a5610e6a From 57d9f33e253493cdd1b58dcb0c825181bd23f42b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 10 Jul 2012 10:13:31 +0200 Subject: [PATCH 22/47] fix double g_thread initialization in wizard --- gtk/setupwizard.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gtk/setupwizard.c b/gtk/setupwizard.c index ae1bcfa6a..39673da99 100644 --- a/gtk/setupwizard.c +++ b/gtk/setupwizard.c @@ -538,11 +538,6 @@ GtkWidget * linphone_gtk_create_assistant(void){ ok = create_pixbuf(linphone_gtk_get_ui_config("ok","ok.png")); notok = create_pixbuf(linphone_gtk_get_ui_config("notok","notok.png")); -#if !GLIB_CHECK_VERSION(2, 31, 0) - g_thread_init (NULL); -#endif - gdk_threads_init (); - GtkWidget *p1=create_intro(); GtkWidget *p2=create_setup_signin_choice(); GtkWidget *p31=create_account_informations_page(); @@ -605,3 +600,4 @@ GtkWidget * linphone_gtk_create_assistant(void){ return w; } + From ae4b03f1dfd6ff4690e5b170536db2d9525b3c05 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 16 Jul 2012 11:17:43 +0200 Subject: [PATCH 23/47] Increase incoming timeout to 30s. --- coreapi/linphonecore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 97296ea6e..9c69fc88a 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -570,7 +570,7 @@ static void sip_config_read(LinphoneCore *lc) linphone_core_set_guess_hostname(lc,tmp); - tmp=lp_config_get_int(lc->config,"sip","inc_timeout",15); + tmp=lp_config_get_int(lc->config,"sip","inc_timeout",30); linphone_core_set_inc_timeout(lc,tmp); /* get proxies config */ @@ -1855,6 +1855,7 @@ void linphone_core_iterate(LinphoneCore *lc){ elapsed=curtime-call->start_time; ms_message("incoming call ringing for %i seconds",elapsed); if (elapsed>lc->sip_conf.inc_timeout){ + ms_message("incoming call timeout (%i)",lc->sip_conf.inc_timeout); call->log->status=LinphoneCallMissed; call->reason=LinphoneReasonNotAnswered; linphone_core_terminate_call(lc,call); From 333520bf850a6484390e3596da7fc73d8c3f67f5 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 16 Jul 2012 11:19:06 +0200 Subject: [PATCH 24/47] Fix _sdp_message_get_mline_dir on recvonly attribute. --- coreapi/sal_eXosip2_sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/sal_eXosip2_sdp.c b/coreapi/sal_eXosip2_sdp.c index f67fb9cfd..32f031864 100644 --- a/coreapi/sal_eXosip2_sdp.c +++ b/coreapi/sal_eXosip2_sdp.c @@ -116,7 +116,7 @@ static int _sdp_message_get_mline_dir(sdp_message_t *sdp, int mline){ }else if (keywordcmp("sendonly",attr->a_att_field)==0){ return SalStreamSendOnly; }else if (keywordcmp("recvonly",attr->a_att_field)==0){ - return SalStreamSendOnly; + return SalStreamRecvOnly; }else if (keywordcmp("inactive",attr->a_att_field)==0){ return SalStreamInactive; } From 5273d7c70f80927554e446e2ecf9f938641efa47 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 17 Jul 2012 18:58:34 +0200 Subject: [PATCH 25/47] better eclispe discovery --- .cproject | 362 ++++++++++++++++++++++------------------------------ .project | 2 +- Makefile.am | 5 +- 3 files changed, 159 insertions(+), 210 deletions(-) diff --git a/.cproject b/.cproject index 3ab1fad71..63cf57632 100644 --- a/.cproject +++ b/.cproject @@ -22,7 +22,7 @@ - + @@ -35,221 +35,167 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - all - true - true - true - - - make - CFLAGS="-g" - install - true - true - true - - - make - CFLAGS="-g" - install - true - true - true - - - make - all - true - true - true - - - make - all - true - true - true - - - + + + + + + + make + all + true + true + true + + + make + CFLAGS="-g" + install + true + true + true + + + make + CFLAGS="-g" + install + true + true + true + + + make + all + true + true + true + + + make + all + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project index 2fbbd2688..dcc5fd75c 100644 --- a/.project +++ b/.project @@ -23,7 +23,7 @@ org.eclipse.cdt.make.core.buildArguments - CFLAGS="-g -Werror -Wall" + CFLAGS="-g -Werror -Wall" CXXFLAGS="-g" org.eclipse.cdt.make.core.buildCommand diff --git a/Makefile.am b/Makefile.am index 5be271da4..6faebc4fc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -229,4 +229,7 @@ clean-local: rm -rf $(BUNDLEDIR) discovery: touch specs.cpp - $(CC) $(CFLAGS) $(MEDIASTREAMER2_CFLAGS) $(ORTP_CFLAGS) -E -P -v -dD specs.cpp + $(CC) --include $(top_builddir)/config.h \ + --include $(top_builddir)/mediastreamer2/mediastreamer-config.h \ + --include $(top_builddir)/oRTP/ortp-config.h \ + $(TUNNEL_CFLAGS) $(CFLAGS) $(MEDIASTREAMER2_CFLAGS) $(ORTP_CFLAGS) -E -P -v -dD specs.cpp From c4bf7958ab6272155547c1f12e06189e1f84275c Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 19 Jul 2012 14:46:00 +0200 Subject: [PATCH 26/47] make sure only one transport is configured --- coreapi/linphonecore.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 9c69fc88a..40b2a647d 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -532,10 +532,13 @@ static void sip_config_read(LinphoneCore *lc) if (tr.udp_port>0 && random_port){ tr.udp_port=random_port; + tr.tls_port=tr.tcp_port=0; /*make sure only one transport is active at a time*/ }else if (tr.tcp_port>0 && random_port){ tr.tcp_port=random_port; + tr.tls_port=tr.udp_port=0; /*make sure only one transport is active at a time*/ }else if (tr.tls_port>0 && random_port){ tr.tls_port=random_port; + tr.udp_port=tr.tcp_port=0; /*make sure only one transport is active at a time*/ } #ifdef __linux From 0121763b41b4ee42b0d5722908af7edf8b04cb7e Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 24 Jul 2012 11:37:48 +0200 Subject: [PATCH 27/47] ms2 update --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 3ad17dab4..cb0ef89e9 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3ad17dab4138c1a4fa1536388caced23a5610e6a +Subproject commit cb0ef89e9fd1ef936fd4168fd89f41616caed382 From 46a38951859ad9401d652ca8793b4b12dd4cf6e3 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 25 Jul 2012 16:21:35 +0200 Subject: [PATCH 28/47] Fix SIGSEV when pausing call --- coreapi/linphonecore_jni.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index c6e774d23..e17cd929a 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -241,7 +241,7 @@ public: return; } LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc); - env->CallVoidMethod(lcData->listener,lcData->displayStatusId,lcData->core,env->NewStringUTF(message)); + env->CallVoidMethod(lcData->listener,lcData->displayStatusId,lcData->core,message ? env->NewStringUTF(message) : NULL); } static void displayMessageCb(LinphoneCore *lc, const char *message) { From 78565bae79d273468c755d9b1634e2ccceece95c Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 25 Jul 2012 17:21:16 +0200 Subject: [PATCH 29/47] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index cb0ef89e9..a9df77b27 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit cb0ef89e9fd1ef936fd4168fd89f41616caed382 +Subproject commit a9df77b2734b2628eb030f0c0768681b6573ae8b From 75e09c9613844a8999d8ad3b3b908c3b27a7a10a Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 25 Jul 2012 17:23:51 +0200 Subject: [PATCH 30/47] Updated builtin echo canceller devices list --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index a9df77b27..985da5aee 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit a9df77b2734b2628eb030f0c0768681b6573ae8b +Subproject commit 985da5aeec14582ecde457ab7ff6382e01d470b6 From 771cff42526e5758e1a16f1faf1bcc87549a7f96 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 26 Jul 2012 15:38:02 +0200 Subject: [PATCH 31/47] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 985da5aee..9ede70899 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 985da5aeec14582ecde457ab7ff6382e01d470b6 +Subproject commit 9ede708999a083165190982d31b358963faf5b7a From 14fc5446d03d5cf7a62e8884fa99fd7bbe175ecb Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 26 Jul 2012 16:17:46 +0200 Subject: [PATCH 32/47] Fix Decline/Missed call log --- coreapi/linphonecall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index ec006dd58..3793cb32b 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -489,9 +489,10 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const call->state=cstate; } if (cstate==LinphoneCallEnd || cstate==LinphoneCallError){ - switch(call->reason){ + switch(call->reason){ case LinphoneReasonDeclined: call->log->status=LinphoneCallDeclined; + break; case LinphoneReasonNotAnswered: call->log->status=LinphoneCallMissed; break; From d36cc880b8a04eb7fac4baf44581e68c7d02b812 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 31 Jul 2012 11:28:44 +0200 Subject: [PATCH 33/47] merge patch to indicate whether video is active in linphonec --- console/linphonec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/linphonec.c b/console/linphonec.c index 7d5c0cdd2..6220a0599 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -346,7 +346,7 @@ static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, L linphonec_out("Resuming call %i with %s.\n", id, from); break; case LinphoneCallStreamsRunning: - linphonec_out("Media streams established with %s for call %i.\n", from,id); + linphonec_out("Media streams established with %s for call %i (%s).\n", from,id,( linphone_call_params_video_enabled( linphone_call_get_current_params(call)) ? "video":"audio")); break; case LinphoneCallPausing: linphonec_out("Pausing call %i with %s.\n", id, from); From 9a0097a9748862b91448bb71c10c619e122e739a Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 31 Jul 2012 16:22:25 +0200 Subject: [PATCH 34/47] fix IOS camera localized name issue --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 9ede70899..c621a8ac6 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 9ede708999a083165190982d31b358963faf5b7a +Subproject commit c621a8ac69a33ae72f176689fa837bc5f0fb8eff From deb7ed6d93904dd0acee486e24f8bf9fb7b5aa33 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 1 Aug 2012 14:03:28 +0200 Subject: [PATCH 35/47] Exported is_network_reachable method through JNI --- coreapi/linphonecore_jni.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index e17cd929a..64837cab5 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -598,6 +598,12 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setNetworkStateReachable linphone_core_set_network_reachable((LinphoneCore*)lc,isReachable); } +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isNetworkStateReachable( JNIEnv* env + ,jobject thiz + ,jlong lc) { + return linphone_core_is_network_reachabled((LinphoneCore*)lc); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPlaybackGain( JNIEnv* env ,jobject thiz ,jlong lc From 1be354174188f8fbb800cd7a981d88176f1cbd4d Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Wed, 1 Aug 2012 17:59:50 +0200 Subject: [PATCH 36/47] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index c621a8ac6..8daca1b79 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit c621a8ac69a33ae72f176689fa837bc5f0fb8eff +Subproject commit 8daca1b79969ea90068ceb3a64cbbde974a9bf74 From 78fae7acaf65bf083a8d35ae0c0bdddc87b649cc Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 2 Aug 2012 09:20:51 +0200 Subject: [PATCH 37/47] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 8daca1b79..94eb4afe7 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 8daca1b79969ea90068ceb3a64cbbde974a9bf74 +Subproject commit 94eb4afe778c5fab72ca3e4defca42bc2a4d8118 From 042890cddef0e27b568bb03a00fa7894927c399f Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 2 Aug 2012 12:17:57 +0200 Subject: [PATCH 38/47] GetVersion method for linphoneCore exported --- coreapi/linphonecore_jni.cc | 5 +++++ java/common/org/linphone/core/LinphoneCore.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 64837cab5..894e4c1f8 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1769,3 +1769,8 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPolicy(JNIEnv *e extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setCpuCountNative(JNIEnv *env, jobject thiz, jint count) { ms_set_cpu_count(count); } + +extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getVersion(JNIEnv* env,jobject thiz,jlong ptr) { + jstring jvalue =env->NewStringUTF(linphone_core_get_version()); + return jvalue; +} diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 6f0ce2c65..e06342178 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -784,4 +784,8 @@ public interface LinphoneCore { */ public void refreshRegisters(); + /** + * return the version code of linphone core + */ + public String getVersion(); } From 5f2640d57a48e122cb14ffa2df23304103e3d6a9 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 2 Aug 2012 12:45:15 +0200 Subject: [PATCH 39/47] Android Makefile changed to automatically update linphone version --- build/android/common.mk | 6 +++++- configure.ac | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/android/common.mk b/build/android/common.mk index c85318ee4..40742b959 100644 --- a/build/android/common.mk +++ b/build/android/common.mk @@ -50,13 +50,17 @@ ifndef MY_LOG_DOMAIN MY_LOG_DOMAIN = \"Linphone\" endif +ifndef LINPHONE_VERSION +LINPHONE_VERSION = \"Devel\" +endif + LOCAL_CFLAGS += \ -D_BYTE_ORDER=_LITTLE_ENDIAN \ -DORTP_INET6 \ -DINET6 \ -DOSIP_MT \ -DENABLE_TRACE \ - -DLINPHONE_VERSION=\"3.4.0\" \ + -DLINPHONE_VERSION=\"$(LINPHONE_VERSION)\" \ -DLINPHONE_PLUGINS_DIR=\"\\tmp\" \ -DLOG_DOMAIN=$(MY_LOG_DOMAIN) diff --git a/configure.ac b/configure.ac index 235fb79b1..8dbf90482 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,8 @@ dnl Process this file with autoconf to produce a configure script. +dnl Keep this line, it is parsed by Android Makefile +LINPHONE_VERSION=3.5.2 -AC_INIT([linphone],[3.5.2],[linphone-developers@nongnu.org]) +AC_INIT([linphone],[$LINPHONE_VERSION],[linphone-developers@nongnu.org]) AC_CANONICAL_SYSTEM AC_CONFIG_SRCDIR([coreapi/linphonecore.c]) From e6ef8b45a4d109f06b452276061303c0e2173dda Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Fri, 3 Aug 2012 09:41:00 +0200 Subject: [PATCH 40/47] Update MS2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 94eb4afe7..ec0a638d5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 94eb4afe778c5fab72ca3e4defca42bc2a4d8118 +Subproject commit ec0a638d5c487ca8b7916094d14ad3967db62ce3 From a58b548331c103bca50b33898b07e13f5745b1c4 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 3 Aug 2012 13:44:43 +0200 Subject: [PATCH 41/47] fix version number declaration --- configure.ac | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 8dbf90482..235fb79b1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -dnl Keep this line, it is parsed by Android Makefile -LINPHONE_VERSION=3.5.2 -AC_INIT([linphone],[$LINPHONE_VERSION],[linphone-developers@nongnu.org]) +AC_INIT([linphone],[3.5.2],[linphone-developers@nongnu.org]) AC_CANONICAL_SYSTEM AC_CONFIG_SRCDIR([coreapi/linphonecore.c]) From bde9b86e968531cfdef2677f54abfecf6e9876ab Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 3 Aug 2012 16:33:22 +0200 Subject: [PATCH 42/47] add API to set custom parameters in the SIP contact address of registers. --- coreapi/linphonecore.h | 2 ++ coreapi/private.h | 1 + coreapi/proxy.c | 34 ++++++++++++++++++++++++++++++++-- mediastreamer2 | 2 +- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 81044fff5..a269bc476 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -474,6 +474,8 @@ const char *linphone_proxy_config_get_addr(const LinphoneProxyConfig *obj); int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj); bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj); void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj); +const char *linphone_proxy_config_get_contact_parameters(const LinphoneProxyConfig *obj); +void linphone_proxy_config_set_contact_parameters(LinphoneProxyConfig *obj, const char *contact_params); struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *obj); bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg); diff --git a/coreapi/private.h b/coreapi/private.h index 1ab7a6a7d..bc035f215 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -270,6 +270,7 @@ struct _LinphoneProxyConfig char *reg_identity; char *reg_route; char *realm; + char *contact_params; int expires; int reg_time; SalOp *op; diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 1676e0918..8e066ea33 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -256,9 +256,10 @@ static char *guess_contact_for_register(LinphoneProxyConfig *obj){ if (proxy==NULL) return NULL; host=linphone_address_get_domain (proxy); if (host!=NULL){ - LinphoneAddress *contact; char localip[LINPHONE_IPADDR_SIZE]; + char *tmp; LCSipTransports tr; + LinphoneAddress *contact; linphone_core_get_local_ip(obj->lc,host,localip); contact=linphone_address_new(obj->reg_identity); @@ -274,8 +275,12 @@ static char *guess_contact_for_register(LinphoneProxyConfig *obj){ sal_address_set_param(contact,"transport","tls"); } } - ret=linphone_address_as_string(contact); + tmp=linphone_address_as_string_uri_only(contact); + if (obj->contact_params) + ret=ms_strdup_printf("<%s;%s>",tmp,obj->contact_params); + else ret=ms_strdup_printf("<%s>",tmp); linphone_address_destroy(contact); + ms_free(tmp); } linphone_address_destroy (proxy); return ret; @@ -511,6 +516,31 @@ bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj){ return obj->reg_sendregister; } +/** + * Set optional contact parameters that will be added to the contact information sent in the registration. + * @param obj the proxy config object + * @param contact_params a string contaning the additional parameters in text form, like "myparam=something;myparam2=something_else" + * + * The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id. + * As an example, the contact address in the SIP register sent will look like . +**/ +void linphone_proxy_config_set_contact_parameters(LinphoneProxyConfig *obj, const char *contact_params){ + if (obj->contact_params) { + ms_free(obj->contact_params); + obj->contact_params=NULL; + } + if (contact_params){ + obj->contact_params=ms_strdup(contact_params); + } +} + +/** + * Returns previously set contact parameters. +**/ +const char *linphone_proxy_config_get_contact_parameters(const LinphoneProxyConfig *obj){ + return obj->contact_params; +} + struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *obj){ return obj->lc; } diff --git a/mediastreamer2 b/mediastreamer2 index 94eb4afe7..ec0a638d5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 94eb4afe778c5fab72ca3e4defca42bc2a4d8118 +Subproject commit ec0a638d5c487ca8b7916094d14ad3967db62ce3 From 3be24046c2cd689216166ca7339bee6a3e78ce4f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 6 Aug 2012 10:40:59 +0200 Subject: [PATCH 43/47] update documentation --- coreapi/linphonecore.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index a269bc476..3d10a26af 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -720,11 +720,11 @@ typedef struct _LinphoneVTable{ BuddyInfoUpdated buddy_info_updated; /**< a LinphoneFriend's BuddyInfo has changed*/ NotifyReceivedCb notify_recv; /**< Other notifications*/ CallStatsUpdated call_stats_updated; /** Date: Tue, 7 Aug 2012 11:44:14 +0200 Subject: [PATCH 44/47] Fix memory leak for android --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index ec0a638d5..e1beea6f7 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit ec0a638d5c487ca8b7916094d14ad3967db62ce3 +Subproject commit e1beea6f700b39002facf7520b757c264d8d3c5e From e93d9096ff433d3195c177e4c767881406e71d88 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Tue, 7 Aug 2012 17:38:20 +0200 Subject: [PATCH 45/47] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index e1beea6f7..863022b56 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit e1beea6f700b39002facf7520b757c264d8d3c5e +Subproject commit 863022b56fab41d2ca45dd1d149cb0caab08b54b From dc5b821d22ae39eda6a5c448a3f9e35e8b81f008 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 9 Aug 2012 11:04:23 +0200 Subject: [PATCH 46/47] fix makefile for android --- build/android/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/android/common.mk b/build/android/common.mk index 40742b959..4fa833b59 100644 --- a/build/android/common.mk +++ b/build/android/common.mk @@ -51,7 +51,7 @@ MY_LOG_DOMAIN = \"Linphone\" endif ifndef LINPHONE_VERSION -LINPHONE_VERSION = \"Devel\" +LINPHONE_VERSION = "Devel" endif LOCAL_CFLAGS += \ From 6f9b9458f711961f389362410718390ac933873f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 9 Aug 2012 16:07:43 +0200 Subject: [PATCH 47/47] add config entry to finely select audio stream features --- coreapi/linphonecall.c | 2 ++ coreapi/linphonecore.c | 3 +++ coreapi/misc.c | 33 ++++++++++++++++++++++++++++++++- coreapi/private.h | 1 + 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 3793cb32b..77fd9e20f 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -933,6 +933,8 @@ void linphone_call_init_media_streams(LinphoneCall *call){ audio_stream_enable_noise_gate(audiostream,enabled); } + audio_stream_set_features(audiostream,linphone_core_get_audio_features(lc)); + if (lc->rtptf){ RtpTransport *artp=lc->rtptf->audio_rtp_func(lc->rtptf->audio_rtp_func_data, call->audio_port); RtpTransport *artcp=lc->rtptf->audio_rtcp_func(lc->rtptf->audio_rtcp_func_data, call->audio_port+1); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 40b2a647d..62942726a 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -485,6 +485,9 @@ static void sound_config_read(LinphoneCore *lc) linphone_core_set_playback_gain_db (lc,gain); linphone_core_set_remote_ringback_tone (lc,lp_config_get_string(lc->config,"sound","ringback_tone",NULL)); + + /*just parse requested stream feature once at start to print out eventual errors*/ + linphone_core_get_audio_features(lc); } static void sip_config_read(LinphoneCore *lc) diff --git a/coreapi/misc.c b/coreapi/misc.c index a749bf279..786347d63 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "private.h" +#include "lpconfig.h" #include "mediastreamer2/mediastream.h" #include #include @@ -574,6 +575,37 @@ LinphoneProxyConfig * is_a_linphone_proxy_config(void *user_pointer){ return cfg->magic==linphone_proxy_config_magic ? cfg : NULL; } +unsigned int linphone_core_get_audio_features(LinphoneCore *lc){ + unsigned int ret=0; + const char *features=lp_config_get_string(lc->config,"sound","features",NULL); + if (features){ + char tmp[256]={0}; + char name[256]; + char *p,*n; + strncpy(tmp,features,sizeof(tmp)-1); + for(p=tmp;*p!='\0';p++){ + if (*p==' ') continue; + n=strchr(p,'|'); + if (n) *n='\0'; + sscanf(p,"%s",name); + ms_message("Found audio feature %s",name); + if (strcasecmp(name,"PLC")==0) ret|=AUDIO_STREAM_FEATURE_PLC; + else if (strcasecmp(name,"EC")==0) ret|=AUDIO_STREAM_FEATURE_EC; + else if (strcasecmp(name,"EQUALIZER")==0) ret|=AUDIO_STREAM_FEATURE_EQUALIZER; + else if (strcasecmp(name,"VOL_SND")==0) ret|=AUDIO_STREAM_FEATURE_VOL_SND; + else if (strcasecmp(name,"VOL_RCV")==0) ret|=AUDIO_STREAM_FEATURE_VOL_RCV; + else if (strcasecmp(name,"DTMF")==0) ret|=AUDIO_STREAM_FEATURE_DTMF; + else if (strcasecmp(name,"DTMF_ECHO")==0) ret|=AUDIO_STREAM_FEATURE_DTMF_ECHO; + else if (strcasecmp(name,"ALL")==0) ret|=AUDIO_STREAM_FEATURE_ALL; + else if (strcasecmp(name,"NONE")==0) ret=0; + else ms_error("Unsupported audio feature %s requested in config file.",name); + if (!n) break; + p=n; + } + }else ret=AUDIO_STREAM_FEATURE_ALL; + return ret; +} + #ifdef HAVE_GETIFADDRS @@ -697,7 +729,6 @@ int linphone_core_get_local_ip_for(int type, const char *dest, char *result){ - void _linphone_core_configure_resolver(){ /*bionic declares _res but does not define nor export it !!*/ #ifdef ANDROID diff --git a/coreapi/private.h b/coreapi/private.h index bc035f215..24ee7f899 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -567,6 +567,7 @@ void linphone_call_remove_from_conf(LinphoneCall *call); void linphone_core_conference_check_uninit(LinphoneCore *lc); bool_t linphone_core_sound_resources_available(LinphoneCore *lc); void linphone_core_notify_refer_state(LinphoneCore *lc, LinphoneCall *referer, LinphoneCall *newcall); +unsigned int linphone_core_get_audio_features(LinphoneCore *lc); void __linphone_core_invalidate_registers(LinphoneCore* lc); void _linphone_core_codec_config_write(LinphoneCore *lc);