dnl Process this file with autoconf to produce a configure script.
-AC_INIT([linphone],[3.4.99.2],[linphone-developers@nongnu.org])
+AC_INIT([linphone],[3.4.99.4],[linphone-developers@nongnu.org])
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
AC_CHECK_PROGS(MD5SUM,[md5sum md5])
AM_CONDITIONAL(HAVE_MD5SUM,test -n $MD5SUM)
- case $target_os in
+ case $target in
*mingw32ce)
CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501"
CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
CONSOLE_FLAGS="-mconsole"
mingw_found=yes
;;
- *darwin*)
+ armv6-apple-darwin|armv7-apple-darwin|i386-apple-darwin)
+ CFLAGS="$CFLAGS -DTARGET_OS_IPHONE "
+ build_tests=no
+ ios_found=yes
+ ;;
+ x86_64-apple-darwin*|i686-apple-darwin*)
+ MSPLUGINS_CFLAGS=""
dnl use macport installation
ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
build_macos=yes
- ;;
+ ;;
+
esac
AC_SUBST(ACLOCAL_MACOS_FLAGS)
dnl localization tools
IT_PROG_INTLTOOL([0.40], [no-xml])
+ AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
dnl Initialize libtool
LT_INIT([win32-dll shared disable-static])
*) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
esac],[alsa=true])
-AC_ARG_ENABLE(artsc,
- [ --enable-artsc Turn on artsc (kde) sound input/output (auto) ],
+AC_ARG_ENABLE(zrtp,
+ [ --enable-zrtp Turn on zrtp support - UNFINISHED],
[case "${enableval}" in
- yes) artsc=true ;;
- no) artsc=false ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
- esac],[artsc=false])
+ yes) zrtp=true ;;
+ no) zrtp=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-zrtp) ;;
+ esac],[zrtp=false])
+
AC_ARG_ENABLE(portaudio,
[ --enable-portaudio Turn on portaudio native support compiling],
dnl compilation of gtk user interface
AM_CONDITIONAL(BUILD_GTK_UI, [test x$gtk_ui = xtrue ] )
AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
+AM_CONDITIONAL(BUILD_ZRTP, test x$zrtp = xtrue)
dnl check getenv
AH_TEMPLATE([HAVE_GETENV])
#include "private.h"
#include <ortp/telephonyevents.h>
+#include <ortp/zrtp.h>
#include "mediastreamer2/mediastream.h"
#include "mediastreamer2/mseventqueue.h"
#include "mediastreamer2/msvolume.h"
#endif
#endif
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/*#define UNSTANDART_GSM_11K 1*/
#define ROOT_CA_FILE PACKAGE_DATA_DIR "/linphone/rootca.pem"
#else
sal_root_ca(lc->sal, lp_config_get_string(lc->config,"sip","root_ca", ROOT_CA_FILE));
#endif
-
+
tmp=lp_config_get_int(lc->config,"sip","guess_hostname",1);
linphone_core_set_guess_hostname(lc,tmp);
break;
}
}
+ /*this is to filter out unsupported encryption schemes*/
+ linphone_core_set_media_encryption(lc,linphone_core_get_media_encryption(lc));
/*for tuning or test*/
lc->sip_conf.sdp_200_ack=lp_config_get_int(lc->config,"sip","sdp_200_ack",0);
void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno){
lc->use_preview_window=yesno;
}
-
+ /**
+ *returns current device orientation
+ */
+ int linphone_core_get_device_rotation(LinphoneCore *lc ) {
+ return lc->device_rotation;
+ }
/**
* Tells the core the device current orientation. This can be used by capture filters
* on mobile devices to select between portrait/landscape mode and to produce properly
{ {MS_VIDEO_SIZE_QVGA_H,MS_VIDEO_SIZE_QVGA_W} , "qvga-portrait" },
{ {MS_VIDEO_SIZE_QCIF_W,MS_VIDEO_SIZE_QCIF_H} , "qcif" },
{ {MS_VIDEO_SIZE_QCIF_H,MS_VIDEO_SIZE_QCIF_W} , "qcif-portrait" },
+ { {MS_VIDEO_SIZE_IOS_MEDIUM_H,MS_VIDEO_SIZE_IOS_MEDIUM_W} , "ios-medium" },
{ {0,0} , NULL }
};
LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc){
LinphoneCallParams *p=ms_new0(LinphoneCallParams,1);
- p->has_video=linphone_core_video_enabled(lc);
+ linphone_core_init_default_params(lc, p);
return p;
}
int linphone_core_get_max_calls(LinphoneCore *lc) {
return lc->max_calls;
}
-
+void linphone_core_set_max_calls(LinphoneCore *lc, int max) {
+ lc->max_calls=max;
+}
typedef struct Hook{
LinphoneCoreIterateHook fun;
lc->zrtp_secrets_cache=file ? ms_strdup(file) : NULL;
}
-// if (stringUri.equals(call.getRemoteAddress().asStringUriOnly())) {
const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, const char *uri) {
if (uri == NULL) return NULL;
MSList *calls=lc->calls;
}
return NULL;
}
+
+
+/**
+ * Check if a call will need the sound resources.
+ *
+ * @ingroup call_control
+ * @param lc The LinphoneCore
+**/
+bool_t linphone_core_sound_resources_locked(LinphoneCore *lc){
+ MSList *calls=lc->calls;
+ while(calls) {
+ LinphoneCall *c=(LinphoneCall*)calls->data;
+ calls=calls->next;
+ switch (c->state) {
+ case LinphoneCallOutgoingInit:
+ case LinphoneCallOutgoingProgress:
+ case LinphoneCallOutgoingRinging:
+ case LinphoneCallOutgoingEarlyMedia:
+ case LinphoneCallConnected:
+ case LinphoneCallRefered:
+ case LinphoneCallIncomingEarlyMedia:
+ case LinphoneCallUpdated:
+ return TRUE;
+ default:
+ break;
+ }
+ }
+ return FALSE;
+}
+
+void linphone_core_set_srtp_enabled(LinphoneCore *lc, bool_t enabled) {
+ lp_config_set_int(lc->config,"sip","srtp",(int)enabled);
+}
+
+/**
+ * Returns whether a media encryption scheme is supported by the LinphoneCore engine
+**/
+bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, LinphoneMediaEncryption menc){
+ switch(menc){
+ case LinphoneMediaEncryptionSRTP:
+ return ortp_srtp_supported();
+ case LinphoneMediaEncryptionZRTP:
+ return ortp_zrtp_available();
+ case LinphoneMediaEncryptionNone:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+int linphone_core_set_media_encryption(LinphoneCore *lc, enum LinphoneMediaEncryption menc) {
+ const char *type="none";
+ int ret=0;
+ if (menc == LinphoneMediaEncryptionSRTP){
+ if (!ortp_srtp_supported()){
+ ms_warning("SRTP not supported by library.");
+ type="none";
+ ret=-1;
+ }else type="srtp";
+ }else if (menc == LinphoneMediaEncryptionZRTP){
+ if (!ortp_zrtp_available()){
+ ms_warning("ZRTP not supported by library.");
+ type="none";
+ ret=-1;
+ }else type="zrtp";
+ }
+ lp_config_set_string(lc->config,"sip","media_encryption",type);
+ return ret;
+}
+
+LinphoneMediaEncryption linphone_core_get_media_encryption(LinphoneCore *lc) {
+ const char* menc = lp_config_get_string(lc->config, "sip", "media_encryption", NULL);
+
+ if (menc == NULL)
+ return LinphoneMediaEncryptionNone;
+ else if (strcmp(menc, "srtp")==0)
+ return LinphoneMediaEncryptionSRTP;
+ else if (strcmp(menc, "zrtp")==0)
+ return LinphoneMediaEncryptionZRTP;
+ else
+ return LinphoneMediaEncryptionNone;
+}
+
+bool_t linphone_core_is_media_encryption_mandatory(LinphoneCore *lc) {
+ return (bool_t)lp_config_get_int(lc->config, "sip", "media_encryption_mandatory", 0);
+}
+
+void linphone_core_set_media_encryption_mandatory(LinphoneCore *lc, bool_t m) {
+ lp_config_set_int(lc->config, "sip", "media_encryption_mandatory", (int)m);
+}
+
+void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params) {
+ params->has_video=linphone_core_video_enabled(lc);
+ params->media_encryption=linphone_core_get_media_encryption(lc);
+ params->in_conference=FALSE;
+}
+
struct _LinphoneCore *lc;
} LinphoneCallLog;
+enum LinphoneMediaEncryption {
+ LinphoneMediaEncryptionNone,
+ LinphoneMediaEncryptionSRTP,
+ LinphoneMediaEncryptionZRTP
+};
+typedef enum LinphoneMediaEncryption LinphoneMediaEncryption;
/*public: */
void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up);
LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp);
void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled);
bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp);
+LinphoneMediaEncryption linphone_call_params_get_media_encryption(const LinphoneCallParams *cp);
+void linphone_call_params_set_media_encryption(LinphoneCallParams *cp, LinphoneMediaEncryption e);
void linphone_call_params_enable_early_media_sending(LinphoneCallParams *cp, bool_t enabled);
bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams *cp);
bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp);
float linphone_call_get_record_volume(LinphoneCall *call);
float linphone_call_get_current_quality(LinphoneCall *call);
float linphone_call_get_average_quality(LinphoneCall *call);
+const char* linphone_call_get_authentication_token(LinphoneCall *call);
+bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call);
+void linphone_call_set_authentication_token_verified(LinphoneCall *call, bool_t verified);
+void linphone_call_send_vfu_request(LinphoneCall *call);
void *linphone_call_get_user_pointer(LinphoneCall *call);
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
/**
void linphone_core_set_native_preview_window_id(LinphoneCore *lc, unsigned long id);
void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno);
+ int linphone_core_get_device_rotation(LinphoneCore *lc );
void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation);
/*play/record support: use files instead of soundcard*/
*/
void linphone_core_refresh_registers(LinphoneCore* lc);
-
-void linphone_call_send_vfu_request(LinphoneCall *call);
-
/* Path to the file storing secrets cache */
void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file);
-bool_t linphone_call_are_all_streams_encrypted(LinphoneCall *call);
-const char* linphone_call_get_authentication_token(LinphoneCall *call);
-bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call);
const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, const char *uri);
int linphone_core_get_conference_size(LinphoneCore *lc);
int linphone_core_get_max_calls(LinphoneCore *lc);
+void linphone_core_set_max_calls(LinphoneCore *lc, int max);
+
+bool_t linphone_core_sound_resources_locked(LinphoneCore *lc);
+
+bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, LinphoneMediaEncryption menc);
+
+/**
+ * Choose media encryption policy to be used for RTP packets
+ */
+int linphone_core_set_media_encryption(LinphoneCore *lc, enum LinphoneMediaEncryption menc);
+LinphoneMediaEncryption linphone_core_get_media_encryption(LinphoneCore *lc);
+
+bool_t linphone_core_is_media_encryption_mandatory(LinphoneCore *lc);
+/**
+ * Defines Linphone behaviour when encryption parameters negociation fails on outoing call.
+ * If set to TRUE call will fail; if set to FALSE will resend an INVITE with encryption disabled
+ */
+void linphone_core_set_media_encryption_mandatory(LinphoneCore *lc, bool_t m);
+
+/**
+ * Init call params using LinphoneCore's current configuration
+ */
+void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params);
#ifdef __cplusplus
}
#define PACKAGE_SOUND_DIR "."
#endif
+ #ifndef PACKAGE_DATA_DIR
+ #define PACKAGE_DATA_DIR "."
+ #endif
+
#ifdef HAVE_GETTEXT
#include <libintl.h>
#ifndef _
#endif
#endif
-
struct _LinphoneCallParams{
LinphoneCall *referer; /*in case this call creation is consecutive to an incoming transfer, this points to the original call */
int audio_bw; /* bandwidth limit for audio stream */
+ LinphoneMediaEncryption media_encryption;
bool_t has_video;
bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/
bool_t in_conference; /*in conference mode */
bool_t pad;
+
};
struct _LinphoneCall
- Subproject commit fb45658a172fa53f0fd722b0660cc9b8c4396752
-Subproject commit 7e80b7c99175ff4165814eaa90d13a7b1bd7a869
++Subproject commit 4ee916b3fcae0aba38a0d595079298242c9ac2cd