Hello,

With SFLPhone 1.2.3 (and the tip of master as of today), if the user does not 
have a ~/.cache/sflphone directory, then ZRTP-enabled calls fail. This is 
because the ZRTP cache file cannot be created if the aforementioned directory 
does not exist.

Please find the attached patch which fixes this issue by creating the 
~/.cache/sflphone directory using the fileutils::check_dir(...) function.

Regards,

M. Vefa Bicakci

diff --git a/daemon/src/audio/audiortp/audio_zrtp_session.cpp b/daemon/src/audio/audiortp/audio_zrtp_session.cpp
index 6d9590e..47f1a04 100644
--- a/daemon/src/audio/audiortp/audio_zrtp_session.cpp
+++ b/daemon/src/audio/audiortp/audio_zrtp_session.cpp
@@ -72,16 +72,20 @@ void AudioZrtpSession::initializeZid()
         throw ZrtpZidException("zid filename empty");
 
     const std::string cache_home(XDG_CACHE_HOME);
+    std::string zidDirName;
     std::string zidCompleteFilename;
 
     if (not cache_home.empty()) {
-        zidCompleteFilename = cache_home + DIR_SEPARATOR_STR + zidFilename_;
+        zidDirName = cache_home;
     } else {
-        zidCompleteFilename = fileutils::get_home_dir() + DIR_SEPARATOR_STR +
-                              ".cache" + DIR_SEPARATOR_STR + PACKAGE +
-                              DIR_SEPARATOR_STR + zidFilename_;
+        zidDirName = fileutils::get_home_dir() + DIR_SEPARATOR_STR +
+                              ".cache" + DIR_SEPARATOR_STR + PACKAGE;
     }
 
+    zidCompleteFilename = zidDirName + DIR_SEPARATOR_STR + zidFilename_;
+
+    fileutils::check_dir(zidDirName.c_str());
+
     if (initialize(zidCompleteFilename.c_str()) >= 0) {
         setEnableZrtp(true);
         setUserCallback(new ZrtpSessionCallback(call_));
_______________________________________________
SFLphone mailing list
[email protected]
http://lists.savoirfairelinux.net/mailman/listinfo/sflphone

Reply via email to