40
40
#include <libzrtpcpp/ZrtpUserCallback.h>
42
42
#include "audio_rtp_session.h"
43
#include <cc++/numbers.h> // OST::Time
43
// #include <commoncpp/numbers.h> // OST::Time
49
class ZrtpZidException: public std::runtime_error {
50
class ZrtpZidException : public std::runtime_error {
51
52
ZrtpZidException(const std::string& str = "") :
52
53
std::runtime_error("ZRTP ZID initialization failed." + str) {}
55
// class AudioZrtpSession : public ost::TimerPort, public ost::SymmetricZRTPSession, public AudioRtpRecordHandler
56
class AudioZrtpSession : public AudioRtpSession, protected ost::Thread, public ost::TRTPSessionBase<ost::SymmetricRTPChannel, ost::SymmetricRTPChannel, ost::ZrtpQueue> {
56
class AudioZrtpSession :
57
public AudioRtpSession, protected ost::Thread,
58
public ost::TRTPSessionBase<ost::SymmetricRTPChannel, ost::SymmetricRTPChannel, ost::ZrtpQueue> {
58
AudioZrtpSession(SIPCall * sipcall, const std::string& zidFilename);
60
AudioZrtpSession(SIPCall &call, const std::string& zidFilename);
59
61
~AudioZrtpSession();
63
63
// Thread associated method
64
64
virtual void run();
66
virtual bool onRTPPacketRecv(ost::IncomingRTPPkt& pkt) {
66
virtual bool onRTPPacketRecv(ost::IncomingRTPPkt &pkt) {
67
67
return AudioRtpSession::onRTPPacketRecv(pkt);
71
72
void initializeZid();
72
73
std::string zidFilename_;
74
void incrementTimestampForDTMF();
75
void setSessionMedia(AudioCodec &codec);