OPAL  Version 3.12.9
rtpconn.h
Go to the documentation of this file.
1 /*
2  * rtpconn.h
3  *
4  * Connection abstraction
5  *
6  * Open Phone Abstraction Library (OPAL)
7  *
8  * Copyright (C) 2007 Post Increment
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open Phone Abstraction Library.
21  *
22  * The Initial Developer of the Original Code is Post Increment
23  *
24  * Contributor(s): ______________________________________.
25  *
26  * $Revision: 29837 $
27  * $Author: rjongbloed $
28  * $Date: 2013-05-30 17:31:47 +1000 (Thu, 30 May 2013) $
29  */
30 
31 #ifndef OPAL_OPAL_RTPCONN_H
32 #define OPAL_OPAL_RTPCONN_H
33 
34 #ifdef P_USE_PRAGMA
35 #pragma interface
36 #endif
37 
38 #include <opal/buildopts.h>
39 
40 #include <opal/connection.h>
41 #include <opal/mediatype.h>
42 #include <opal/mediasession.h>
43 #include <rtp/rtp_session.h>
44 #include <ptlib/bitwise_enum.h>
45 
46 
47 class OpalRTPEndPoint;
48 
49 
54 {
55  PCLASSINFO(OpalRTPConnection, OpalConnection);
56  public:
62  OpalCall & call,
64  const PString & token,
65  unsigned options = 0,
66  OpalConnection::StringOptions * stringOptions = NULL
67  );
68 
72 
90  virtual void OnReleased();
92 
93 
109  const OpalMediaFormat & mediaFormat,
110  unsigned sessionID,
111  PBoolean isSource
112  );
113 
123  virtual bool GetMediaTransportAddresses(
124  const OpalMediaType & mediaType,
125  OpalTransportAddressArray & transports
126  ) const;
127 
141  virtual void AdjustMediaFormats(
142  bool local,
143  const OpalConnection * otherConnection,
144  OpalMediaFormatList & mediaFormats
145  ) const;
146 
155  virtual void OnPatchMediaStream(
156  PBoolean isSource,
157  OpalMediaPatch & patch
158  );
159 
165  virtual bool OnMediaCommand(
166  OpalMediaStream & stream,
167  const OpalMediaCommand & command
168  );
169 
170  virtual PBoolean SendUserInputTone(
171  char tone,
172  unsigned duration = 0
173  );
175 
176 
181  virtual unsigned GetNextSessionID(
182  const OpalMediaType & mediaType,
183  bool isSource
184  );
185 
186  P_DECLARE_BITWISE_ENUM(CreateMediaSessionsSecurity, 2, (e_NoMediaSessions, e_ClearMediaSession, e_SecureMediaSession));
187 
197  vector<bool> CreateAllMediaSessions(
198  CreateMediaSessionsSecurity security
199  );
200 
206  unsigned sessionId,
207  const OpalMediaType & mediaType,
208  const PString & sessionType = PString::Empty()
209  );
210 
215  unsigned sessionID
216  ) const;
217 
222  WORD port
223  ) const;
224 
234  unsigned sessionId,
235  const OpalMediaType & mediaType,
236  const PString & sessionType = PString::Empty()
237  );
238 
241  virtual void ReleaseMediaSession(
242  unsigned sessionID
243  );
244 
250  virtual bool ChangeSessionID(
251  unsigned fromSessionID,
252  unsigned toSessionID
253  );
254 
257  virtual void ReplaceMediaSession(
258  unsigned sessionId,
259  OpalMediaSession * mediaSession
260  );
261 
264  virtual bool SetSessionQoS(
265  OpalRTPSession * session
266  );
268 
288  virtual void DetermineRTPNAT(
289  const PIPSocket::Address & localAddr,
290  const PIPSocket::Address & peerAddr,
291  const PIPSocket::Address & signalAddr
292  );
294 
295  class SessionMap : public PSafeDictionary<PKey<unsigned>, OpalMediaSession>
296  {
297  public:
298  void MoveFrom(SessionMap & other);
299  };
300 
301  protected:
302  virtual bool GarbageCollection();
303  PDECLARE_NOTIFIER(OpalRFC2833Info, OpalRTPConnection, OnUserInputInlineRFC2833);
304 
305  void CheckForMediaBypass(OpalMediaSession & session);
306 
309 
311 #if OPAL_T38_CAPABILITY
312  OpalRFC2833Proto * m_ciscoNSEHandler;
313 #endif
314 
315 #if OPAL_VIDEO
317 #endif
318 
319  P_REMOVE_VIRTUAL(PBoolean,IsRTPNATEnabled(const PIPSocket::Address&,const PIPSocket::Address&,const PIPSocket::Address&,PBoolean),false);
320 };
321 
322 
323 #endif // OPAL_OPAL_RTPCONN_H