h323h224.h

Go to the documentation of this file.
00001 /*
00002  * h323h224.h
00003  *
00004  * H.323 H.224 logical channel establishment implementation for the 
00005  * OpenH323 Project.
00006  *
00007  * Copyright (c) 2006 Network for Educational Technology, ETH Zurich.
00008  * Written by Hannes Friederich.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * Contributor(s): ______________________________________.
00021  *
00022  * $Log: h323h224.h,v $
00023  * Revision 1.4  2007/04/19 06:17:20  csoutheren
00024  * Fixes for precompiled headers with gcc
00025  *
00026  * Revision 1.3  2006/08/10 05:10:30  csoutheren
00027  * Various H.323 stability patches merged in from DeimosPrePLuginBranch
00028  *
00029  * Revision 1.2.2.1  2006/08/09 12:49:20  csoutheren
00030  * Improve stablity under heavy H.323 load
00031  *
00032  * Revision 1.2  2006/04/30 09:25:08  csoutheren
00033  * Remove warning about missing newline
00034  *
00035  * Revision 1.1  2006/04/20 16:48:17  hfriederich
00036  * Initial version of H.224/H.281 implementation.
00037  *
00038  */
00039 
00040 #ifndef __OPAL_H323H224_H
00041 #define __OPAL_H323H224_H
00042 
00043 #ifdef P_USE_PRAGMA
00044 #pragma interface
00045 #endif
00046 
00047 #ifndef _PTLIB_H
00048 #include <ptlib.h>
00049 #endif
00050 
00051 #include <h323/h323caps.h>
00052 
00053 #include <h224/h224.h>
00054 #include <h224/h224handler.h>
00055 
00056 #define OPAL_H224_CAPABILITY_NAME "H.224"
00057 
00060 class H323_H224Capability : public H323DataCapability
00061 {
00062   PCLASSINFO(H323_H224Capability, H323DataCapability);
00063         
00064 public:
00065         
00066   H323_H224Capability();
00067   ~H323_H224Capability();
00068         
00069   Comparison Compare(const PObject & obj) const;
00070         
00071   virtual PObject * Clone() const;
00072         
00073   virtual unsigned GetSubType() const;
00074         
00075   virtual PString GetFormatName() const;
00076         
00077   virtual H323Channel * CreateChannel(H323Connection & connection,
00078                                                                           H323Channel::Directions dir,
00079                                                                           unsigned sesionID,
00080                                                                           const H245_H2250LogicalChannelParameters * param) const;
00081         
00082   virtual BOOL OnSendingPDU(H245_DataApplicationCapability & pdu) const;
00083   virtual BOOL OnSendingPDU(H245_DataMode & pdu) const;
00084   virtual BOOL OnReceivedPDU(const H245_DataApplicationCapability & pdu);
00085         
00086 };
00087 
00090 class H323_H224Channel : public H323Channel
00091 {
00092   PCLASSINFO(H323_H224Channel, H323Channel);
00093         
00094 public:
00095   H323_H224Channel(H323Connection & connection,
00096                                    const H323Capability & capability,
00097                                    Directions direction,
00098                                    RTP_UDP & session,
00099                                    unsigned sessionID);
00100   ~H323_H224Channel();
00101         
00102   virtual H323Channel::Directions GetDirection() const;
00103   virtual BOOL SetInitialBandwidth();
00104                 
00105   virtual BOOL Open();
00106   virtual BOOL Start();
00107   virtual void Close();
00108         
00109   virtual BOOL OnSendingPDU(H245_OpenLogicalChannel & openPDU) const;
00110   virtual void OnSendOpenAck(const H245_OpenLogicalChannel & openPDU, 
00111                                                          H245_OpenLogicalChannelAck & ack) const;
00112   virtual BOOL OnReceivedPDU(const H245_OpenLogicalChannel & pdu, unsigned & errorCode);
00113   virtual BOOL OnReceivedAckPDU(const H245_OpenLogicalChannelAck & pdu);
00114         
00115   virtual BOOL OnSendingPDU(H245_H2250LogicalChannelParameters & param) const;
00116   virtual void OnSendOpenAck(H245_H2250LogicalChannelAckParameters & param) const;
00117   virtual BOOL OnReceivedPDU(const H245_H2250LogicalChannelParameters & param,
00118                                                          unsigned & errorCode);
00119   virtual BOOL OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param);
00120         
00121   virtual BOOL SetDynamicRTPPayloadType(int newType);
00122   RTP_DataFrame::PayloadTypes GetDynamicRTPPayloadType() const { return rtpPayloadType; }
00123         
00124   virtual OpalMediaStream * GetMediaStream(BOOL deleted = FALSE) const;
00125         
00126   OpalH224Handler * GetHandler() const { return h224Handler; }
00127         
00128 protected:
00129                 
00130   virtual BOOL ExtractTransport(const H245_TransportAddress & pdu,
00131                                                                 BOOL isDataPort,
00132                                                                 unsigned & errorCode);
00133         
00134   unsigned sessionID;
00135   Directions direction;
00136   RTP_UDP & rtpSession;
00137   H323_RTP_Session & rtpCallbacks;
00138   OpalH224Handler *h224Handler;
00139   RTP_DataFrame::PayloadTypes rtpPayloadType;
00140   
00141 };
00142 
00143 #endif // __OPAL_H323H224_H
00144 

Generated on Fri Mar 7 06:33:31 2008 for OPAL by  doxygen 1.5.1