h4601.h

Go to the documentation of this file.
00001 // H4601.h:
00002 /*
00003  * Virteos H.460 Implementation for the OpenH323 Project.
00004  *
00005  * Virteos is a Trade Mark of ISVO (Asia) Pte Ltd.
00006  *
00007  * Copyright (c) 2004 ISVO (Asia) Pte Ltd. All Rights Reserved.
00008  *
00009  * The contents of this file are subject to the Mozilla Public License
00010  * Version 1.0 (the "License"); you may not use this file except in
00011  * compliance with the License. You may obtain a copy of the License at
00012  * http://www.mozilla.org/MPL/
00013  *
00014  * Software distributed under the License is distributed on an "AS IS"
00015  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00016  * the License for the specific language governing rights and limitations
00017  * under the License.
00018  *
00019  * The Original Code is derived from and used in conjunction with the 
00020  * OpenH323 Project (www.openh323.org/)
00021  *
00022  * The Initial Developer of the Original Code is ISVO (Asia) Pte Ltd.
00023  *
00024  *
00025  * Contributor(s): ______________________________________.
00026  *
00027 * $Log: h4601.h,v $
00028 * Revision 1.14  2006/10/10 13:56:41  csoutheren
00029 * Fix problem with H.460 compilation
00030 *
00031 * Revision 1.13  2006/07/01 05:31:03  shorne
00032 * added building featureset from generic data field
00033 *
00034 * Revision 1.12  2006/06/21 05:11:48  csoutheren
00035 * Fixed build with latest PWLib
00036 *
00037 * Revision 1.11  2006/06/15 15:37:20  shorne
00038 * More updates
00039 *
00040 * Revision 1.10  2006/06/08 13:26:16  shorne
00041 * Resyn Opal and OpenH323 versions
00042 *
00043 * Revision 1.9  2006/05/30 17:20:46  shorne
00044 * revert part of last change and alter function call
00045 *
00046 * Revision 1.8  2006/05/30 11:16:52  hfriederich
00047 * Fix compiler errors and warning for gcc4
00048 *
00049 * Revision 1.7  2006/05/27 03:28:22  shorne
00050 * Added UnAllocated Message Type Fix compile error on Linux.
00051 *
00052 * Revision 1.6  2006/05/16 11:24:11  shorne
00053 * Major upgrade added Factory Loader
00054 *
00055 * Revision 1.4  2006/02/26 13:01:31  shorne
00056 * Major H460 upgrade, still lots to do
00057 *
00058 * Revision 1.3  2006/01/31 03:56:02  csoutheren
00059 * Fixed one compile warning on MSVC 7
00060 *
00061 * Revision 1.2  2006/01/26 10:06:38  shorne
00062 * Added H460 Framework (first commit)
00063 *
00064 */
00065 
00066 #if !defined(_H460_H)
00067 #define _H460_H
00068 
00069 
00070 #ifdef P_USE_PRAGMA
00071 #pragma interface
00072 #endif
00073 
00074 #include "h225.h"
00075 #include "transports.h"
00076 #include <ptlib/pluginmgr.h>
00077 #include <ptclib/url.h>
00078 
00079 
00080 #ifdef _MSC_VER
00081 #pragma warning(disable:4100)
00082 #endif
00083 
00085 
00086 template<class H225>
00087 class H460 : public H225 {
00088 public:
00089         
00095     virtual void OnReceivedPDU(
00096       const H225 & /*id*/
00097           ) {};
00098 
00103     virtual BOOL OnSendingPDU(
00104       H225 & /*id*/
00105           ) const { return FALSE;};
00106         
00107 protected:
00108 
00109 };
00110 
00111 class OpalOID : public PASN_ObjectId
00112 {
00113 public:
00114 
00115         OpalOID();
00116 
00117         OpalOID(
00118       const char * str  
00119     );
00120 };
00121 
00122 
00123 
00125 
00135 class H460_FeatureID : public H460<H225_GenericIdentifier>
00136 {
00137 
00138   public:
00139 
00144         H460_FeatureID();
00145 
00148         H460_FeatureID(unsigned ID);
00149 
00152     H460_FeatureID(OpalOID ID);
00153 
00156         H460_FeatureID(PString ID);
00157 
00158         H460_FeatureID(H225_GenericIdentifier ID);
00160 
00165        operator unsigned () const 
00166                 { return ((PASN_Integer *)choice)->GetValue(); };
00167 
00170        operator OpalOID & () 
00171            { return (OpalOID &)*choice; };
00172 
00175        operator PString () const 
00176            { return ((H225_GloballyUniqueID *)choice)->AsString(); };
00177 
00178     
00179            PINLINE H460_FeatureID & operator=(unsigned ID);
00180 
00181            PINLINE H460_FeatureID & operator=(OpalOID ID);
00182 
00183            PINLINE H460_FeatureID & operator=(PString ID);
00184          
00187            unsigned GetFeatureType() const { return GetTag(); };
00188 
00189            PString IDString() const;
00191 
00194     PObject * Clone() const;
00195 
00196         PObject::Comparison Compare(const PObject & obj) const;
00198 
00199 };
00200 
00201 
00203 
00208 class H460_Feature;
00209 class H460_FeatureTable;
00210 class H460_FeatureContent : public H460<H225_Content>
00211 {
00212  
00213    public:
00214 
00219            H460_FeatureContent();
00220 
00224            H460_FeatureContent(PASN_OctetString & param);
00225 
00228            H460_FeatureContent(const PString & param);
00229 
00232            H460_FeatureContent(PASN_BMPString & param);
00233 
00236            H460_FeatureContent(BOOL param);
00237 
00240            H460_FeatureContent(unsigned param, unsigned len);
00241 
00244            H460_FeatureContent(const H460_FeatureID & id);
00245 
00248            H460_FeatureContent(const H225_AliasAddress & add);
00249 
00252        H460_FeatureContent(const PURL & add);
00253 
00256            H460_FeatureContent(const H323TransportAddress & add);
00257 
00260            H460_FeatureContent(const H460_FeatureTable & table);
00261 
00264            H460_FeatureContent(H460_Feature * data);
00265 
00268            H460_FeatureContent(const H225_Content & param);
00269 
00271 
00274         operator PASN_OctetString () const { return *((PASN_OctetString *)choice); };
00275         operator PString () const
00276         { 
00277                 switch (GetTag()) {
00278                         case e_text:  
00279                                 return ((PASN_IA5String &)*choice).GetValue();
00280                         case e_transport: 
00281                                 return H323TransportAddress(*(H225_TransportAddress *)choice);
00282                 }
00283                 
00284                 return PString();
00285         }; 
00286 
00287         operator PASN_BMPString () const { return *(PASN_BMPString *)choice; };
00288         operator BOOL () const { return *(PASN_Boolean *)choice; };
00289 
00290         operator unsigned () const 
00291         { 
00292                 switch (GetTag()) {
00293                         case e_number8:  
00294                         case e_number16:
00295                         case e_number32: 
00296                                 return *(PASN_Integer*)choice;
00297                         default: 
00298                                 return 0;
00299                  }
00300         }
00301                 
00302         operator H460_FeatureID () const { return *(H225_GenericIdentifier *)choice; };
00303         operator H225_AliasAddress () const { return *(H225_AliasAddress *)choice; };
00304         operator H323TransportAddress () const { return H323TransportAddress(*(H225_TransportAddress *)choice); };
00305         operator H460_FeatureTable *() { return (H460_FeatureTable *)choice; };
00306         operator H460_Feature *() { return (H460_Feature *)choice; };
00307 
00309 };
00310 
00312 
00317 class H460_Feature;
00318 class H460_FeatureParameter : public H460<H225_EnumeratedParameter>
00319 {
00320  
00321   public:
00322 
00327     H460_FeatureParameter();
00328 
00331     H460_FeatureParameter(unsigned Identifier);
00332 
00335         H460_FeatureParameter(const PString & Identifier);
00336 
00339         H460_FeatureParameter(const OpalOID & Identifier);
00340 
00343         H460_FeatureParameter(const H225_EnumeratedParameter & param);
00344 
00347         H460_FeatureParameter(const H460_FeatureID & ID);
00349 
00354         const H460_FeatureID ID() { return m_id; };
00355 
00358          void addContent(const H460_FeatureContent & con ) 
00359          { IncludeOptionalField(e_content);  m_content = con; };
00360 
00363          void replaceContent(const H460_FeatureContent & con )
00364                         { if (hasContent())  
00365                                         delete &m_content; 
00366                                 m_content = con; };
00367 
00370          BOOL hasContent() 
00371                         { return (GetTag() == e_content); };
00372 
00374 
00375 
00378         operator PASN_OctetString &();
00379         operator PString &();
00380         operator PASN_BMPString &();
00381         operator BOOL ();
00382         operator unsigned ();
00383         operator H460_FeatureID &();
00384         operator H225_AliasAddress &();
00385         operator H323TransportAddress &();
00386         operator H225_ArrayOf_EnumeratedParameter &();
00387         operator PURL &();
00388 
00389 
00390         H460_FeatureContent operator=(
00391         const PASN_OctetString & value
00392         );
00393 
00394         H460_FeatureContent operator=(
00395         const PString & value
00396         );
00397 
00398         H460_FeatureContent operator=(
00399         const PASN_BMPString & value
00400         );
00401 
00402         H460_FeatureContent operator=(
00403         const BOOL & value
00404         );
00405 
00406         H460_FeatureContent operator=(
00407         const unsigned & value
00408         );
00409 
00410         H460_FeatureContent operator=(
00411         const H460_FeatureID & value
00412         );
00413 
00414         H460_FeatureContent operator=(
00415         const H225_AliasAddress & value
00416         );
00417 
00418         H460_FeatureContent operator=(
00419         const H323TransportAddress & value
00420         );
00421 
00422         H460_FeatureContent operator=(
00423         const H460_FeatureTable & value
00424         );
00425 
00426         H460_FeatureContent operator=(
00427         H460_Feature * value
00428         );
00429 
00430 
00431 };
00432 
00434 
00439 class H460_FeatureTable : public H460<H225_ArrayOf_EnumeratedParameter>
00440 
00441 {
00442   public:
00443 
00448         H460_FeatureTable();
00449 
00452         H460_FeatureTable(const H225_ArrayOf_EnumeratedParameter & Xparams);
00454 
00457 
00462         H460_FeatureParameter & AddParameter(H460_FeatureID & id, H460_FeatureContent & con);
00463 
00467         void AddParameter(H225_EnumeratedParameter & Xparam);
00468 
00474         H460_FeatureParameter & GetParameter(PINDEX id);
00475 
00482     H460_FeatureParameter & GetParameter(const H460_FeatureID & id);
00483 
00488         PINDEX GetParameterIndex(const H460_FeatureID & id);
00489 
00494         BOOL HasParameter(const H460_FeatureID & id);
00495 
00500         void RemoveParameter(PINDEX id);
00501 
00506         void RemoveParameter(const H460_FeatureID & id);
00507 
00512     void ReplaceParameter(const H460_FeatureID & id, H460_FeatureContent & con);
00513 
00517         int ParameterCount() { return GetSize(); };
00518 
00526         BOOL ParameterIsUnique(const H460_FeatureID & id);
00527 
00530     inline H460_FeatureParameter & operator[](
00531       PINDEX id  
00532     ) const { return operator[](id); };
00533 
00536         H460_FeatureParameter & operator[](
00537       PINDEX id  
00538     );
00540 
00541 };
00542 
00544 
00548 class H323EndPoint;
00549 class H323Connection;
00550 class H460_Feature : public H460<H225_FeatureDescriptor>
00551 {
00552   public:
00555 
00558         H460_Feature();
00559 
00562     H460_Feature(unsigned Identifier);
00563 
00566         H460_Feature(PString Identifier);
00567 
00570         H460_Feature(OpalOID Indentifier);
00571 
00574         H460_Feature(const H225_FeatureDescriptor & descriptor);
00575 
00577 
00580 
00581         enum {
00582       FeatureNeeded = 1,      
00583       FeatureDesired,         
00584       FeatureSupported        
00585         } FeatureCategory;
00586 
00587 
00588         enum {
00589           FeatureBase      =4,        
00590           FeatureBaseAll   =5,        
00591           FeatureBaseRas   =6,        
00592           FeatureBaseSignal=7,        
00593       FeatureRas       =8,        
00594           FeatureSignal    =16        
00595         } FeatureInstance;
00596 
00598 
00603        operator unsigned () const { return (H460_FeatureID)m_id; };
00604 
00607  //      operator OpalOID () const { return (H460_FeatureID)m_id; };
00608 
00611        operator PString () const { return (H460_FeatureID)m_id; };
00612 
00615            H460_FeatureID GetFeatureID() { return m_id; };
00616 
00619        void SetFeatureID(const H460_FeatureID & id) { m_id = id; };
00620 
00623            PString GetFeatureIDAsString();
00624 
00627            unsigned GetFeatureType() { return ((H460_FeatureID)m_id).GetFeatureType(); };
00629 
00634         virtual H460_FeatureParameter & AddParameter(H460_FeatureID * id, H460_FeatureContent & con);
00635 
00638         virtual void AddParameter(H460_FeatureParameter * param);
00639 
00642         virtual void RemoveParameter(PINDEX id);
00643 
00646         virtual void ReplaceParameter(H460_FeatureID id, H460_FeatureContent & con);
00647 
00650     H460_FeatureParameter & GetFeatureParameter(PINDEX id);
00651 
00654     H460_FeatureParameter & GetFeatureParameter(const H460_FeatureID & id);
00655 
00658         BOOL HasFeatureParameter(const H460_FeatureID & id);
00659  
00662         BOOL Contains(const H460_FeatureID & id);
00663 
00666     H460_FeatureParameter & Value(const H460_FeatureID & id);
00667 
00670     inline H460_FeatureParameter & operator()(
00671       PINDEX id  //* Index position in the collection of the object.
00672     ) const { return operator()(id); };
00673 
00674         H460_FeatureParameter & operator()(
00675       PINDEX id  
00676     );
00677 
00680     inline H460_FeatureParameter & operator[](
00681       const H460_FeatureID & id  //< FeatureID of the object.
00682     ) const { return operator()(id); };
00683 
00684         H460_FeatureParameter & operator()(
00685       const H460_FeatureID & id  
00686     );
00687 
00690         int GetParameterCount() 
00691                 { return CurrentTable->ParameterCount(); };
00692 
00695         H460_FeatureTable & GetCurrentTable();
00696 
00699         void SetCurrentTable(H460_FeatureTable & table);
00700 
00703         void SetCurrentTable(H460_FeatureParameter & param);
00704 
00707         void SetDefaultTable();
00708 
00710 
00715         static PStringList GetFeatureNames(PPluginManager * pluginMgr = NULL);
00716 
00719         static PStringList GetFeatureFriendlyNames(const PString & feature, PPluginManager * pluginMgr = NULL);
00720 
00723     static H460_Feature * CreateFeature(const PString & featurename,        
00724                                                                                 int FeatureType = FeatureBase,          
00725                                                                                 PPluginManager * pluginMgr = NULL   
00726                                         );
00729     static PStringList GetFeatureName() { return PStringList("empty"); };
00730 
00733     static PStringList GetFeatureFriendlyName() { return PStringList("empty"); };
00734 
00738         static int GetPurpose() { return FeatureBase; };
00739 
00742         virtual void AttachEndPoint(H323EndPoint * _ep);
00743 
00746         virtual void AttachConnection(H323Connection * _con);
00747 
00749 
00752         /* These are the main calls which can be overridden to
00753                 allow the various derived features access to the GEF
00754                 interface.
00755         */
00756   // PDU calls (Used in the H225_RAS Class)
00757     virtual BOOL OnSendGatekeeperRequest(H225_FeatureDescriptor & pdu) { return FALSE; };
00758     virtual BOOL OnSendGatekeeperConfirm(H225_FeatureDescriptor & pdu) { return FALSE; };
00759     virtual BOOL OnSendGatekeeperReject(H225_FeatureDescriptor & pdu) { return FALSE; };
00760 
00761     virtual void OnReceiveGatekeeperRequest(const H225_FeatureDescriptor & pdu) {};
00762     virtual void OnReceiveGatekeeperConfirm(const H225_FeatureDescriptor & pdu) {};
00763     virtual void OnReceiveGatekeeperReject(const H225_FeatureDescriptor & pdu) {};
00764 
00765     virtual BOOL OnSendRegistrationRequest(H225_FeatureDescriptor & pdu) { return FALSE; };
00766     virtual BOOL OnSendRegistrationConfirm(H225_FeatureDescriptor & pdu) { return FALSE; };
00767     virtual BOOL OnSendRegistrationReject(H225_FeatureDescriptor & pdu) { return FALSE; };
00768 
00769     virtual void OnReceiveRegistrationRequest(const H225_FeatureDescriptor & pdu) {};
00770     virtual void OnReceiveRegistrationConfirm(const H225_FeatureDescriptor & pdu) {};
00771     virtual void OnReceiveRegistrationReject(const H225_FeatureDescriptor & pdu) {};
00772 
00773     virtual BOOL OnSendAdmissionRequest(H225_FeatureDescriptor & pdu) { return FALSE; };
00774     virtual BOOL OnSendAdmissionConfirm(H225_FeatureDescriptor & pdu) { return FALSE; };
00775     virtual BOOL OnSendAdmissionReject(H225_FeatureDescriptor & pdu) { return FALSE; };
00776 
00777     virtual void OnReceiveAdmissionRequest(const H225_FeatureDescriptor & pdu) {};
00778     virtual void OnReceiveAdmissionConfirm(const H225_FeatureDescriptor & pdu) {};
00779     virtual void OnReceiveAdmissionReject(const H225_FeatureDescriptor & pdu) {};
00780 
00781     virtual BOOL OnSendLocationRequest(H225_FeatureDescriptor & pdu) { return FALSE; };
00782     virtual BOOL OnSendLocationConfirm(H225_FeatureDescriptor & pdu) { return FALSE; };
00783     virtual BOOL OnSendLocationReject(H225_FeatureDescriptor & pdu) { return FALSE; };
00784 
00785     virtual void OnReceiveLocationRequest(const H225_FeatureDescriptor & pdu) {};
00786     virtual void OnReceiveLocationConfirm(const H225_FeatureDescriptor & pdu) {};
00787     virtual void OnReceiveLocationReject(const H225_FeatureDescriptor & pdu) {};
00788 
00789     virtual BOOL OnSendServiceControlIndication(H225_FeatureDescriptor & pdu) { return FALSE; };
00790     virtual BOOL OnSendServiceControlResponse(H225_FeatureDescriptor & pdu) { return FALSE; };
00791 
00792     virtual void OnReceiveServiceControlIndication(const H225_FeatureDescriptor & pdu) {};
00793     virtual void OnReceiveServiceControlResponse(const H225_FeatureDescriptor & pdu) {};
00794 
00795 
00796     virtual BOOL OnSendNonStandardMessage(H225_FeatureDescriptor & pdu) { return FALSE; };
00797     virtual void OnReceiveNonStandardMessage(const H225_FeatureDescriptor & pdu) {};
00798 
00799         virtual BOOL OnSendEndpoint(H225_FeatureDescriptor & pdu) { return FALSE; };
00800         virtual void OnReceiveEndpoint(const H225_FeatureDescriptor & pdu) {};
00802 
00805   // UUIE Calls (Used in the H323SignalPDU Class)
00806     virtual BOOL OnSendSetup_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00807     virtual void OnReceiveSetup_UUIE(const H225_FeatureDescriptor & pdu) {};
00808 
00809     virtual BOOL OnSendAlerting_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00810     virtual void OnReceiveAlerting_UUIE(const H225_FeatureDescriptor & pdu) {};
00811 
00812     virtual BOOL OnSendCallProceeding_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00813     virtual void OnReceiveCallProceeding_UUIE(const H225_FeatureDescriptor & pdu) {};
00814 
00815     virtual BOOL OnSendCallConnect_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00816     virtual void OnReceiveCallConnect_UUIE(const H225_FeatureDescriptor & pdu) {};
00817 
00818     virtual BOOL OnSendFacility_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00819     virtual void OnReceiveFacility_UUIE(const H225_FeatureDescriptor & pdu) {};
00820 
00821         virtual BOOL OnSendReleaseComplete_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00822         virtual void OnReceiveReleaseComplete_UUIE(const H225_FeatureDescriptor & pdu) {};
00823 
00824         virtual BOOL OnSendUnAllocatedPDU(H225_FeatureDescriptor & pdu) { return FALSE; };
00825         virtual void OnReceivedUnAllocatedPDU(const H225_FeatureDescriptor & pdu) {};
00826 
00828 
00831   // H501 Calls (To Be Implemented
00832                 // H501_MessageCommonInfo
00833                 // H501_AddressTemplate
00834                 // H501_ContactInformation
00835                 // H501_RouteInformation
00837 
00838   protected:
00839           H460_FeatureTable * CurrentTable;
00840           H323EndPoint * ep;
00841           H323Connection * con;
00842 };
00843 
00844 class H460_FeatureStd : public H460_Feature
00845 {
00846     PCLASSINFO(H460_FeatureStd, H460_Feature);
00847   public:
00848 
00851           H460_FeatureStd() {};
00852 
00855         H460_FeatureStd(unsigned Identifier);
00857 
00862         H460_FeatureParameter & Add(unsigned id, H460_FeatureContent & con);
00863 
00866         void Remove(unsigned id);
00867 
00870         void Replace(unsigned id, H460_FeatureContent & con);
00871 
00874         BOOL HasParameter(unsigned id);
00875 
00878         H460_FeatureParameter & GetParameter(unsigned id);
00880 
00883     inline H460_FeatureParameter & operator[] (
00884       unsigned id  
00885     ) { return GetParameter(id); };
00886 
00887 };
00888 
00889 class H460_FeatureNonStd : public H460_Feature
00890 {
00891     PCLASSINFO(H460_FeatureNonStd, H460_Feature);
00892   public:
00893 
00898         H460_FeatureNonStd(PString Identifier);
00900 
00905         H460_FeatureParameter & Add(PString id, H460_FeatureContent & con);
00906 
00909         void Remove(PString id);
00910 
00913         void Replace(PString id, H460_FeatureContent & con);
00914 
00917         BOOL HasParameter(PString id);
00918 
00920 
00923     inline H460_FeatureParameter & operator[](
00924       PString id  
00925     ) const { return operator[](id); };
00926 
00929         H460_FeatureParameter & operator[](
00930       PString id  
00931     );
00932 
00933 };
00934 
00935 class H460_FeatureOID : public H460_Feature
00936 {
00937     PCLASSINFO(H460_FeatureOID, H460_Feature);
00938   public:
00939 
00944         H460_FeatureOID(OpalOID Identifier);
00946 
00951         H460_FeatureParameter & Add(const PString & id, H460_FeatureContent & con);
00952 
00955         void Remove(const PString & id);
00956 
00959         void Replace(const PString & id, H460_FeatureContent & con);
00960 
00963         BOOL HasParameter(OpalOID id);
00964 
00967         BOOL Contains(const PString & id);
00968 
00971         H460_FeatureParameter & Value(const PString & id);
00972 
00974 
00977     inline H460_FeatureParameter & operator[](
00978       OpalOID id  
00979     ) const { return operator[](id); };
00980 
00983         H460_FeatureParameter & operator[](
00984       OpalOID id  
00985     );
00986 
00987   protected:
00988     PString GetBase();
00989 
00990 };
00992 // Dictionary/List of Features
00993 
00994 PDICTIONARY(H460_Features, H460_FeatureID , H460_Feature);
00995 
00997 // FeatureSet Main Calling Class
00998 class H323EndPoint;
00999 class H460_FeatureSet : public PObject
01000 {
01001     PCLASSINFO(H460_FeatureSet, PObject);
01002   public:
01003 
01006         H460_FeatureSet();
01007 
01010     H460_FeatureSet(H460_FeatureSet * _base);
01011 
01014         H460_FeatureSet(const H225_FeatureSet & fs);
01015 
01018         H460_FeatureSet(const H225_ArrayOf_GenericData & generic);
01019 
01022         H460_FeatureSet & DeriveNewFeatureSet();
01023 
01026         virtual BOOL LoadFeatureSet(int inst = H460_Feature::FeatureBase,
01027                                                   H323Connection * con = NULL);
01028 
01033         BOOL ProcessFirstPDU(const H225_FeatureSet & fs);
01034 
01037         virtual BOOL CreateFeatureSet(const H225_FeatureSet & fs);
01038 
01041         virtual BOOL LoadFeature(const PString & featid);
01042         
01045         BOOL AddFeature(H460_Feature * Nfeat);
01046 
01049         void RemoveFeature(H460_FeatureID id);
01050 
01053         H460_Feature * GetFeature(const H460_FeatureID & id);
01054 
01057         BOOL HasFeature(const H460_FeatureID & feat);
01058 
01062         void ReceiveFeature(unsigned id, const H225_FeatureSet & Message);
01063 
01067         BOOL SendFeature(unsigned id, H225_FeatureSet & Message);       
01068 
01071         virtual void AttachEndPoint(H323EndPoint * _ep);
01072 
01075         virtual void AttachBaseFeatureSet(H460_FeatureSet * _baseSet);
01076 
01079         H323EndPoint * GetEndPoint() { return ep; };
01080 
01081   protected:
01082 
01083    BOOL CreateFeatureSetPDU(H225_FeatureSet & fs, unsigned MessageID);
01084 
01085    void ReadFeatureSetPDU(const H225_FeatureSet & fs, unsigned MessageID);
01086 
01087    H460_FeatureID GetFeatureIDPDU(H225_FeatureDescriptor & pdu);
01088 
01089    BOOL CreateFeaturePDU(H460_Feature & Feat, H225_FeatureDescriptor & pdu, unsigned MessageID);
01090    void ReadFeaturePDU(H460_Feature & Feat, const H225_FeatureDescriptor & pdu, unsigned MessageID);
01091 
01092    PString PTracePDU(PINDEX id) const;
01093 
01094    H460_Features  Features;
01095    H323EndPoint * ep;
01096    H460_FeatureSet * baseSet;
01097 
01098 };
01099 
01101 
01102 template <class className> class H460PluginServiceDescriptor : public PDevicePluginServiceDescriptor
01103 {
01104   public:
01105     virtual PObject *   CreateInstance(int /*userData*/) const { return new className; }
01106     virtual PStringList GetDeviceNames(int /*userData*/) const { return className::GetFeatureFriendlyName(); }
01107     virtual bool  ValidateDeviceName(const PString & deviceName, int userData) const 
01108         { 
01109              PStringList devices = className::GetFeatureName(); 
01110                  if ((deviceName == devices[0]) &&
01111                          (className::GetPurpose() >= userData) && 
01112                          (className::GetPurpose() < userData*2)) {
01113 
01114                         return TRUE; 
01115                  } else
01116                             return FALSE;
01117         } 
01118 };
01119 
01120 #define H460_FEATURE(name)    \
01121 static H460PluginServiceDescriptor<H460_Feature##name> H460_Feature##name##_descriptor; \
01122 PCREATE_PLUGIN(H460_Feature##name##, H460_Feature, &H460_Feature##name##_descriptor); \
01123 
01124 
01125 #ifdef _MSC_VER
01126 #pragma warning(disable:4100)
01127 #endif
01128 
01129 #endif // !defined(_H460_H)
01130 

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