~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

Viewing changes to daemon/src/audio/audiortp/audio_zrtp_session.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
3
3
 *  Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
4
4
 *  Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
5
5
 *
39
39
#include "manager.h"
40
40
#include "fileutils.h"
41
41
 
42
 
#include <libzrtpcpp/zrtpccrtp.h>
43
 
#include <libzrtpcpp/ZrtpQueue.h>
44
 
#include <libzrtpcpp/ZrtpUserCallback.h>
45
 
#include <ccrtp/rtp.h>
46
 
 
47
42
namespace sfl {
48
43
 
49
44
AudioZrtpSession::AudioZrtpSession(SIPCall &call, const std::string &zidFilename) :
72
67
        throw ZrtpZidException("zid filename empty");
73
68
 
74
69
    const std::string cache_home(XDG_CACHE_HOME);
 
70
    std::string zidDirName;
75
71
    std::string zidCompleteFilename;
76
72
 
77
73
    if (not cache_home.empty()) {
78
 
        zidCompleteFilename = cache_home + DIR_SEPARATOR_STR + zidFilename_;
 
74
        zidDirName = cache_home;
79
75
    } else {
80
 
        zidCompleteFilename = fileutils::get_home_dir() + DIR_SEPARATOR_STR +
81
 
                              ".cache" + DIR_SEPARATOR_STR + PACKAGE +
82
 
                              DIR_SEPARATOR_STR + zidFilename_;
 
76
        zidDirName = fileutils::get_home_dir() + DIR_SEPARATOR_STR +
 
77
                              ".cache" + DIR_SEPARATOR_STR + PACKAGE;
83
78
    }
84
79
 
 
80
    zidCompleteFilename = zidDirName + DIR_SEPARATOR_STR + zidFilename_;
 
81
 
 
82
    fileutils::check_dir(zidDirName.c_str());
 
83
 
85
84
    if (initialize(zidCompleteFilename.c_str()) >= 0) {
86
85
        setEnableZrtp(true);
87
86
        setUserCallback(new ZrtpSessionCallback(call_));