00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef OPAL_OPAL_RTPEP_H
00030 #define OPAL_OPAL_RTPEP_H
00031
00032 #ifdef P_USE_PRAGMA
00033 #pragma interface
00034 #endif
00035
00036 #include <opal/buildopts.h>
00037
00038 #include <opal/endpoint.h>
00039
00040
00044 class OpalRTPEndPoint : public OpalEndPoint
00045 {
00046 PCLASSINFO(OpalRTPEndPoint, OpalEndPoint);
00047
00052 OpalRTPEndPoint(
00053 OpalManager & manager,
00054 const PCaselessString & prefix,
00055 unsigned attributes
00056 );
00057
00060 ~OpalRTPEndPoint();
00062
00074 virtual OpalMediaFormatList GetMediaFormats() const;
00075
00081 virtual void OnClosedMediaStream(
00082 const OpalMediaStream & stream
00083 );
00085
00105 virtual PBoolean IsRTPNATEnabled(
00106 OpalConnection & connection,
00107 const PIPSocket::Address & localAddr,
00108 const PIPSocket::Address & peerAddr,
00109 const PIPSocket::Address & signalAddr,
00110 PBoolean incoming
00111 );
00112
00113 #ifdef OPAL_ZRTP
00114 virtual bool GetZRTPEnabled() const;
00115 #endif
00116
00129 virtual bool OnLocalRTP(
00130 OpalConnection & connection1,
00131 OpalConnection & connection2,
00132 unsigned sessionID,
00133 bool opened
00134 ) const;
00135
00136
00137 bool CheckForLocalRTP(const OpalRTPMediaStream & stream);
00138
00139
00140 void CheckEndLocalRTP(OpalConnection & connection, RTP_UDP * rtp);
00141
00142 void SetConnectionByRtpLocalPort(RTP_Session * rtp, OpalConnection * connection);
00144
00145 protected:
00146 #ifdef OPAL_ZRTP
00147 bool zrtpEnabled;
00148 #endif
00149
00150 struct LocalRtpInfo {
00151 LocalRtpInfo(OpalConnection & connection) : m_connection(connection), m_previousResult(-1) { }
00152
00153 OpalConnection & m_connection;
00154 int m_previousResult;
00155 };
00156 typedef std::map<WORD, LocalRtpInfo> LocalRtpInfoMap;
00157 LocalRtpInfoMap m_connectionsByRtpLocalPort;
00158 };
00159
00160
00161 #endif // OPAL_OPAL_RTPEP_H