From 17c6593abc5bff8e8de850cbf96184c296a34d4f Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 26 Nov 2012 10:51:50 +0100 Subject: [PATCH] Add getter for zrtp_secrets_file, static_picture and root_ca --- coreapi/linphonecore.c | 25 +++++++++++++++++++++++++ coreapi/linphonecore.h | 6 ++++-- coreapi/sal.h | 1 + coreapi/sal_eXosip2.c | 4 ++++ mediastreamer2 | 2 +- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 01667ebcb..0db7894b9 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3659,6 +3659,17 @@ void linphone_core_set_root_ca(LinphoneCore *lc,const char *path){ sal_set_root_ca(lc->sal, path); } +/** + * Gets the path to a file or folder containing trusted root CAs (PEM format) + * + * @param lc The LinphoneCore object + * + * @ingroup media_parameters +**/ +const char *linphone_core_get_root_ca(LinphoneCore *lc){ + return sal_get_root_ca(lc->sal); +} + /** * Specify whether the tls server certificate must be verified when connecting to a SIP/TLS server. **/ @@ -4189,6 +4200,16 @@ int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) { return 0; } +const char *linphone_core_get_static_picture(LinphoneCore *lc) { + const char *path=NULL; +#ifdef VIDEO_ENABLED + path=ms_static_image_get_default_image(); +#else + ms_warning("Video support not compiled."); +#endif + return path; +} + int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps) { #ifdef VIDEO_ENABLED VideoStream *vs = NULL; @@ -5185,6 +5206,10 @@ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file){ lc->zrtp_secrets_cache=file ? ms_strdup(file) : NULL; } +const char *linphone_core_get_zrtp_secrets_file(LinphoneCore *lc){ + return lc->zrtp_secrets_cache; +} + const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, const char *uri) { if (uri == NULL) return NULL; MSList *calls=lc->calls; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index f3aa76253..f0cf69532 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1214,6 +1214,7 @@ void linphone_core_set_ring(LinphoneCore *lc, const char *path); const char *linphone_core_get_ring(const LinphoneCore *lc); void linphone_core_verify_server_certificates(LinphoneCore *lc, bool_t yesno); void linphone_core_set_root_ca(LinphoneCore *lc, const char *path); +const char *linphone_core_get_root_ca(LinphoneCore *lc); void linphone_core_set_ringback(LinphoneCore *lc, const char *path); const char * linphone_core_get_ringback(const LinphoneCore *lc); @@ -1282,8 +1283,9 @@ const char** linphone_core_get_video_devices(const LinphoneCore *lc); int linphone_core_set_video_device(LinphoneCore *lc, const char *id); const char *linphone_core_get_video_device(const LinphoneCore *lc); -/* Set static picture to be used when "Static picture" is the video device */ +/* Set and get static picture to be used when "Static picture" is the video device */ int linphone_core_set_static_picture(LinphoneCore *lc, const char *path); +const char *linphone_core_get_static_picture(LinphoneCore *lc); /* Set and get frame rate for static picture */ int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps); @@ -1387,7 +1389,7 @@ void linphone_core_refresh_registers(LinphoneCore* lc); /* Path to the file storing secrets cache */ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file); - +const char *linphone_core_get_zrtp_secrets_file(LinphoneCore *lc); const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, const char *uri); diff --git a/coreapi/sal.h b/coreapi/sal.h index e5eb1c190..daa59217a 100644 --- a/coreapi/sal.h +++ b/coreapi/sal.h @@ -356,6 +356,7 @@ void sal_use_one_matching_codec_policy(Sal *ctx, bool_t one_matching_codec); void sal_use_rport(Sal *ctx, bool_t use_rports); void sal_use_101(Sal *ctx, bool_t use_101); void sal_set_root_ca(Sal* ctx, const char* rootCa); +const char *sal_get_root_ca(Sal* ctx); void sal_verify_server_certificates(Sal *ctx, bool_t verify); int sal_iterate(Sal *sal); diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 0363ddb2b..8dbf0173b 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -486,6 +486,10 @@ void sal_set_root_ca(Sal* ctx, const char* rootCa) { set_tls_options(ctx); } +const char *sal_get_root_ca(Sal* ctx) { + return ctx->rootCa; +} + void sal_verify_server_certificates(Sal *ctx, bool_t verify){ ctx->verify_server_certs=verify; #ifdef HAVE_EXOSIP_TLS_VERIFY_CERTIFICATE diff --git a/mediastreamer2 b/mediastreamer2 index 55a86251d..07779d3e2 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 55a86251dd3dd6516f5ecef45a39371826f69c9a +Subproject commit 07779d3e25a58b7d252338cd0c327f1f7d9d5e6b