Commit d47564e8 authored by Tristan Matthews's avatar Tristan Matthews

Merge branch 'master' of...

Merge branch 'master' of git+ssh://git.sflphone.org/var/repos/sflphone/git/sflphone into video_preview

Resolved Conflicts:
	daemon/src/account.cpp
	daemon/src/audio/audiortp/audio_rtp_session.h
	daemon/src/sip/sipvoiplink.cpp
	gnome/src/accountlist.h
	gnome/src/actions.c
	gnome/src/codeclist.c
	gnome/src/codeclist.h
	gnome/src/config/accountconfigdialog.c
	gnome/src/config/audioconf.c
	gnome/src/dbus/dbus.c
	gnome/tests/Makefile.am
parents 39f7d57c 0db8a567
......@@ -67,5 +67,9 @@ config_auto.h
# Ignore temp files
*~
# Cscope/Ctags files
cscope.*
tags
# IDE stuffs
nbproject
......@@ -32,11 +32,12 @@
#include "account.h"
#include "manager.h"
#include "dbus/configurationmanager.h"
#ifdef SFL_VIDEO
#include "video/video_endpoint.h"
#endif
Account::Account(const std::string& accountID, const std::string &type) :
Account::Account(const std::string &accountID, const std::string &type) :
accountID_(accountID)
, username_()
, hostname_()
......@@ -68,7 +69,8 @@ void Account::setRegistrationState(const RegistrationState &state)
registrationState_ = state;
// Notify the client
Manager::instance().connectionStatusNotification();
ConfigurationManager *c(Manager::instance().getDbusManager()->getConfigurationManager());
c->registrationStateChanged(accountID_, registrationState_);
}
}
......
......@@ -75,7 +75,6 @@ static const char *const CONFIG_ACCOUNT_TYPE = "Account.type";
static const char *const CONFIG_ACCOUNT_ALIAS = "Account.alias";
static const char *const CONFIG_ACCOUNT_MAILBOX = "Account.mailbox";
static const char *const CONFIG_ACCOUNT_ENABLE = "Account.enable";
static const char *const CONFIG_ACCOUNT_RESOLVE_ONCE = "Account.resolveOnce";
static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE = "Account.registrationExpire";
static const char *const CONFIG_CREDENTIAL_NUMBER = "Credential.count";
static const char *const CONFIG_ACCOUNT_DTMF_TYPE = "Account.dtmfType";
......
......@@ -43,17 +43,19 @@
namespace sfl {
AudioRtpFactory::AudioRtpFactory(SIPCall *ca) : rtpSession_(NULL),
audioRtpThreadMutex_(), srtpEnabled_(false),
keyExchangeProtocol_(Symmetric), helloHashEnabled_(false),
remoteContext_(NULL), localContext_(NULL), ca_(ca)
audioRtpThreadMutex_(), srtpEnabled_(false), helloHashEnabled_(false),
cachedRemoteContext_(0), cachedLocalContext_(0), ca_(ca),
keyExchangeProtocol_(NONE)
{}
AudioRtpFactory::~AudioRtpFactory()
{
delete rtpSession_;
delete cachedLocalContext_;
delete cachedRemoteContext_;
}
void AudioRtpFactory::initAudioRtpConfig()
void AudioRtpFactory::initConfig()
{
if (rtpSession_ != NULL)
stop();
......@@ -65,48 +67,48 @@ void AudioRtpFactory::initAudioRtpConfig()
if (account) {
srtpEnabled_ = account->getSrtpEnabled();
std::string key(account->getSrtpKeyExchange());
if (key == "sdes")
keyExchangeProtocol_ = Sdes;
else if (key == "zrtp")
keyExchangeProtocol_ = Zrtp;
else
keyExchangeProtocol_ = Symmetric;
if (srtpEnabled_) {
if (key == "sdes")
keyExchangeProtocol_ = SDES;
else if (key == "zrtp")
keyExchangeProtocol_ = ZRTP;
} else {
keyExchangeProtocol_ = NONE;
}
helloHashEnabled_ = account->getZrtpHelloHash();
} else {
srtpEnabled_ = false;
keyExchangeProtocol_ = Symmetric;
keyExchangeProtocol_ = NONE;
helloHashEnabled_ = false;
}
}
void AudioRtpFactory::initAudioSymmetricRtpSession()
void AudioRtpFactory::initSession()
{
ost::MutexLock m(audioRtpThreadMutex_);
if (srtpEnabled_) {
std::string zidFilename(Manager::instance().voipPreferences.getZidFile());
const std::string zidFilename(Manager::instance().voipPreferences.getZidFile());
switch (keyExchangeProtocol_) {
case Zrtp:
rtpSession_ = new AudioZrtpSession(ca_, zidFilename);
case ZRTP:
rtpSession_ = new AudioZrtpSession(*ca_, zidFilename);
// TODO: be careful with that. The hello hash is computed asynchronously. Maybe it's
// not even available at that point.
if (helloHashEnabled_)
ca_->getLocalSDP()->setZrtpHash(static_cast<AudioZrtpSession *>(rtpSession_)->getHelloHash());
break;
case Sdes:
rtpSession_ = new AudioSrtpSession(ca_);
case SDES:
rtpSession_ = new AudioSrtpSession(*ca_);
break;
default:
throw UnsupportedRtpSessionType("Unsupported Rtp Session Exception Type!");
}
} else
rtpSession_ = new AudioSymmetricRtpSession(ca_);
rtpSession_ = new AudioSymmetricRtpSession(*ca_);
}
void AudioRtpFactory::start(AudioCodec* audiocodec)
......@@ -114,26 +116,17 @@ void AudioRtpFactory::start(AudioCodec* audiocodec)
if (rtpSession_ == NULL)
throw AudioRtpFactoryException("AudioRtpFactory: Error: RTP session was null when trying to start audio thread");
if (rtpSession_->getAudioRtpType() == Sdes)
if (localContext_ and remoteContext_)
static_cast<AudioSrtpSession *>(rtpSession_)->restoreCryptoContext(localContext_, remoteContext_);
if (keyExchangeProtocol_ == SDES and cachedLocalContext_ and cachedRemoteContext_)
static_cast<AudioSrtpSession *>(rtpSession_)->restoreCryptoContext(cachedLocalContext_, cachedRemoteContext_);
if (rtpSession_->startRtpThread(audiocodec) != 0)
throw AudioRtpFactoryException("AudioRtpFactory: Error: Failed to start AudioZrtpSession thread");
if (rtpSession_->startRtpThread(*audiocodec) != 0)
throw AudioRtpFactoryException("AudioRtpFactory: Error: Failed to start AudioRtpSession thread");
}
void AudioRtpFactory::stop()
{
ost::MutexLock mutex(audioRtpThreadMutex_);
if (rtpSession_ == NULL)
return;
if (rtpSession_->getAudioRtpType() == Sdes) {
localContext_ = static_cast<AudioSrtpSession*>(rtpSession_)->localCryptoCtx_;
remoteContext_ = static_cast<AudioSrtpSession*>(rtpSession_)->remoteCryptoCtx_;
}
delete rtpSession_;
rtpSession_ = NULL;
}
......@@ -151,7 +144,7 @@ void AudioRtpFactory::updateSessionMedia(AudioCodec *audiocodec)
if (rtpSession_ == NULL)
throw AudioRtpFactoryException("AudioRtpFactory: Error: rtpSession_ was null when trying to update IP address");
rtpSession_->updateSessionMedia(audiocodec);
rtpSession_->updateSessionMedia(*audiocodec);
}
void AudioRtpFactory::updateDestinationIpAddress()
......@@ -162,7 +155,7 @@ void AudioRtpFactory::updateDestinationIpAddress()
sfl::AudioZrtpSession * AudioRtpFactory::getAudioZrtpSession()
{
if (rtpSession_->getAudioRtpType() == Zrtp)
if (keyExchangeProtocol_ == ZRTP)
return static_cast<AudioZrtpSession *>(rtpSession_);
else
throw AudioRtpFactoryException("RTP: Error: rtpSession_ is NULL in getAudioZrtpSession");
......@@ -170,17 +163,20 @@ sfl::AudioZrtpSession * AudioRtpFactory::getAudioZrtpSession()
void sfl::AudioRtpFactory::initLocalCryptoInfo()
{
if (rtpSession_ && rtpSession_->getAudioRtpType() == Sdes) {
static_cast<AudioSrtpSession *>(rtpSession_)->initLocalCryptoInfo();
ca_->getLocalSDP()->setLocalSdpCrypto(static_cast<AudioSrtpSession *>(rtpSession_)->getLocalCryptoInfo());
if (rtpSession_ && keyExchangeProtocol_ == SDES) {
AudioSrtpSession *srtp = static_cast<AudioSrtpSession*>(rtpSession_);
// the context is invalidated and deleted by the call to initLocalCryptoInfo
cachedLocalContext_ = srtp->initLocalCryptoInfo();
ca_->getLocalSDP()->setLocalSdpCrypto(srtp->getLocalCryptoInfo());
}
}
void AudioRtpFactory::setRemoteCryptoInfo(sfl::SdesNegotiator& nego)
{
if (rtpSession_ && rtpSession_->getAudioRtpType() == Sdes)
static_cast<AudioSrtpSession *>(rtpSession_)->setRemoteCryptoInfo(nego);
else
if (rtpSession_ and keyExchangeProtocol_ == SDES) {
AudioSrtpSession *srtp = static_cast<AudioSrtpSession *>(rtpSession_);
cachedRemoteContext_ = srtp->setRemoteCryptoInfo(nego);
} else
throw AudioRtpFactoryException("RTP: Error: rtpSession_ is NULL in setRemoteCryptoInfo");
}
......
......@@ -62,15 +62,15 @@ class AudioRtpFactory {
AudioRtpFactory(SIPCall *ca);
~AudioRtpFactory();
void initAudioRtpConfig();
void initConfig();
/**
* Lazy instantiation method. Create a new RTP session of a given
* type according to the content of the configuration file.
* @param ca A pointer on a SIP call
* @return A new AudioSymmetricRtpSession object
* @return A new AudioRtpSession object
*/
void initAudioSymmetricRtpSession();
void initSession();
/**
* Start the audio rtp thread of the type specified in the configuration
......@@ -103,7 +103,7 @@ class AudioRtpFactory {
void updateDestinationIpAddress();
bool isSdesEnabled() const {
return srtpEnabled_ and keyExchangeProtocol_ == sfl::Sdes;
return srtpEnabled_ and keyExchangeProtocol_ == SDES;
}
/**
......@@ -140,28 +140,26 @@ class AudioRtpFactory {
private:
NON_COPYABLE(AudioRtpFactory);
enum KeyExchangeProtocol { NONE, SDES, ZRTP };
AudioRtpSession *rtpSession_;
ost::Mutex audioRtpThreadMutex_;
// Field used when initializinga udio rtp session
// Field used when initializing audio rtp session
// May be set manually or from config using initAudioRtpConfig
bool srtpEnabled_;
// Field used when initializinga udio rtp session
// May be set manually or from config using initAudioRtpConfig
RtpMethod keyExchangeProtocol_;
// Field used when initializinga udio rtp session
// May be set manually or from config using initAudioRtpConfig
bool helloHashEnabled_;
/** Remote srtp crypto context to be set into incoming data queue. */
ost::CryptoContext *remoteContext_;
ost::CryptoContext *cachedRemoteContext_;
/** Local srtp crypto context to be set into outgoing data queue. */
ost::CryptoContext *localContext_;
ost::CryptoContext *cachedLocalContext_;
SIPCall *ca_;
KeyExchangeProtocol keyExchangeProtocol_;
};
}
#endif // __AUDIO_RTP_FACTORY_H__
......@@ -67,13 +67,17 @@ AudioRtpRecord::~AudioRtpRecord()
}
AudioRtpRecordHandler::AudioRtpRecordHandler(SIPCall *ca) : audioRtpRecord_(), id_(ca->getCallId()), echoCanceller(ca->getMemoryPool()), gainController(8000, -10.0)
AudioRtpRecordHandler::AudioRtpRecordHandler(SIPCall &call) :
audioRtpRecord_(),
id_(call.getCallId()),
echoCanceller(call.getMemoryPool()),
gainController(8000, -10.0)
{}
AudioRtpRecordHandler::~AudioRtpRecordHandler() {}
void AudioRtpRecordHandler::setRtpMedia(AudioCodec* audioCodec)
void AudioRtpRecordHandler::setRtpMedia(AudioCodec *audioCodec)
{
ost::MutexLock lock(audioRtpRecord_.audioCodecMutex_);
......
......@@ -103,7 +103,7 @@ class AudioRtpRecord {
class AudioRtpRecordHandler {
public:
AudioRtpRecordHandler(SIPCall *);
AudioRtpRecordHandler(SIPCall &);
virtual ~AudioRtpRecordHandler();
/**
......
......@@ -43,29 +43,27 @@
#include "manager.h"
namespace sfl {
AudioRtpSession::AudioRtpSession(SIPCall * sipcall, RtpMethod type, ost::RTPDataQueue *queue, ost::Thread *thread) :
AudioRtpRecordHandler(sipcall)
, ca_(sipcall)
, type_(type)
, remote_ip_()
, remote_port_(0)
AudioRtpSession::AudioRtpSession(SIPCall &call, ost::RTPDataQueue &queue, ost::Thread &thread) :
AudioRtpRecordHandler(call)
, call_(call)
, timestamp_(0)
, timestampIncrement_(0)
, timestampCount_(0)
, isStarted_(false)
, queue_(queue)
, isStarted_(false)
, remote_ip_()
, remote_port_(0)
, timestampCount_(0)
, thread_(thread)
{
assert(ca_);
queue_->setTypeOfService(ost::RTPDataQueue::tosEnhanced);
queue_.setTypeOfService(ost::RTPDataQueue::tosEnhanced);
}
AudioRtpSession::~AudioRtpSession()
{
queue_->disableStack();
queue_.disableStack();
}
void AudioRtpSession::updateSessionMedia(AudioCodec *audioCodec)
void AudioRtpSession::updateSessionMedia(AudioCodec &audioCodec)
{
int lastSamplingRate = audioRtpRecord_.codecSampleRate_;
......@@ -80,9 +78,9 @@ void AudioRtpSession::updateSessionMedia(AudioCodec *audioCodec)
}
void AudioRtpSession::setSessionMedia(AudioCodec *audioCodec)
void AudioRtpSession::setSessionMedia(AudioCodec &audioCodec)
{
setRtpMedia(audioCodec);
setRtpMedia(&audioCodec);
// store codec info locally
int payloadType = getCodecPayloadType();
......@@ -96,26 +94,28 @@ void AudioRtpSession::setSessionMedia(AudioCodec *audioCodec)
else
timestampIncrement_ = frameSize;
DEBUG("AudioRptSession: Codec payload: %d", payloadType);
DEBUG("AudioSymmetricRtpSession: Codec sampling rate: %d", smplRate);
DEBUG("AudioSymmetricRtpSession: Codec frame size: %d", frameSize);
DEBUG("AudioSymmetricRtpSession: RTP timestamp increment: %d", timestampIncrement_);
DEBUG("AudioRtpSession: Codec payload: %d", payloadType);
DEBUG("AudioRtpSession: Codec sampling rate: %d", smplRate);
DEBUG("AudioRtpSession: Codec frame size: %d", frameSize);
DEBUG("AudioRtpSession: RTP timestamp increment: %d", timestampIncrement_);
if (payloadType == g722PayloadType) {
DEBUG("AudioSymmetricRtpSession: Setting G722 payload format");
queue_->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) payloadType, g722RtpClockRate));
DEBUG("AudioRtpSession: Setting G722 payload format");
queue_.setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) payloadType, g722RtpClockRate));
} else {
if (dynamic) {
DEBUG("AudioSymmetricRtpSession: Setting dynamic payload format");
queue_->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) payloadType, smplRate));
DEBUG("AudioRtpSession: Setting dynamic payload format");
queue_.setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) payloadType, smplRate));
} else {
DEBUG("AudioSymmetricRtpSession: Setting static payload format");
queue_->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) payloadType));
DEBUG("AudioRtpSession: Setting static payload format");
queue_.setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) payloadType));
}
}
}
if (type_ != Zrtp)
ca_->setRecordingSmplRate(getCodecSampleRate());
void AudioRtpSession::incrementTimestampForDTMF()
{
timestamp_ += timestampIncrement_;
}
void AudioRtpSession::sendDtmfEvent()
......@@ -131,26 +131,26 @@ void AudioRtpSession::sendDtmfEvent()
DEBUG("AudioRtpSession: Send RTP Dtmf (%d)", payload.event);
timestamp_ += (type_ == Zrtp) ? 160 : timestampIncrement_;
incrementTimestampForDTMF();
// discard equivalent size of audio
processDataEncode();
// change Payload type for DTMF payload
queue_->setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) getDtmfPayloadType(), 8000));
queue_.setPayloadFormat(ost::DynamicPayloadFormat((ost::PayloadType) getDtmfPayloadType(), 8000));
queue_->setMark(true);
queue_->sendImmediate(timestamp_, (const unsigned char *)(&payload), sizeof(payload));
queue_->setMark(false);
queue_.setMark(true);
queue_.sendImmediate(timestamp_, (const unsigned char *)(&payload), sizeof(payload));
queue_.setMark(false);
// get back the payload to audio
queue_->setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) getCodecPayloadType()));
queue_.setPayloadFormat(ost::StaticPayloadFormat((ost::StaticPayloadType) getCodecPayloadType()));
}
void AudioRtpSession::receiveSpeakerData()
{
const ost::AppDataUnit* adu = queue_->getData(queue_->getFirstTimestamp());
const ost::AppDataUnit* adu = queue_.getData(queue_.getFirstTimestamp());
if (!adu)
return;
......@@ -166,23 +166,19 @@ void AudioRtpSession::receiveSpeakerData()
}
void AudioRtpSession::sendMicData()
{
int compSize = processDataEncode();
// if no data return
if (!compSize)
if (compSize == 0)
return;
// Increment timestamp for outgoing packet
timestamp_ += timestampIncrement_;
if (type_ == Zrtp)
queue_->putData(timestamp_, getMicDataEncoded(), compSize);
// putData put the data on RTP queue, sendImmediate bypass this queue
queue_->sendImmediate(timestamp_, getMicDataEncoded(), compSize);
// putData puts the data on RTP queue, sendImmediate bypass this queue
queue_.sendImmediate(timestamp_, getMicDataEncoded(), compSize);
}
......@@ -190,28 +186,28 @@ void AudioRtpSession::setSessionTimeouts()
{
DEBUG("AudioRtpSession: Set session scheduling timeout (%d) and expireTimeout (%d)", sfl::schedulingTimeout, sfl::expireTimeout);
queue_->setSchedulingTimeout(sfl::schedulingTimeout);
queue_->setExpireTimeout(sfl::expireTimeout);
queue_.setSchedulingTimeout(sfl::schedulingTimeout);
queue_.setExpireTimeout(sfl::expireTimeout);
}
void AudioRtpSession::setDestinationIpAddress()
{
// Store remote ip in case we would need to forget current destination
remote_ip_ = ost::InetHostAddress(ca_->getLocalSDP()->getRemoteIP().c_str());
remote_ip_ = ost::InetHostAddress(call_.getLocalSDP()->getRemoteIP().c_str());
if (!remote_ip_) {
WARN("AudioRtpSession: Target IP address (%s) is not correct!",
ca_->getLocalSDP()->getRemoteIP().data());
call_.getLocalSDP()->getRemoteIP().data());
return;
}
// Store remote port in case we would need to forget current destination
remote_port_ = (unsigned short) ca_->getLocalSDP()->getRemoteAudioPort();
remote_port_ = (unsigned short) call_.getLocalSDP()->getRemoteAudioPort();
DEBUG("AudioRtpSession: New remote address for session: %s:%d",
ca_->getLocalSDP()->getRemoteIP().data(), remote_port_);
call_.getLocalSDP()->getRemoteIP().data(), remote_port_);
if (!queue_->addDestination(remote_ip_, remote_port_)) {
if (!queue_.addDestination(remote_ip_, remote_port_)) {
WARN("AudioRtpSession: Can't add new destination to session!");
return;
}
......@@ -224,7 +220,7 @@ void AudioRtpSession::updateDestinationIpAddress()
// Destination address are stored in a list in ccrtp
// This method remove the current destination entry
if (!queue_->forgetDestination(remote_ip_, remote_port_, remote_port_ + 1))
if (!queue_.forgetDestination(remote_ip_, remote_port_, remote_port_ + 1))
DEBUG("AudioRtpSession: Did not remove previous destination");
// new destination is stored in call
......@@ -233,12 +229,12 @@ void AudioRtpSession::updateDestinationIpAddress()
}
int AudioRtpSession::startRtpThread(AudioCodec* audiocodec)
int AudioRtpSession::startRtpThread(AudioCodec &audiocodec)
{
if (isStarted_)
return 0;
DEBUG("AudioSymmetricRtpSession: Starting main thread");
DEBUG("AudioRtpSession: Starting main thread");
isStarted_ = true;
setSessionTimeouts();
......@@ -246,15 +242,8 @@ int AudioRtpSession::startRtpThread(AudioCodec* audiocodec)
initBuffers();
initNoiseSuppress();
queue_->enableStack();
int ret = thread_->start();
if (type_ == Zrtp)
return ret;
AudioSymmetricRtpSession *self = dynamic_cast<AudioSymmetricRtpSession*>(this);
assert(self);
return self->startSymmetricRtpThread();
queue_.enableStack();
return thread_.start();
}
......
......@@ -31,44 +31,35 @@
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef SFL_AUDIO_RTP_SESSION_H_
#define SFL_AUDIO_RTP_SESSION_H_
#ifndef AUDIO_RTP_SESSION_H_
#define AUDIO_RTP_SESSION_H_
#include "audio_rtp_record_handler.h"
#include <audio/codecs/audiocodec.h>
#include <ccrtp/rtp.h>
#include <ccrtp/formats.h>
#include "noncopyable.h"
class SIPCall;
namespace ost {
class Thread;
}
namespace sfl {
class AudioCodec;
// Possible kind of rtp session
typedef enum RtpMethod {
Symmetric,
Zrtp,
Sdes
} RtpMethod;
class AudioRtpSession : public AudioRtpRecordHandler {
public:
/**
* Constructor
* @param sipcall The pointer on the SIP call
*/
AudioRtpSession(SIPCall* sipcall, RtpMethod type, ost::RTPDataQueue *queue, ost::Thread *thread);
AudioRtpSession(SIPCall &sipcall, ost::RTPDataQueue &queue, ost::Thread &thread);
virtual ~AudioRtpSession();
RtpMethod getAudioRtpType() {
return type_;
}
void updateSessionMedia(AudioCodec *audioCodec);
void updateSessionMedia(AudioCodec &audioCodec);
int startRtpThread(AudioCodec*);
virtual int startRtpThread(AudioCodec&);
/**
* Used mostly when receiving a reinvite
......@@ -76,6 +67,11 @@ class AudioRtpSession : public AudioRtpRecordHandler {
void updateDestinationIpAddress();
protected:
/**
* Set the audio codec for this RTP session
*/
virtual void setSessionMedia(AudioCodec &codec) = 0;
bool onRTPPacketRecv(ost::IncomingRTPPkt&);
......@@ -90,19 +86,26 @@ class AudioRtpSession : public AudioRtpRecordHandler {
/**
* Send encoded data to peer
*/
void sendMicData();
SIPCall *ca_;
virtual void sendMicData();
RtpMethod type_;
SIPCall &call_;
private:
NON_COPYABLE(AudioRtpSession);
/**
* Timestamp for this session
*/
int timestamp_;
/**
* Set the audio codec for this RTP session
* Timestamp incrementation value based on codec period length (framesize)
* except for G722 which require a 8 kHz incrementation.
*/
void setSessionMedia(AudioCodec*);
int timestampIncrement_;
ost::RTPDataQueue &queue_;
bool isStarted_;
private:
NON_COPYABLE(AudioRtpSession);
/**
* Set RTP Sockets send/receive timeouts
......@@ -119,6 +122,11 @@ class AudioRtpSession : public AudioRtpRecordHandler {
*/
void receiveSpeakerData();
/**
* Increment timestamp for DTMF event
*/
virtual void incrementTimestampForDTMF();
// Main destination address for this rtp session.
// Stored in case or reINVITE, which may require to forget
// this destination and update a new one.
......@@ -129,26 +137,12 @@ class AudioRtpSession : public AudioRtpRecordHandler {
// this destination and update a new one
unsigned short remote_port_;
/**
* Timestamp for this session
*/
int timestamp_;
/**
* Timestamp incrementation value based on codec period length (framesize)
* except for G722 which require a 8 kHz incrementation.
*/
int timestampIncrement_;
/**
* Timestamp reset frequency specified in number of packet sent
*/
short timestampCount_;
bool isStarted_;
ost::RTPDataQueue *queue_;
ost::Thread *thread_;
ost::Thread &thread_;
};
}
......
......@@ -27,10 +27,9 @@
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef __AUDIO_SRTP_SESSION_H__
#define __AUDIO_SRTP_SESSION_H__
#ifndef AUDIO_SRTP_SESSION_H_
#define AUDIO_SRTP_SESSION_H_
#include "audio_rtp_session.h"
#include "audio_symmetric_rtp_session.h"
#include "sip/sdes_negotiator.h"
#include "noncopyable.h"
......@@ -73,9 +72,7 @@ class AudioSrtpSession : public AudioSymmetricRtpSession {
/**
* Constructor for this rtp session
*/
AudioSrtpSession(SIPCall * sipcall);
~AudioSrtpSession();
AudioSrtpSession(SIPCall &call);
/**