# 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  * $Revision: 21004 $
    00023  * $Author: rjongbloed $
    00024  * $Date: 2008-09-16 07:08:56 +0000 (Tue, 16 Sep 2008) $
    00025  */
    00026
    00027 #ifndef __OPAL_H323H224_H
    00028 #define __OPAL_H323H224_H
    00029
    00030 #ifdef P_USE_PRAGMA
    00031 #pragma interface
    00032 #endif
    00033
    00034 #ifndef _PTLIB_H
    00035 #include <ptlib.h>
    00036 #endif
    00037
    00038 #include <opal/buildopts.h>
    00039
    00040 #include <h323/h323caps.h>
    00041
    00042 #include <h224/h224.h>
    00043 #include <h224/h224handler.h>
    00044
    00045 #define OPAL_H224_CAPABILITY_NAME "H.224"
    00046
    00049 class H323_H224Capability : public H323DataCapability
    00050 {
    00051   PCLASSINFO(H323_H224Capability, H323DataCapability);
    00052
    00053 public:
    00054
    00055   H323_H224Capability();
    00056   ~H323_H224Capability();
    00057
    00058   Comparison Compare(const PObject & obj) const;
    00059
    00060   virtual PObject * Clone() const;
    00061
    00062   virtual unsigned GetSubType() const;
    00063
    00064   virtual PString GetFormatName() const;
    00065
    00066   virtual H323Channel * CreateChannel(H323Connection & connection,
    00067                                                                           H323Channel::Directions dir,
    00068                                                                           unsigned sesionID,
    00069                                                                           const H245_H2250LogicalChannelParameters * param) const;
    00070
    00071   virtual PBoolean OnSendingPDU(H245_DataApplicationCapability & pdu) const;
    00072   virtual PBoolean OnSendingPDU(H245_DataMode & pdu) const;
    00073   virtual PBoolean OnReceivedPDU(const H245_DataApplicationCapability & pdu);
    00074
    00075 };
    00076
    00079 class H323_H224Channel : public H323Channel
    00080 {
    00081   PCLASSINFO(H323_H224Channel, H323Channel);
    00082
    00083 public:
    00084   H323_H224Channel(H323Connection & connection,
    00085                                    const H323Capability & capability,
    00086                                    Directions direction,
    00087                                    RTP_UDP & session,
    00088                                    unsigned sessionID);
    00089   ~H323_H224Channel();
    00090
    00091   virtual H323Channel::Directions GetDirection() const;
    00092   virtual PBoolean SetInitialBandwidth();
    00093
    00094   virtual PBoolean Open();
    00095   virtual PBoolean Start();
    00096   virtual void Close();
    00097
    00098   virtual PBoolean OnSendingPDU(H245_OpenLogicalChannel & openPDU) const;
    00099   virtual void OnSendOpenAck(const H245_OpenLogicalChannel & openPDU,
    00100                                                          H245_OpenLogicalChannelAck & ack) const;
    00101   virtual PBoolean OnReceivedPDU(const H245_OpenLogicalChannel & pdu, unsigned & errorCode);
    00102   virtual PBoolean OnReceivedAckPDU(const H245_OpenLogicalChannelAck & pdu);
    00103
    00104   virtual PBoolean OnSendingPDU(H245_H2250LogicalChannelParameters & param) const;
    00105   virtual void OnSendOpenAck(H245_H2250LogicalChannelAckParameters & param) const;
    00106   virtual PBoolean OnReceivedPDU(const H245_H2250LogicalChannelParameters & param,
    00107                                                          unsigned & errorCode);
    00108   virtual PBoolean OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param);
    00109
    00110   virtual PBoolean SetDynamicRTPPayloadType(int newType);
    00111   RTP_DataFrame::PayloadTypes GetDynamicRTPPayloadType() const { return rtpPayloadType; }
    00112
    00113   //OpalH224Handler * GetHandler() const { return h224Handler; }
    00114
    00115 protected:
    00116
    00117   virtual PBoolean ExtractTransport(const H245_TransportAddress & pdu,
    00118                                                                 PBoolean isDataPort,
    00119                                                                 unsigned & errorCode);
    00120
    00121   unsigned sessionID;
    00122   Directions direction;
    00123   RTP_UDP & rtpSession;
    00124   H323_RTP_Session & rtpCallbacks;
    00125   //OpalH224Handler *h224Handler;
    00126   RTP_DataFrame::PayloadTypes rtpPayloadType;
    00127
    00128 };
    00129
    00130 #endif // __OPAL_H323H224_H
    00131