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

Generated on Mon Sep 15 11:49:05 2008 for OPAL by  doxygen 1.5.1