OPAL  Version 3.10.4
rtpep.h
Go to the documentation of this file.
1 /*
2  * Endpoint abstraction
3  *
4  * Open Phone Abstraction Library (OPAL)
5  *
6  * Copyright (C) 2007 Post Increment
7  *
8  * The contents of this file are subject to the Mozilla Public License
9  * Version 1.0 (the "License"); you may not use this file except in
10  * compliance with the License. You may obtain a copy of the License at
11  * http://www.mozilla.org/MPL/
12  *
13  * Software distributed under the License is distributed on an "AS IS"
14  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15  * the License for the specific language governing rights and limitations
16  * under the License.
17  *
18  * The Original Code is Open Phone Abstraction Library.
19  *
20  * The Initial Developer of the Original Code is Post Increment
21  *
22  * Contributor(s): ______________________________________.
23  *
24  * $Revision: 25108 $
25  * $Author: rjongbloed $
26  * $Date: 2011-02-12 20:32:21 -0600 (Sat, 12 Feb 2011) $
27  */
28 
29 #ifndef OPAL_OPAL_RTPEP_H
30 #define OPAL_OPAL_RTPEP_H
31 
32 #ifdef P_USE_PRAGMA
33 #pragma interface
34 #endif
35 
36 #include <opal/buildopts.h>
37 
38 #include <opal/endpoint.h>
39 
40 
45 {
46  PCLASSINFO(OpalRTPEndPoint, OpalEndPoint);
47 
54  const PCaselessString & prefix,
55  unsigned attributes
56  );
57 
60  ~OpalRTPEndPoint();
62 
74  virtual OpalMediaFormatList GetMediaFormats() const;
75 
81  virtual void OnClosedMediaStream(
82  const OpalMediaStream & stream
83  );
85 
105  virtual PBoolean IsRTPNATEnabled(
106  OpalConnection & connection,
107  const PIPSocket::Address & localAddr,
108  const PIPSocket::Address & peerAddr,
109  const PIPSocket::Address & signalAddr,
110  PBoolean incoming
111  );
112 
113 #ifdef OPAL_ZRTP
114  virtual bool GetZRTPEnabled() const;
115 #endif
116 
129  virtual bool OnLocalRTP(
130  OpalConnection & connection1,
131  OpalConnection & connection2,
132  unsigned sessionID,
133  bool opened
134  ) const;
135 
136  // Check for local RTP connection. Internal function.
137  bool CheckForLocalRTP(const OpalRTPMediaStream & stream);
138 
139  // Check for local RTP connection. Internal function.
140  void CheckEndLocalRTP(OpalConnection & connection, RTP_UDP * rtp);
141 
142  void SetConnectionByRtpLocalPort(RTP_Session * rtp, OpalConnection * connection);
144 
145  protected:
146 #ifdef OPAL_ZRTP
147  bool zrtpEnabled;
148 #endif
149 
150  struct LocalRtpInfo {
151  LocalRtpInfo(OpalConnection & connection) : m_connection(connection), m_previousResult(-1) { }
152 
155  };
156  typedef std::map<WORD, LocalRtpInfo> LocalRtpInfoMap;
158 };
159 
160 
161 #endif // OPAL_OPAL_RTPEP_H