Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

h323caps.h

Go to the documentation of this file.
00001 /*
00002  * h323caps.h
00003  *
00004  * H.323 protocol handler
00005  *
00006  * Open H323 Library
00007  *
00008  * Copyright (c) 1998-2000 Equivalence Pty. Ltd.
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  * The Original Code is Open H323 Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Portions of this code were written with the assisance of funding from
00025  * Vovida Networks, Inc. http://www.vovida.com.
00026  *
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Log: h323caps.h,v $
00030  * Revision 1.47  2004/08/24 14:23:09  csoutheren
00031  * Fixed problem with plugin codecs using capability compare functions
00032  *
00033  * Revision 1.46  2004/06/30 12:31:09  rjongbloed
00034  * Rewrite of plug in system to use single global variable for all factories to avoid all sorts
00035  *   of issues with startup orders and Windows DLL multiple instances.
00036  *
00037  * Revision 1.45  2004/06/08 01:20:28  csoutheren
00038  * Provide backwards compatibility for applications using old capability API
00039  *
00040  * Revision 1.44  2004/06/01 05:47:58  csoutheren
00041  * Changed capability table to use abstract factory routines rather than internal linked list
00042  *
00043  * Revision 1.43  2004/05/13 12:49:32  rjongbloed
00044  * Fixed usage of the compare function in non-standard capabilities.
00045  *
00046  * Revision 1.42  2004/04/03 10:38:24  csoutheren
00047  * Added in initial cut at codec plugin code. Branches are for wimps :)
00048  *
00049  * Revision 1.41.2.1  2004/03/31 11:11:58  csoutheren
00050  * Initial public release of plugin codec code
00051  *
00052  * Revision 1.41  2004/03/02 11:48:14  rjongbloed
00053  * Fixed correct capability table matching when FindCapability with a mode change,
00054  *   uses different enum so needs translation table.
00055  *
00056  * Revision 1.40  2003/10/27 06:03:39  csoutheren
00057  * Added support for QoS
00058  *   Thanks to Henry Harrison of AliceStreet
00059  *
00060  * Revision 1.39  2003/06/06 02:13:10  rjongbloed
00061  * Changed non-standard capability semantics so can use C style strings as
00062  *   the embedded data block (ie automatically call strlen)
00063  *
00064  * Revision 1.38  2003/04/28 07:00:00  robertj
00065  * Fixed problem with compiler(s) not correctly initialising static globals
00066  *
00067  * Revision 1.37  2003/04/27 23:49:21  craigs
00068  * Fixed some comments and made list of registered codecs
00069  * available outside h323caps.cxx
00070  *
00071  * Revision 1.36  2002/11/09 04:24:01  robertj
00072  * Fixed minor documentation errors.
00073  *
00074  * Revision 1.35  2002/09/16 01:14:15  robertj
00075  * Added #define so can select if #pragma interface/implementation is used on
00076  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00077  *
00078  * Revision 1.34  2002/09/03 06:19:36  robertj
00079  * Normalised the multi-include header prevention ifdef/define symbol.
00080  *
00081  * Revision 1.33  2002/08/05 10:03:47  robertj
00082  * Cosmetic changes to normalise the usage of pragma interface/implementation.
00083  *
00084  * Revision 1.32  2002/05/29 03:55:17  robertj
00085  * Added protocol version number checking infrastructure, primarily to improve
00086  *   interoperability with stacks that are unforgiving of new features.
00087  *
00088  * Revision 1.31  2002/05/10 05:44:50  robertj
00089  * Added the max bit rate field to the data channel capability class.
00090  *
00091  * Revision 1.30  2002/01/22 06:25:02  robertj
00092  * Moved payload type to ancestor so any capability can adjust it on logical channel.
00093  *
00094  * Revision 1.29  2002/01/17 07:04:57  robertj
00095  * Added support for RFC2833 embedded DTMF in the RTP stream.
00096  *
00097  * Revision 1.28  2002/01/16 05:37:41  robertj
00098  * Added missing mode change functions on non standard capabilities.
00099  *
00100  * Revision 1.27  2002/01/09 00:21:36  robertj
00101  * Changes to support outgoing H.245 RequstModeChange.
00102  *
00103  * Revision 1.26  2001/12/22 01:44:05  robertj
00104  * Added more support for H.245 RequestMode operation.
00105  *
00106  * Revision 1.25  2001/10/24 01:20:34  robertj
00107  * Added code to help with static linking of H323Capability names database.
00108  *
00109  * Revision 1.24  2001/09/21 02:48:51  robertj
00110  * Added default implementation for PDU encode/decode for codecs
00111  *   that have simple integer as frames per packet.
00112  *
00113  * Revision 1.23  2001/09/11 10:21:40  robertj
00114  * Added direction field to capabilities, thanks Nick Hoath.
00115  *
00116  * Revision 1.22  2001/07/19 09:50:40  robertj
00117  * Added code for default session ID on data channel being three.
00118  *
00119  * Revision 1.21  2001/07/17 04:44:29  robertj
00120  * Partial implementation of T.120 and T.38 logical channels.
00121  *
00122  * Revision 1.20  2001/05/21 07:20:47  robertj
00123  * Removed redundent class name in declaration.
00124  *
00125  * Revision 1.19  2001/05/14 05:56:26  robertj
00126  * Added H323 capability registration system so can add capabilities by
00127  *   string name instead of having to instantiate explicit classes.
00128  *
00129  * Revision 1.18  2001/05/02 16:22:21  rogerh
00130  * Add IsAllow() for a single capability to check if it is in the
00131  * capabilities set. This fixes the bug where OpenH323 would accept
00132  * incoming H261 video even when told not to accept it.
00133  *
00134  * Revision 1.17  2001/03/16 23:00:21  robertj
00135  * Improved validation of codec selection against capability set, thanks Chris Purvis.
00136  *
00137  * Revision 1.16  2001/02/09 05:16:24  robertj
00138  * Added #pragma interface for GNU C++.
00139  *
00140  * Revision 1.15  2001/01/25 07:27:14  robertj
00141  * Major changes to add more flexible OpalMediaFormat class to normalise
00142  *   all information about media types, especially codecs.
00143  *
00144  * Revision 1.14  2001/01/09 23:05:22  robertj
00145  * Fixed inability to have 2 non standard codecs in capability table.
00146  *
00147  * Revision 1.13  2000/10/16 08:49:30  robertj
00148  * Added single function to add all UserInput capability types.
00149  *
00150  * Revision 1.12  2000/08/23 14:23:11  craigs
00151  * Added prototype support for Microsoft GSM codec
00152  *
00153  * Revision 1.11  2000/07/13 12:25:47  robertj
00154  * Fixed problems with fast start frames per packet adjustment.
00155  *
00156  * Revision 1.10  2000/07/10 16:01:50  robertj
00157  * Started fixing capability set merging, still more to do.
00158  *
00159  * Revision 1.9  2000/07/04 01:16:49  robertj
00160  * Added check for capability allowed in "combinations" set, still needs more done yet.
00161  *
00162  * Revision 1.8  2000/06/03 03:16:47  robertj
00163  * Fixed using the wrong capability table (should be connections) for some operations.
00164  *
00165  * Revision 1.7  2000/05/23 11:32:27  robertj
00166  * Rewrite of capability table to combine 2 structures into one and move functionality into that class
00167  *    allowing some normalisation of usage across several applications.
00168  * Changed H323Connection so gets a copy of capabilities instead of using endponts, allows adjustments
00169  *    to be done depending on the remote client application.
00170  *
00171  * Revision 1.6  2000/05/18 11:53:34  robertj
00172  * Changes to support doc++ documentation generation.
00173  *
00174  * Revision 1.5  2000/05/10 04:05:26  robertj
00175  * Changed capabilities so has a function to get name of codec, instead of relying on PrintOn.
00176  *
00177  * Revision 1.4  2000/05/02 04:32:24  robertj
00178  * Fixed copyright notice comment.
00179  *
00180  * Revision 1.3  2000/04/05 19:01:12  robertj
00181  * Added function so can change desired transmit packet size.
00182  *
00183  * Revision 1.2  2000/03/21 03:06:47  robertj
00184  * Changes to make RTP TX of exact numbers of frames in some codecs.
00185  *
00186  * Revision 1.1  1999/12/23 23:02:35  robertj
00187  * File reorganision for separating RTP from H.323 and creation of LID for VPB support.
00188  *
00189  */
00190 
00191 #ifndef __OPAL_H323CAPS_H
00192 #define __OPAL_H323CAPS_H
00193 
00194 #ifdef P_USE_PRAGMA
00195 #pragma interface
00196 #endif
00197 
00198 
00199 #include "codecs.h"
00200 #include "channels.h"
00201 
00202 
00203 /* The following classes have forward references to avoid including the VERY
00204    large header files for H225 and H245. If an application requires access
00205    to the protocol classes they can include them, but for simple usage their
00206    inclusion can be avoided.
00207  */
00208 class PASN_Choice;
00209 class H245_Capability;
00210 class H245_DataType;
00211 class H245_ModeElement;
00212 class H245_AudioCapability;
00213 class H245_AudioMode;
00214 class H245_VideoCapability;
00215 class H245_VideoMode;
00216 class H245_DataApplicationCapability;
00217 class H245_DataMode;
00218 class H245_DataProtocolCapability;
00219 class H245_H2250LogicalChannelParameters;
00220 class H245_TerminalCapabilitySet;
00221 class H245_NonStandardParameter;
00222 class H323Connection;
00223 class H323Capabilities;
00224 
00225 
00226 
00228 
00242 class H323Capability : public PObject
00243 {
00244   PCLASSINFO(H323Capability, PObject);
00245 
00246   public:
00251     H323Capability();
00253 
00259     Comparison Compare(const PObject & obj) const;
00260 
00263     void PrintOn(ostream & strm) const;
00265 
00268     enum MainTypes {
00270       e_Audio,
00272       e_Video,
00274       e_Data,
00276       e_UserInput,
00278       e_NumMainTypes
00279     };
00280 
00286     virtual MainTypes GetMainType() const = 0;
00287 
00291     virtual unsigned  GetSubType()  const = 0;
00292 
00295     virtual PString GetFormatName() const = 0;
00297 
00303     static H323Capability * Create(
00304       const PString & name    
00305     );
00306 
00310     static H323Capability * Create(
00311       H323EndPoint &,         
00312       const PString & name    
00313     )
00314     { return Create(name); }
00315 
00324     virtual unsigned GetDefaultSessionID() const;
00325 
00334     virtual void SetTxFramesInPacket(
00335       unsigned frames   
00336     );
00337 
00342     virtual unsigned GetTxFramesInPacket() const;
00343 
00348     virtual unsigned GetRxFramesInPacket() const;
00349 
00355     virtual H323Channel * CreateChannel(
00356       H323Connection & connection,    
00357       H323Channel::Directions dir,    
00358       unsigned sessionID,             
00359       const H245_H2250LogicalChannelParameters * param
00361     ) const = 0;
00362 
00365     virtual H323Codec * CreateCodec(
00366       H323Codec::Direction direction  
00367     ) const = 0;
00369 
00379     virtual BOOL OnSendingPDU(
00380       H245_Capability & pdu  
00381     ) const = 0;
00382 
00390     virtual BOOL OnSendingPDU(
00391       H245_DataType & pdu  
00392     ) const = 0;
00393 
00401     virtual BOOL OnSendingPDU(
00402       H245_ModeElement & pdu  
00403     ) const = 0;
00404 
00417     virtual BOOL OnReceivedPDU(
00418       const H245_Capability & pdu 
00419     );
00420 
00428     virtual BOOL OnReceivedPDU(
00429       const H245_DataType & pdu,  
00430       BOOL receiver               
00431     ) = 0;
00432 
00435     virtual BOOL IsNonStandardMatch(
00436       const H245_NonStandardParameter & param  
00437     ) const;
00438 
00446     virtual BOOL IsUsable(
00447       const H323Connection & connection
00448     ) const;
00450 
00453     enum CapabilityDirection {
00454       e_Unknown,
00455       e_Receive,
00456       e_Transmit,
00457       e_ReceiveAndTransmit,
00458       e_NoDirection,
00459       NumCapabilityDirections
00460     };
00461 
00464     CapabilityDirection GetCapabilityDirection() const { return capabilityDirection; }
00465 
00468     void SetCapabilityDirection(
00469       CapabilityDirection dir   
00470     ) { capabilityDirection = dir; }
00471 
00473     unsigned GetCapabilityNumber() const { return assignedCapabilityNumber; }
00474 
00476     void SetCapabilityNumber(unsigned num) { assignedCapabilityNumber = num; }
00477 
00479     RTP_DataFrame::PayloadTypes GetPayloadType() const { return rtpPayloadType; }
00480 
00482     virtual void AttachQoS(RTP_QOS *)
00483     {}
00485 
00486 #if PTRACING
00487     friend ostream & operator<<(ostream & o , MainTypes t);
00488     friend ostream & operator<<(ostream & o , CapabilityDirection d);
00489 #endif
00490 
00491   protected:
00492     unsigned assignedCapabilityNumber;  
00493     CapabilityDirection capabilityDirection;
00494     RTP_DataFrame::PayloadTypes rtpPayloadType;
00495 };
00496 
00497 
00498 
00508 class H323NonStandardCapabilityInfo
00509 {
00510   public:
00511     typedef PObject::Comparison (*CompareFuncType)(struct PluginCodec_H323NonStandardCodecData *);
00512 
00515     H323NonStandardCapabilityInfo(
00516       CompareFuncType compareFunc,
00517       const BYTE * dataBlock,         
00518       PINDEX dataSize                 
00519     );
00520 
00521     H323NonStandardCapabilityInfo(
00522       const BYTE * dataBlock,         
00523       PINDEX dataSize,                
00524       PINDEX comparisonOffset = 0,    
00525       PINDEX comparisonLength = P_MAX_INDEX    
00526     );
00527 
00530     H323NonStandardCapabilityInfo(
00531       const PString & oid,
00532       const BYTE * dataBlock,         
00533       PINDEX dataSize,                
00534       PINDEX comparisonOffset = 0,
00535       PINDEX comparisonLength = P_MAX_INDEX
00536     );
00537 
00540     H323NonStandardCapabilityInfo(
00541       BYTE country,                  
00542       BYTE extension,                
00543       WORD maufacturer,              
00544       const BYTE * dataBlock,        
00545       PINDEX dataSize,               
00546       PINDEX comparisonOffset = 0,   
00547       PINDEX comparisonLength = P_MAX_INDEX  
00548     );
00549 
00552     virtual ~H323NonStandardCapabilityInfo();
00553 
00558     virtual BOOL OnSendingPDU(
00559       PBYTEArray & data  
00560     ) const;
00561 
00566     virtual BOOL OnReceivedPDU(
00567       const PBYTEArray & data  
00568     );
00569 
00570   protected:
00571     BOOL OnSendingNonStandardPDU(
00572       PASN_Choice & pdu,
00573       unsigned nonStandardTag
00574     ) const;
00575     BOOL OnReceivedNonStandardPDU(
00576       const PASN_Choice & pdu,
00577       unsigned nonStandardTag
00578     );
00579 
00580     PObject::Comparison CompareParam(
00581       const H245_NonStandardParameter & param
00582     ) const;
00583     PObject::Comparison CompareInfo(
00584       const H323NonStandardCapabilityInfo & obj
00585     ) const;
00586     PObject::Comparison CompareData(
00587       const PBYTEArray & data  
00588     ) const;
00589 
00590     PString    oid;
00591     BYTE       t35CountryCode;
00592     BYTE       t35Extension;
00593     WORD       manufacturerCode;
00594     PBYTEArray nonStandardData;
00595     PINDEX     comparisonOffset;
00596     PINDEX     comparisonLength;
00597     CompareFuncType compareFunc;
00598 };
00599 
00600 
00607 class H323RealTimeCapability : public H323Capability
00608 {
00609   PCLASSINFO(H323RealTimeCapability, H323Capability);
00610 
00611   public:
00616     virtual H323Channel * CreateChannel(
00617       H323Connection & connection,    
00618       H323Channel::Directions dir,    
00619       unsigned sessionID,             
00620       const H245_H2250LogicalChannelParameters * param
00622     ) const;
00623 
00624     H323RealTimeCapability();
00625     H323RealTimeCapability(const H323RealTimeCapability &rtc);
00626     virtual ~H323RealTimeCapability();
00627     void AttachQoS(RTP_QOS * _rtpqos);
00628 
00629   protected:
00630     RTP_QOS * rtpqos;
00632 };
00633 
00634 
00641 class H323AudioCapability : public H323RealTimeCapability
00642 {
00643   PCLASSINFO(H323AudioCapability, H323RealTimeCapability);
00644 
00645   public:
00650     H323AudioCapability(
00651       unsigned rxPacketSize, 
00652       unsigned txPacketSize  
00653     );
00655 
00661     virtual MainTypes GetMainType() const;
00663 
00674     virtual unsigned GetDefaultSessionID() const;
00675 
00684     virtual void SetTxFramesInPacket(
00685       unsigned frames   
00686     );
00687 
00693     virtual unsigned GetTxFramesInPacket() const;
00694 
00700     virtual unsigned GetRxFramesInPacket() const;
00702 
00713     virtual BOOL H245_H2250LogicalChannelParameters * param
00361     ) const = 0;
00362 
00365     virtual H323Codec * CreateCodec(
00366       H323Codec::Direction direction  
00367     ) const = 0;
00369 
00379     virtual BOOL OnSendingPDU(
00380       H245_Capability & pdu  
00381     ) const = 0;
00382 
00390     virtual BOOL OnSendingPDU(
00391       H245_DataType & pdu  
00392     ) const = 0;
00393 
00401     virtual BOOL OnSendingPDU(
00402       H245_ModeElement & pdu  
00403     ) const = 0;
00404 
00417     virtual BOOL OnReceivedPDU(
00418       const H245_Capability & pdu 
00419     );
00420 
00428     virtual BOOL OnReceivedPDU(
00429       const H245_DataType & pdu,  
00430       BOOL receiver               
00431     ) = 0;
00432 
00435     virtual BOOL IsNonStandardMatch(
00436       const H245_NonStandardParameter & param  
00437     ) const;
00438 
00446     virtual BOOL IsUsable(
00447       const H323Connection & connection
00448     ) const;
00450 
00453     enum CapabilityDirection {
00454       e_Unknown,
00455       e_Receive,
00456       e_Transmit,
00457       e_ReceiveAndTransmit,
00458       e_NoDirection,
00459       NumCapabilityDirections
00460     };
00461 
00464     CapabilityDirection GetCapabilityDirection() const { return capabilityDirection; }
00465 
00468     void SetCapabilityDirection(
00469       CapabilityDirection dir   
00470     ) { capabilityDirection = dir; }
00471 
00473     unsigned GetCapabilityNumber() const { return assignedCapabilityNumber; }
00474 
00476     void SetCapabilityNumber(unsigned num) { assignedCapabilityNumber = num; }
00477 
00479     RTP_DataFrame::PayloadTypes GetPayloadType() const { return rtpPayloadType; }
00480 
00482     virtual void AttachQoS(RTP_QOS *)
00483     {}
00485 
00486 #if PTRACING
00487     friend ostream & operator<<(ostream & o , MainTypes t);
00488     friend ostream & operator<<(ostream & o , CapabilityDirection d);
00489 #endif
00490 
00491   protected:
00492     unsigned assignedCapabilityNumber;  
00493     CapabilityDirection capabilityDirection;
00494     RTP_DataFrame::PayloadTypes rtpPayloadType;
00495 };
00496 
00497 
00498 
00508 class H323NonStandardCapabilityInfo
00509 {
00510   public:
00511     typedef PObject::Comparison (*CompareFuncType)(struct PluginCodec_H323NonStandardCodecData *);
00512 
00515     H323NonStandardCapabilityInfo(
00516       CompareFuncType compareFunc,
00517       const BYTE * dataBlock,         
00518       PINDEX dataSize                 
00519     );
00520 
00521     H323NonStandardCapabilityInfo(
00522       const BYTE * dataBlock,         
00523       PINDEX dataSize,                
00524       PINDEX comparisonOffset = 0,    
00525       PINDEX comparisonLength = P_MAX_INDEX    
00526     );
00527 
00530     H323NonStandardCapabilityInfo(
00531       const PString & oid,
00532       const BYTE * dataBlock,         
00533       PINDEX dataSize,                
00534       PINDEX comparisonOffset = 0,
00535       PINDEX comparisonLength = P_MAX_INDEX
00536     );
00537 
00540     H323NonStandardCapabilityInfo(
00541       BYTE country,                  
00542       BYTE extension,                
00543       WORD maufacturer,              
00544       const BYTE * dataBlock,        
00545       PINDEX dataSize,               
00546       PINDEX comparisonOffset = 0,   
00547       PINDEX comparisonLength = P_MAX_INDEX  
00548     );
00549 
00552     virtual ~H323NonStandardCapabilityInfo();
00553 
00558     virtual BOOL OnSendingPDU(
00559       PBYTEArray & data  
00560     ) const;
00561 
00566     virtual BOOL OnReceivedPDU(
00567       const PBYTEArray & data  
00568     );
00569 
00570   protected:
00571     BOOL OnSendingNonStandardPDU(
00572       PASN_Choice & pdu,
00573       unsigned nonStandardTag
00574     ) const;
00575     BOOL OnReceivedNonStandardPDU(
00576       const PASN_Choice & pdu,
00577       unsigned nonStandardTag
00578     );
00579 
00580     PObject::Comparison CompareParam(
00581       const H245_NonStandardParameter & param
00582     ) const;
00583     PObject::Comparison CompareInfo(
00584       const H323NonStandardCapabilityInfo & obj
00585     ) const;
00586     PObject::Comparison CompareData(
00587       const PBYTEArray & data  
00588     ) const;
00589 
00590     PString    oid;
00591     BYTE       t35CountryCode;
00592     BYTE       t35Extension;
00593     WORD       manufacturerCode;
00594     PBYTEArray nonStandardData;
00595     PINDEX     comparisonOffset;
00596     PINDEX     comparisonLength;
00597     CompareFuncType compareFunc;
00598 };
00599 
00600 
00607 class H323RealTimeCapability : public H323Capability
00608 {
00609   PCLASSINFO(H323RealTimeCapability, H323Capability);
00610 
00611   public:
00616     virtual H323Channel * CreateChannel(
00617       H323Connection & connection,    
00618       H323Channel::Directions dir,    
00619       unsigned sessionID,             
00620       const H245_H2250LogicalChannelParameters * param
00622     ) const;
00623 
00624     H323RealTimeCapability();
00625     H323RealTimeCapability(const H323RealTimeCapability &rtc);
00626     virtual ~H323RealTimeCapability();
00627     void AttachQoS(RTP_QOS * _rtpqos);
00628 
00629   protected:
00630     RTP_QOS * rtpqos;
00632 };
00633 
00634 
00641 class H323AudioCapability : public H323RealTimeCapability
00642 {
00643   PCLASSINFO(H323AudioCapability, H323RealTimeCapability);
00644 
00645   public:
00650     H323AudioCapability(
00651       unsigned rxPacketSize, 
00652       unsigned txPacketSize  
00653     );
00655 
00661     virtual MainTypes GetMainType() const;
00663 
00674     virtual unsigned GetDefaultSessionID() const;
00675 
00684     virtual void SetTxFramesInPacket(
00685       unsigned frames   
00686     );
00687 
00693     virtual unsigned GetTxFramesInPacket() const;
00694 
00700     virtual unsigned GetRxFramesInPacket() const;
00702 
00713     virtual BOOL H245_H2250LogicalChannelParameters * param
00361     ) const = 0;
00362 
00365     virtual H323Codec * CreateCodec(
00366       H323Codec::Direction direction  
00367     ) const = 0;
00369 
00379     virtual BOOL OnSendingPDU(
00380       H245_Capability & pdu  
00381     ) const = 0;
00382 
00390     virtual BOOL OnSendingPDU(
00391       H245_DataType & pdu  
00392     ) const = 0;
00393 
00401     virtual BOOL OnSendingPDU(
00402       H245_ModeElement & pdu  
00403     ) const = 0;
00404 
00417     virtual BOOL OnReceivedPDU(
00418       const H245_Capability & pdu 
00419     );
00420 
00428     virtual BOOL OnReceivedPDU(
00429       const H245_DataType & pdu,  
00430       BOOL receiver               
00431     ) = 0;
00432 
00435     virtual BOOL IsNonStandardMatch(
00436       const H245_NonStandardParameter & param  
00437     ) const;
00438 
00446     virtual BOOL IsUsable(
00447       const H323Connection & connection
00448     ) const;
00450 
00453     enum CapabilityDirection {
00454       e_Unknown,
00455       e_Receive,
00456       e_Transmit,
00457       e_ReceiveAndTransmit,
00458       e_NoDirection,
00459       NumCapabilityDirections
00460     };
00461 
00464     CapabilityDirection GetCapabilityDirection() const { return capabilityDirection; }
00465 
00468     void SetCapabilityDirection(
00469       CapabilityDirection dir   
00470     ) { capabilityDirection = dir; }
00471 
00473     unsigned GetCapabilityNumber() const { return assignedCapabilityNumber; }
00474 
00476     void SetCapabilityNumber(unsigned num) { assignedCapabilityNumber = num; }
00477 
00479     RTP_DataFrame::PayloadTypes GetPayloadType() const { return rtpPayloadType; }
00480 
00482     virtual void AttachQoS(RTP_QOS *)
00483     {}
00485 
00486 #if PTRACING
00487     friend ostream & operator<<(ostream & o , MainTypes t);
00488     friend ostream & operator<<(ostream & o , CapabilityDirection d);
00489 #endif
00490 
00491   protected:
00492     unsigned assignedCapabilityNumber;  
00493     CapabilityDirection capabilityDirection;
00494     RTP_DataFrame::PayloadTypes rtpPayloadType;
00495 };
00496 
00497 
00498 
00508 class H323NonStandardCapabilityInfo
00509 {
00510   public:
00511     typedef PObject::Comparison (*CompareFuncType)(struct PluginCodec_H323NonStandardCodecData *);
00512 
00515     H323NonStandardCapabilityInfo(
00516       CompareFuncType compareFunc,
00517       const BYTE * dataBlock,         
00518       PINDEX dataSize                 
00519     );
00520 
00521     H323NonStandardCapabilityInfo(
00522       const BYTE * dataBlock,         
00523       PINDEX dataSize,                
00524       PINDEX comparisonOffset = 0,    
00525       PINDEX comparisonLength = P_MAX_INDEX    
00526     );
00527 
00530     H323NonStandardCapabilityInfo(
00531       const PString & oid,
00532       const BYTE * dataBlock,         
00533       PINDEX dataSize,                
00534       PINDEX comparisonOffset = 0,
00535       PINDEX comparisonLength = P_MAX_INDEX
00536     );
00537 
00540     H323NonStandardCapabilityInfo(
00541       BYTE country,                  
00542       BYTE extension,                
00543       WORD maufacturer,              
00544       const BYTE * dataBlock,        
00545       PINDEX dataSize,               
00546       PINDEX comparisonOffset = 0,   
00547       PINDEX comparisonLength = P_MAX_INDEX  
00548     );
00549 
00552     virtual ~H323NonStandardCapabilityInfo();
00553 
00558     virtual BOOL OnSendingPDU(
00559       PBYTEArray & data  
00560     ) const;
00561 
00566     virtual BOOL OnReceivedPDU(
00567       const PBYTEArray & data  
00568     );
00569 
00570   protected:
00571     BOOL OnSendingNonStandardPDU(
00572       PASN_Choice & pdu,
00573       unsigned nonStandardTag
00574     ) const;
00575     BOOL OnReceivedNonStandardPDU(
00576       const PASN_Choice & pdu,
00577       unsigned nonStandardTag
00578     );
00579 
00580     PObject::Comparison CompareParam(
00581       const H245_NonStandardParameter & param
00582     ) const;
00583     PObject::Comparison CompareInfo(
00584       const H323NonStandardCapabilityInfo & obj
00585     ) const;
00586     PObject::Comparison CompareData(
00587       const PBYTEArray & data  
00588     ) const;
00589 
00590     PString    oid;
00591     BYTE       t35CountryCode;
00592     BYTE       t35Extension;
00593     WORD       manufacturerCode;
00594     PBYTEArray nonStandardData;
00595     PINDEX     comparisonOffset;
00596     PINDEX     comparisonLength;
00597     CompareFuncType compareFunc;
00598 };
00599 
00600 
00607 class H323RealTimeCapability : public H323Capability
00608 {
00609   PCLASSINFO(H323RealTimeCapability, H323Capability);
00610 
00611   public:
00616     virtual H323Channel * CreateChannel(
00617       H323Connection & connection,    
00618       H323Channel::Directions dir,    
00619       unsigned sessionID,             
00620       const H245_H2250LogicalChannelParameters * param
00622     ) const;
00623 
00624     H323RealTimeCapability();
00625     H323RealTimeCapability(const H323RealTimeCapability &rtc);
00626     virtual ~H323RealTimeCapability();
00627     void AttachQoS(RTP_QOS * _rtpqos);
00628 
00629   protected:
00630     RTP_QOS * rtpqos;
00632 };
00633 
00634 
00641 class H323AudioCapability : public H323RealTimeCapability
00642 {
00643   PCLASSINFO(H323AudioCapability, H323RealTimeCapability);
00644 
00645   public:
00650     H323AudioCapability(
00651       unsigned rxPacketSize, 
00652       unsigned txPacketSize  
00653     );
00655 
00661     virtual MainTypes GetMainType() const;
00663 
00674     virtual unsigned GetDefaultSessionID() const;
00675 
00684     virtual void SetTxFramesInPacket(
00685       unsigned frames   
00686     );
00687 
00693     virtual unsigned GetTxFramesInPacket() const;
00694 
00700     virtual unsigned GetRxFramesInPacket() const;
00702 
00713     virtual BOOL H245_H2250LogicalChannelParameters * param
00361     ) const = 0;
00362 
00365     virtual H323Codec * CreateCodec(
00366       H323Codec::Direction direction  
00367     ) const = 0;
00369 
00379     virtual BOOL OnSendingPDU(
00380       H245_Capability & pdu  
00381     ) const = 0;
00382 
00390     virtual BOOL OnSendingPDU(
00391       H245_DataType & pdu  
00392     ) const = 0;
00393 
00401     virtual BOOL OnSendingPDU(
00402       H245_ModeElement & pdu  
00403     ) const = 0;
00404 
00417     virtual BOOL OnReceivedPDU(
00418       const H245_Capability & pdu 
00419     );
00420 
00428     virtual BOOL OnReceivedPDU(
00429       const H245_DataType & pdu,  
00430       BOOL receiver               
00431     ) = 0;
00432 
00435     virtual BOOL IsNonStandardMatch(
00436       const H245_NonStandardParameter & param  
00437     ) const;
00438 
00446     virtual BOOL IsUsable(
00447       const H323Connection & connection
00448     ) const;
00450 
00453     enum CapabilityDirection {
00454       e_Unknown,
00455       e_Receive,
00456       e_Transmit,
00457       e_ReceiveAndTransmit,
00458       e_NoDirection,
00459       NumCapabilityDirections
00460     };
00461 
00464     CapabilityDirection GetCapabilityDirection() const { return capabilityDirection; }
00465 
00468     void SetCapabilityDirection(
00469       CapabilityDirection dir   
00470     ) { capabilityDirection = dir; }
00471 
00473     unsigned GetCapabilityNumber() const { return assignedCapabilityNumber; }
00474 
00476     void SetCapabilityNumber(unsigned num) { assignedCapabilityNumber = num; }
00477 
00479     RTP_DataFrame::PayloadTypes GetPayloadType() const { return rtpPayloadType; }
00480 
00482     virtual void AttachQoS(RTP_QOS *)
00483     {}
00485 
00486 #if PTRACING
00487     friend ostream & operator<<(ostream & o , MainTypes t);
00488     friend ostream & operator<<(ostream & o , CapabilityDirection d);
00489 #endif
00490 
00491   protected:
00492     unsigned assignedCapabilityNumber;  
00493     CapabilityDirection capabilityDirection;
00494     RTP_DataFrame::PayloadTypes rtpPayloadType;
00495 };
00496 
00497 
00498 
00508 class H323NonStandardCapabilityInfo
00509 {
00510   public:
00511     typedef PObject::Comparison (*CompareFuncType)(struct PluginCodec_H323NonStandardCodecData *);
00512 
00515     H323NonStandardCapabilityInfo(
00516       CompareFuncType compareFunc,
00517       const BYTE * dataBlock,         
00518       PINDEX dataSize                 
00519     );
00520 
00521     H323NonStandardCapabilityInfo(
00522       const BYTE * dataBlock,         
00523       PINDEX dataSize,                
00524       PINDEX comparisonOffset = 0,    
00525       PINDEX comparisonLength = P_MAX_INDEX    
00526     );
00527 
00530     H323NonStandardCapabilityInfo(
00531       const PString & oid,
00532       const BYTE * dataBlock,         
00533       PINDEX dataSize,                
00534       PINDEX comparisonOffset = 0,
00535       PINDEX comparisonLength = P_MAX_INDEX
00536     );
00537 
00540     H323NonStandardCapabilityInfo(
00541       BYTE country,                  
00542       BYTE extension,                
00543       WORD maufacturer,              
00544       const BYTE * dataBlock,        
00545       PINDEX dataSize,               
00546       PINDEX comparisonOffset = 0,   
00547       PINDEX comparisonLength = P_MAX_INDEX  
00548     );
00549 
00552     virtual ~H323NonStandardCapabilityInfo();
00553 
00558     virtual BOOL OnSendingPDU(
00559       PBYTEArray & data  
00560     ) const;
00561 
00566     virtual BOOL OnReceivedPDU(
00567       const PBYTEArray & data  
00568     );
00569 
00570   protected:
00571     BOOL OnSendingNonStandardPDU(
00572       PASN_Choice & pdu,
00573       unsigned nonStandardTag
00574     ) const;
00575     BOOL OnReceivedNonStandardPDU(
00576       const PASN_Choice & pdu,
00577       unsigned nonStandardTag
00578     );
00579 
00580     PObject::Comparison CompareParam(
00581       const H245_NonStandardParameter & param
00582     ) const;
00583     PObject::Comparison CompareInfo(
00584       const H323NonStandardCapabilityInfo & obj
00585     ) const;
00586     PObject::Comparison CompareData(
00587       const PBYTEArray & data  
00588     ) const;
00589 
00590     PString    oid;
00591     BYTE       t35CountryCode;
00592     BYTE       t35Extension;
00593     WORD       manufacturerCode;
00594     PBYTEArray nonStandardData;
00595     PINDEX     comparisonOffset;
00596     PINDEX     comparisonLength;
00597     CompareFuncType compareFunc;
00598 };
00599 
00600 
00607 class H323RealTimeCapability : public H323Capability
00608 {
00609   PCLASSINFO(H323RealTimeCapability, H323Capability);
00610 
00611   public:
00616     virtual H323Channel * CreateChannel(
00617       H323Connection & connection,    
00618       H323Channel::Directions dir,    
00619       unsigned sessionID,             
00620       const H245_H2250LogicalChannelParameters * param
00622     ) const;
00623 
00624     H323RealTimeCapability();
00625     H323RealTimeCapability(const H323RealTimeCapability &rtc);
00626     virtual ~H323RealTimeCapability();
00627     void AttachQoS(RTP_QOS * _rtpqos);
00628 
00629   protected:
00630     RTP_QOS * rtpqos;
00632 };
00633 
00634 
00641 class H323AudioCapability : public H323RealTimeCapability
00642 {
00643   PCLASSINFO(H323AudioCapability, H323RealTimeCapability);
00644 
00645   public:
00650     H323AudioCapability(
00651       unsigned rxPacke