diff --git a/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp b/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp index 1e14cb20c5c4dd9561d14a331e8ed7c046111b13..aa60edf0bf942d5066a224b422b971a7dd78fc40 100644 --- a/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp +++ b/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp @@ -33,7 +33,7 @@ #include "AudioRtpFactory.h" #include "AudioZrtpSession.h" #include "AudioSrtpSession.h" -#include "AudioSymmetricRtpSession.h" +#include "AudioRtpSession.h" #include "manager.h" #include "sip/sdp.h" #include "sip/sipcall.h" @@ -138,7 +138,7 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca) } } else { _rtpSessionType = Symmetric; - _rtpSession = new AudioSymmetricRtpSession (ca); + _rtpSession = new AudioRtpSession (ca); _debug ("AudioRtpFactory: Starting a symmetric unencrypted rtp session"); } } @@ -166,8 +166,8 @@ void AudioRtpFactory::start (AudioCodec* audiocodec) case Symmetric: _debug ("Starting symmetric rtp thread"); - if (static_cast<AudioSymmetricRtpSession *> (_rtpSession)->startRtpThread (audiocodec) != 0) { - throw AudioRtpFactoryException ("AudioRtpFactory: Error: Failed to start AudioSymmetricRtpSession thread"); + if (static_cast<AudioRtpSession *> (_rtpSession)->startRtpThread (audiocodec) != 0) { + throw AudioRtpFactoryException ("AudioRtpFactory: Error: Failed to start AudioRtpSession thread"); } break; @@ -232,7 +232,7 @@ int AudioRtpFactory::getSessionMedia() payloadType = static_cast<AudioSrtpSession *> (_rtpSession)->getCodecPayloadType(); break; case Symmetric: - payloadType = static_cast<AudioSymmetricRtpSession *> (_rtpSession)->getCodecPayloadType(); + payloadType = static_cast<AudioRtpSession *> (_rtpSession)->getCodecPayloadType(); break; case Zrtp: payloadType = static_cast<AudioZrtpSession *> (_rtpSession)->getCodecPayloadType(); @@ -255,7 +255,7 @@ void AudioRtpFactory::updateSessionMedia (AudioCodec *audiocodec) static_cast<AudioSrtpSession *> (_rtpSession)->updateSessionMedia (audiocodec); break; case Symmetric: - static_cast<AudioSymmetricRtpSession *> (_rtpSession)->updateSessionMedia (audiocodec); + static_cast<AudioRtpSession *> (_rtpSession)->updateSessionMedia (audiocodec); break; case Zrtp: static_cast<AudioZrtpSession *> (_rtpSession)->updateSessionMedia (audiocodec); @@ -281,7 +281,7 @@ void AudioRtpFactory::updateDestinationIpAddress (void) break; case Symmetric: - static_cast<AudioSymmetricRtpSession *> (_rtpSession)->updateDestinationIpAddress(); + static_cast<AudioRtpSession *> (_rtpSession)->updateDestinationIpAddress(); break; case Zrtp: @@ -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() { if ( (_rtpSessionType == Zrtp) && (_rtpSessionType != 0)) { @@ -328,40 +319,12 @@ void AudioRtpFactory::setRemoteCryptoInfo (sfl::SdesNegotiator& nego) void AudioRtpFactory::setDtmfPayloadType(unsigned int payloadType) { - switch (_rtpSessionType) { - - 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; - } + static_cast<AudioRtpRecordHandler *> (_rtpSession)->setDtmfPayloadType(payloadType); } void AudioRtpFactory::sendDtmfDigit (int 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; - } - + static_cast<AudioRtpRecordHandler*> (_rtpSession)->putDtmfEvent (digit); } } diff --git a/sflphone-common/src/audio/audiortp/AudioRtpFactory.h b/sflphone-common/src/audio/audiortp/AudioRtpFactory.h index 28329d0d59f93ab5422ce8bb30e83a77a38ee93f..7412e0f837579948cabb6c69f195ebf16cc15b9b 100644 --- a/sflphone-common/src/audio/audiortp/AudioRtpFactory.h +++ b/sflphone-common/src/audio/audiortp/AudioRtpFactory.h @@ -43,21 +43,11 @@ class SIPCall; class Account; class SIPAccount; -/* -namespace sfl -{ -class AudioZrtpSession; -class AudioSrtpSession; -class AudioSymmetricRtpSession; -} -*/ - namespace sfl { class AudioZrtpSession; class AudioSrtpSession; -class AudioSymmetricRtpSession; class AudioCodec; // Possible kind of rtp session @@ -135,8 +125,6 @@ class AudioRtpFactory return _rtpSession; } - AudioSymmetricRtpSession * getAudioSymetricRtpSession(); - /** * @param None * @return The internal audio rtp session type diff --git a/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.h b/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.h deleted file mode 100644 index a03b77d27389152ee240c8d14dfff9fae91ab080..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/audiortp/AudioSymmetricRtpSession.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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__ diff --git a/sflphone-common/src/audio/audiortp/Makefile.am b/sflphone-common/src/audio/audiortp/Makefile.am index f75a5973ea2feff0ebab76bbd6e5d3fb3922262f..fd485065caa2cd157d1fce197e83faa612827ae9 100644 --- a/sflphone-common/src/audio/audiortp/Makefile.am +++ b/sflphone-common/src/audio/audiortp/Makefile.am @@ -14,7 +14,6 @@ noinst_HEADERS = \ AudioRtpRecordHandler.h \ AudioRtpFactory.h \ AudioRtpSession.h \ - AudioSymmetricRtpSession.h \ AudioZrtpSession.h \ ZrtpSessionCallback.h \ AudioSrtpSession.h diff --git a/sflphone-common/test/.gitignore b/sflphone-common/test/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e600a6bd4dee755048d3c02837aa0dd7ccfcdb7a --- /dev/null +++ b/sflphone-common/test/.gitignore @@ -0,0 +1,4 @@ +test +cppunitresults.xml +im:testfile1.txt +im:testfile2.txt diff --git a/sflphone-common/test/rtptest.cpp b/sflphone-common/test/rtptest.cpp index eab969bb18ed4ef0e85f68ae5043abbbf5e13ce3..56afefc3b8a899907b21dc64978312d00cb7596a 100644 --- a/sflphone-common/test/rtptest.cpp +++ b/sflphone-common/test/rtptest.cpp @@ -42,7 +42,6 @@ #include "rtptest.h" #include "audio/audiortp/AudioRtpSession.h" -#include "audio/audiortp/AudioSymmetricRtpSession.h" #include <unistd.h> diff --git a/sflphone-common/test/rtptest.h b/sflphone-common/test/rtptest.h index cfa9a14315c495753653dca50b1fda5eedf350d4..5fecd6120f2da7c265ea8d723aed6f436cb11cda 100644 --- a/sflphone-common/test/rtptest.h +++ b/sflphone-common/test/rtptest.h @@ -62,7 +62,6 @@ using namespace sfl; -class AudioSymmetricRtpSession; class AudioRtpSession; //class AudioRtpFactory; class SIPVoIPLink;