Skip to content
Snippets Groups Projects
Commit c5f362d3 authored by Alexandre Savard's avatar Alexandre Savard
Browse files
parents 52c25c4f 81217444
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "AudioRtpFactory.h" #include "AudioRtpFactory.h"
#include "AudioZrtpSession.h" #include "AudioZrtpSession.h"
#include "AudioSrtpSession.h" #include "AudioSrtpSession.h"
#include "AudioSymmetricRtpSession.h" #include "AudioRtpSession.h"
#include "manager.h" #include "manager.h"
#include "sip/sdp.h" #include "sip/sdp.h"
#include "sip/sipcall.h" #include "sip/sipcall.h"
...@@ -138,7 +138,7 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca) ...@@ -138,7 +138,7 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca)
} }
} else { } else {
_rtpSessionType = Symmetric; _rtpSessionType = Symmetric;
_rtpSession = new AudioSymmetricRtpSession (ca); _rtpSession = new AudioRtpSession (ca);
_debug ("AudioRtpFactory: Starting a symmetric unencrypted rtp session"); _debug ("AudioRtpFactory: Starting a symmetric unencrypted rtp session");
} }
} }
...@@ -166,8 +166,8 @@ void AudioRtpFactory::start (AudioCodec* audiocodec) ...@@ -166,8 +166,8 @@ void AudioRtpFactory::start (AudioCodec* audiocodec)
case Symmetric: case Symmetric:
_debug ("Starting symmetric rtp thread"); _debug ("Starting symmetric rtp thread");
if (static_cast<AudioSymmetricRtpSession *> (_rtpSession)->startRtpThread (audiocodec) != 0) { if (static_cast<AudioRtpSession *> (_rtpSession)->startRtpThread (audiocodec) != 0) {
throw AudioRtpFactoryException ("AudioRtpFactory: Error: Failed to start AudioSymmetricRtpSession thread"); throw AudioRtpFactoryException ("AudioRtpFactory: Error: Failed to start AudioRtpSession thread");
} }
break; break;
...@@ -232,7 +232,7 @@ int AudioRtpFactory::getSessionMedia() ...@@ -232,7 +232,7 @@ int AudioRtpFactory::getSessionMedia()
payloadType = static_cast<AudioSrtpSession *> (_rtpSession)->getCodecPayloadType(); payloadType = static_cast<AudioSrtpSession *> (_rtpSession)->getCodecPayloadType();
break; break;
case Symmetric: case Symmetric:
payloadType = static_cast<AudioSymmetricRtpSession *> (_rtpSession)->getCodecPayloadType(); payloadType = static_cast<AudioRtpSession *> (_rtpSession)->getCodecPayloadType();
break; break;
case Zrtp: case Zrtp:
payloadType = static_cast<AudioZrtpSession *> (_rtpSession)->getCodecPayloadType(); payloadType = static_cast<AudioZrtpSession *> (_rtpSession)->getCodecPayloadType();
...@@ -255,7 +255,7 @@ void AudioRtpFactory::updateSessionMedia (AudioCodec *audiocodec) ...@@ -255,7 +255,7 @@ void AudioRtpFactory::updateSessionMedia (AudioCodec *audiocodec)
static_cast<AudioSrtpSession *> (_rtpSession)->updateSessionMedia (audiocodec); static_cast<AudioSrtpSession *> (_rtpSession)->updateSessionMedia (audiocodec);
break; break;
case Symmetric: case Symmetric:
static_cast<AudioSymmetricRtpSession *> (_rtpSession)->updateSessionMedia (audiocodec); static_cast<AudioRtpSession *> (_rtpSession)->updateSessionMedia (audiocodec);
break; break;
case Zrtp: case Zrtp:
static_cast<AudioZrtpSession *> (_rtpSession)->updateSessionMedia (audiocodec); static_cast<AudioZrtpSession *> (_rtpSession)->updateSessionMedia (audiocodec);
...@@ -281,7 +281,7 @@ void AudioRtpFactory::updateDestinationIpAddress (void) ...@@ -281,7 +281,7 @@ void AudioRtpFactory::updateDestinationIpAddress (void)
break; break;
case Symmetric: case Symmetric:
static_cast<AudioSymmetricRtpSession *> (_rtpSession)->updateDestinationIpAddress(); static_cast<AudioRtpSession *> (_rtpSession)->updateDestinationIpAddress();
break; break;
case Zrtp: case Zrtp:
...@@ -290,15 +290,6 @@ void AudioRtpFactory::updateDestinationIpAddress (void) ...@@ -290,15 +290,6 @@ void AudioRtpFactory::updateDestinationIpAddress (void)
} }
} }
sfl::AudioSymmetricRtpSession * AudioRtpFactory::getAudioSymetricRtpSession()
{
if ( (_rtpSessionType == Symmetric) && (_rtpSessionType != 0)) {
return static_cast<AudioSymmetricRtpSession *> (_rtpSession);
} else {
throw AudioRtpFactoryException ("RTP: Error: _rtpSession is NULL in getAudioSymetricRtpSession");
}
}
sfl::AudioZrtpSession * AudioRtpFactory::getAudioZrtpSession() sfl::AudioZrtpSession * AudioRtpFactory::getAudioZrtpSession()
{ {
if ( (_rtpSessionType == Zrtp) && (_rtpSessionType != 0)) { if ( (_rtpSessionType == Zrtp) && (_rtpSessionType != 0)) {
...@@ -328,40 +319,12 @@ void AudioRtpFactory::setRemoteCryptoInfo (sfl::SdesNegotiator& nego) ...@@ -328,40 +319,12 @@ void AudioRtpFactory::setRemoteCryptoInfo (sfl::SdesNegotiator& nego)
void AudioRtpFactory::setDtmfPayloadType(unsigned int payloadType) void AudioRtpFactory::setDtmfPayloadType(unsigned int payloadType)
{ {
switch (_rtpSessionType) { static_cast<AudioRtpRecordHandler *> (_rtpSession)->setDtmfPayloadType(payloadType);
case Sdes:
static_cast<AudioSrtpSession *> (_rtpSession)->setDtmfPayloadType(payloadType);
break;
case Symmetric:
static_cast<AudioSymmetricRtpSession *> (_rtpSession)->setDtmfPayloadType(payloadType);
break;
case Zrtp:
static_cast<AudioZrtpSession *> (_rtpSession)->setDtmfPayloadType(payloadType);
break;
}
} }
void AudioRtpFactory::sendDtmfDigit (int digit) void AudioRtpFactory::sendDtmfDigit (int digit)
{ {
static_cast<AudioRtpRecordHandler*> (_rtpSession)->putDtmfEvent (digit);
switch (_rtpSessionType) {
case Sdes:
static_cast<AudioSrtpSession *> (_rtpSession)->putDtmfEvent (digit);
break;
case Symmetric:
static_cast<AudioSymmetricRtpSession *> (_rtpSession)->putDtmfEvent (digit);
break;
case Zrtp:
static_cast<AudioZrtpSession *> (_rtpSession)->putDtmfEvent (digit);
break;
}
} }
} }
......
...@@ -43,21 +43,11 @@ class SIPCall; ...@@ -43,21 +43,11 @@ class SIPCall;
class Account; class Account;
class SIPAccount; class SIPAccount;
/*
namespace sfl
{
class AudioZrtpSession;
class AudioSrtpSession;
class AudioSymmetricRtpSession;
}
*/
namespace sfl namespace sfl
{ {
class AudioZrtpSession; class AudioZrtpSession;
class AudioSrtpSession; class AudioSrtpSession;
class AudioSymmetricRtpSession;
class AudioCodec; class AudioCodec;
// Possible kind of rtp session // Possible kind of rtp session
...@@ -135,8 +125,6 @@ class AudioRtpFactory ...@@ -135,8 +125,6 @@ class AudioRtpFactory
return _rtpSession; return _rtpSession;
} }
AudioSymmetricRtpSession * getAudioSymetricRtpSession();
/** /**
* @param None * @param None
* @return The internal audio rtp session type * @return The internal audio rtp session type
......
/*
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
* Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef __SFL_AUDIO_SYMMETRIC_RTP_SESSION_H__
#define __SFL_AUDIO_SYMMETRIC_RTP_SESSION_H__
#include <cstddef>
using std::ptrdiff_t;
#include <ccrtp/rtp.h>
#include "AudioRtpSession.h"
namespace sfl
{
class AudioSymmetricRtpSession : public AudioRtpSession
{
public:
AudioSymmetricRtpSession (SIPCall * sipcall) : AudioRtpSession (sipcall) {
}
};
}
#endif // __AUDIO_SYMMETRIC_RTP_SESSION_H__
...@@ -14,7 +14,6 @@ noinst_HEADERS = \ ...@@ -14,7 +14,6 @@ noinst_HEADERS = \
AudioRtpRecordHandler.h \ AudioRtpRecordHandler.h \
AudioRtpFactory.h \ AudioRtpFactory.h \
AudioRtpSession.h \ AudioRtpSession.h \
AudioSymmetricRtpSession.h \
AudioZrtpSession.h \ AudioZrtpSession.h \
ZrtpSessionCallback.h \ ZrtpSessionCallback.h \
AudioSrtpSession.h AudioSrtpSession.h
......
test
cppunitresults.xml
im:testfile1.txt
im:testfile2.txt
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include "rtptest.h" #include "rtptest.h"
#include "audio/audiortp/AudioRtpSession.h" #include "audio/audiortp/AudioRtpSession.h"
#include "audio/audiortp/AudioSymmetricRtpSession.h"
#include <unistd.h> #include <unistd.h>
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
using namespace sfl; using namespace sfl;
class AudioSymmetricRtpSession;
class AudioRtpSession; class AudioRtpSession;
//class AudioRtpFactory; //class AudioRtpFactory;
class SIPVoIPLink; class SIPVoIPLink;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment