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.1  2006/06/22 11:07:22  shorne
00024  * Backport of FECC (H.224) from Opal
00025  *
00026  * Revision 1.2  2006/04/30 09:25:08  csoutheren
00027  * Remove warning about missing newline
00028  *
00029  * Revision 1.1  2006/04/20 16:48:17  hfriederich
00030  * Initial version of H.224/H.281 implementation.
00031  *
00032  */
00033 
00034 #ifndef __OPAL_H323H224_H
00035 #define __OPAL_H323H224_H
00036 
00037 #ifdef P_USE_PRAGMA
00038 #pragma interface
00039 #endif
00040 
00041 #include <ptlib.h>
00042 
00043 #include <h224.h>
00044 #include <h224handler.h>
00045 
00046 #define OPAL_H224_CAPABILITY_NAME "H.224"
00047 
00050 class H323_H224Capability : public H323DataCapability
00051 {
00052   PCLASSINFO(H323_H224Capability, H323DataCapability);
00053         
00054 public:
00055         
00056   H323_H224Capability();
00057   ~H323_H224Capability();
00058         
00059   Comparison Compare(const PObject & obj) const;
00060         
00061   virtual PObject * Clone() const;
00062         
00063   virtual unsigned GetSubType() const;
00064         
00065   virtual PString GetFormatName() const;
00066         
00067   virtual H323Channel * CreateChannel(H323Connection & connection,
00068                                                                           H323Channel::Directions dir,
00069                                                                           unsigned sesionID,
00070                                                                           const H245_H2250LogicalChannelParameters * param) const;
00071         
00072   virtual BOOL OnSendingPDU(H245_DataApplicationCapability & pdu) const;
00073   virtual BOOL OnSendingPDU(H245_DataMode & pdu) const;
00074   virtual BOOL OnReceivedPDU(const H245_DataApplicationCapability & pdu);
00075         
00076 };
00077 
00080 class H323_H224Channel : public H323Channel
00081 {
00082   PCLASSINFO(H323_H224Channel, H323Channel);
00083         
00084 public:
00085   H323_H224Channel(H323Connection & connection,
00086                                    const H323Capability & capability,
00087                                    Directions direction,
00088                                    RTP_UDP & session,
00089                                    unsigned sessionID);
00090   ~H323_H224Channel();
00091         
00092   virtual H323Channel::Directions GetDirection() const;
00093   virtual BOOL SetInitialBandwidth();
00094 
00095   virtual void Receive();
00096   virtual void Transmit();
00097                 
00098   virtual BOOL Open();
00099   virtual BOOL Start();
00100   virtual void Close();
00101         
00102   virtual BOOL OnSendingPDU(H245_OpenLogicalChannel & openPDU) const;
00103   virtual void OnSendOpenAck(const H245_OpenLogicalChannel & openPDU, 
00104                                                          H245_OpenLogicalChannelAck & ack) const;
00105   virtual BOOL OnReceivedPDU(const H245_OpenLogicalChannel & pdu, unsigned & errorCode);
00106   virtual BOOL OnReceivedAckPDU(const H245_OpenLogicalChannelAck & pdu);
00107         
00108   virtual BOOL OnSendingPDU(H245_H2250LogicalChannelParameters & param) const;
00109   virtual void OnSendOpenAck(H245_H2250LogicalChannelAckParameters & param) const;
00110   virtual BOOL OnReceivedPDU(const H245_H2250LogicalChannelParameters & param,
00111                                                          unsigned & errorCode);
00112   virtual BOOL OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param);
00113         
00114   virtual BOOL SetDynamicRTPPayloadType(int newType);
00115   RTP_DataFrame::PayloadTypes GetDynamicRTPPayloadType() const { return rtpPayloadType; }
00116         
00117 //  virtual OpalMediaStream * GetMediaStream() const;
00118         
00119   OpalH224Handler * GetHandler() const { return h224Handler; }
00120         
00121 protected:
00122                 
00123   virtual BOOL ExtractTransport(const H245_TransportAddress & pdu,
00124                                                                 BOOL isDataPort,
00125                                                                 unsigned & errorCode);
00126         
00127   unsigned sessionID;
00128   Directions direction;
00129   RTP_UDP & rtpSession;
00130   H323_RTP_Session & rtpCallbacks;
00131   OpalH224Handler *h224Handler;
00132   RTP_DataFrame::PayloadTypes rtpPayloadType;
00133   
00134 };
00135 
00136 #endif // __OPAL_H323H224_H
00137 

Generated on Wed Feb 6 09:02:38 2008 for OpenH323 by  doxygen 1.5.4