]> sjero.net Git - linphone/commitdiff
Add getter for zrtp_secrets_file, static_picture and root_ca
authorYann Diorcet <yann.diorcet@belledonne-communications.com>
Mon, 26 Nov 2012 09:51:50 +0000 (10:51 +0100)
committerYann Diorcet <yann.diorcet@belledonne-communications.com>
Mon, 26 Nov 2012 09:51:50 +0000 (10:51 +0100)
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/sal.h
coreapi/sal_eXosip2.c
mediastreamer2

index 01667ebcb4f7608ae26d367fe7787d3cf487a4e8..0db7894b974dfa02d12b3363e4ff974bb0529bfc 100644 (file)
@@ -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;
index f3aa7625319b2742230f6367d5ff54367dcb0eb0..f0cf69532139d2df72ad72ade8613d70ed69bb03 100644 (file)
@@ -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);
 
index e5eb1c190d79126338632318eb39dbc0daf5ed28..daa59217a28bfc75c592a1c8b2fc0a6500606da1 100644 (file)
@@ -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);
index 0363ddb2b2a3eecbbc44e9cb63357b414b478e5a..8dbf0173bfdb1bb78b9fd9cdf4554df4686fe09c 100644 (file)
@@ -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
index 55a86251dd3dd6516f5ecef45a39371826f69c9a..07779d3e25a58b7d252338cd0c327f1f7d9d5e6b 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 55a86251dd3dd6516f5ecef45a39371826f69c9a
+Subproject commit 07779d3e25a58b7d252338cd0c327f1f7d9d5e6b