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.9  2006/08/08 08:33:26  rjongbloed
00029 * Fixed GNU warning on what very much looks like incorrect code. Goes to
00030 *   prove you should not ignore warnings!
00031 *
00032 * Revision 1.8  2006/07/01 05:31:36  shorne
00033 * added building featureset from generic data field
00034 *
00035 * Revision 1.7  2006/06/21 04:54:14  csoutheren
00036 * Fixed build with latest PWLib
00037 *
00038 * Revision 1.6  2006/06/15 15:34:25  shorne
00039 * More updates
00040 *
00041 * Revision 1.5  2006/06/08 13:27:18  shorne
00042 * Resnc Opal and OpenH323 versions
00043 *
00044 * Revision 1.4  2006/06/07 23:33:26  csoutheren
00045 * Removed warning on gcc 4.1.1
00046 *
00047 * Revision 1.3  2006/05/30 18:15:51  hfriederich
00048 * Reverting part of last change and alter function call
00049 *
00050 * Revision 1.2  2006/05/30 11:30:41  hfriederich
00051 * Fixing some bugs introduced when porting H.460 from OpenH323 to OPAL and gcc4
00052 *
00053 * Revision 1.1  2006/05/27 07:24:00  hfriederich
00054 * Initial port of H.460 files from OpenH323 to OPAL
00055 *
00056 *
00057 */
00058 
00059 #if !defined(_H460_H)
00060 #define _H460_H
00061 
00062 
00063 #ifdef P_USE_PRAGMA
00064 #pragma interface
00065 #endif
00066 
00067 #include <asn/h225.h>
00068 #include <h323/transaddr.h>
00069 #include <ptlib/pluginmgr.h>
00070 #include <ptclib/url.h>
00071 
00072 
00073 #ifdef _MSC_VER
00074 #pragma warning(disable:4100)
00075 #endif
00076 
00078 
00079 template<class H225>
00080 class H460 : public H225 {
00081 public:
00082         
00088     virtual void OnReceivedPDU(
00089       const H225 & /*id*/
00090           ) {};
00091 
00096     virtual BOOL OnSendingPDU(
00097       H225 & /*id*/
00098           ) const { return FALSE;};
00099         
00100 protected:
00101 
00102 };
00103 
00104 class OpalOID : public PASN_ObjectId
00105 {
00106 public:
00107 
00108         OpalOID();
00109 
00110         OpalOID(
00111       const char * str  
00112     );
00113 };
00114 
00115 
00116 
00118 
00128 class H460_FeatureID : public H460<H225_GenericIdentifier>
00129 {
00130 
00131   public:
00132 
00137         H460_FeatureID();
00138 
00141         H460_FeatureID(unsigned ID);
00142 
00145     H460_FeatureID(OpalOID ID);
00146 
00149         H460_FeatureID(PString ID);
00150 
00151         H460_FeatureID(H225_GenericIdentifier ID);
00153 
00158        operator unsigned () const 
00159                 { return ((PASN_Integer *)choice)->GetValue(); };
00160 
00163        operator OpalOID & () 
00164            { return (OpalOID &)*choice; };
00165 
00168        operator PString () const 
00169            { return ((H225_GloballyUniqueID *)choice)->AsString(); };
00170 
00171     
00172            PINLINE H460_FeatureID & operator=(unsigned ID);
00173 
00174            PINLINE H460_FeatureID & operator=(OpalOID ID);
00175 
00176            PINLINE H460_FeatureID & operator=(PString ID);
00177          
00180            unsigned GetFeatureType() const { return GetTag(); };
00181 
00182            PString IDString() const;
00184 
00187     PObject * Clone() const;
00188 
00189         PObject::Comparison Compare(const PObject & obj) const;
00191 
00192 };
00193 
00194 
00196 
00201 class H460_Feature;
00202 class H460_FeatureTable;
00203 class H460_FeatureContent : public H460<H225_Content>
00204 {
00205  
00206    public:
00207 
00212            H460_FeatureContent();
00213 
00217            H460_FeatureContent(PASN_OctetString & param);
00218 
00221            H460_FeatureContent(const PString & param);
00222 
00225            H460_FeatureContent(PASN_BMPString & param);
00226 
00229            H460_FeatureContent(BOOL param);
00230 
00233            H460_FeatureContent(unsigned param, unsigned len);
00234 
00237            H460_FeatureContent(const H460_FeatureID & id);
00238 
00241            H460_FeatureContent(const H225_AliasAddress & add);
00242 
00245        H460_FeatureContent(const PURL & add);
00246 
00249            H460_FeatureContent(const H323TransportAddress & add);
00250 
00253            H460_FeatureContent(const H460_FeatureTable & table);
00254 
00257            H460_FeatureContent(H460_Feature * data);
00258 
00261            H460_FeatureContent(const H225_Content & param);
00262 
00264 
00267         operator PASN_OctetString () const { return *((PASN_OctetString *)choice); };
00268         operator PString () const
00269         { 
00270                 switch (GetTag()) {
00271                         case e_text:  
00272                                 return ((PASN_IA5String &)*choice).GetValue();
00273                         case e_transport: 
00274                                 return H323TransportAddress(*(H225_TransportAddress *)choice);
00275                 }
00276                 
00277                 return PString();
00278         }; 
00279 
00280         operator PASN_BMPString () const { return *(PASN_BMPString *)choice; };
00281         operator BOOL () const { return *(PASN_Boolean *)choice; };
00282 
00283         operator unsigned () const 
00284         { 
00285                 switch (GetTag()) {
00286                         case e_number8:  
00287                         case e_number16:
00288                         case e_number32: 
00289                                 return *(PASN_Integer*)choice;
00290                         default: 
00291                                 return 0;
00292                  }
00293         }
00294                 
00295         operator H460_FeatureID () const { return *(H225_GenericIdentifier *)choice; };
00296         operator H225_AliasAddress () const { return *(H225_AliasAddress *)choice; };
00297         operator H323TransportAddress () const { return H323TransportAddress(*(H225_TransportAddress *)choice); };
00298         operator H460_FeatureTable *() { return (H460_FeatureTable *)choice; };
00299         operator H460_Feature *() { return (H460_Feature *)choice; };
00300 
00302 };
00303 
00305 
00310 class H460_Feature;
00311 class H460_FeatureParameter : public H460<H225_EnumeratedParameter>
00312 {
00313  
00314   public:
00315 
00320     H460_FeatureParameter();
00321 
00324     H460_FeatureParameter(unsigned Identifier);
00325 
00328         H460_FeatureParameter(const PString & Identifier);
00329 
00332         H460_FeatureParameter(const OpalOID & Identifier);
00333 
00336         H460_FeatureParameter(const H225_EnumeratedParameter & param);
00337 
00340         H460_FeatureParameter(const H460_FeatureID & ID);
00342 
00347         const H460_FeatureID ID() { return m_id; };
00348 
00351          void addContent(const H460_FeatureContent & con ) 
00352          { IncludeOptionalField(e_content);  m_content = con; };
00353 
00356          void replaceContent(const H460_FeatureContent & con )
00357                         { if (hasContent())  
00358                                         delete &m_content; 
00359                                 m_content = con; };
00360 
00363          BOOL hasContent() 
00364                         { return (GetTag() == e_content); };
00365 
00367 
00368 
00371         operator PASN_OctetString &();
00372         operator PString &();
00373         operator PASN_BMPString &();
00374         operator BOOL ();
00375         operator unsigned ();
00376         operator H460_FeatureID &();
00377         operator H225_AliasAddress &();
00378         operator H323TransportAddress &();
00379         operator H225_ArrayOf_EnumeratedParameter &();
00380         operator PURL &();
00381 
00382 
00383         H460_FeatureContent operator=(
00384         const PASN_OctetString & value
00385         );
00386 
00387         H460_FeatureContent operator=(
00388         const PString & value
00389         );
00390 
00391         H460_FeatureContent operator=(
00392         const PASN_BMPString & value
00393         );
00394 
00395         H460_FeatureContent operator=(
00396         const BOOL & value
00397         );
00398 
00399         H460_FeatureContent operator=(
00400         const unsigned & value
00401         );
00402 
00403         H460_FeatureContent operator=(
00404         const H460_FeatureID & value
00405         );
00406 
00407         H460_FeatureContent operator=(
00408         const H225_AliasAddress & value
00409         );
00410 
00411         H460_FeatureContent operator=(
00412         const H323TransportAddress & value
00413         );
00414 
00415         H460_FeatureContent operator=(
00416         const H460_FeatureTable & value
00417         );
00418 
00419         H460_FeatureContent operator=(
00420         H460_Feature * value
00421         );
00422 
00423 
00424 };
00425 
00427 
00432 class H460_FeatureTable : public H460<H225_ArrayOf_EnumeratedParameter>
00433 
00434 {
00435   public:
00436 
00441         H460_FeatureTable();
00442 
00445         H460_FeatureTable(const H225_ArrayOf_EnumeratedParameter & Xparams);
00447 
00450 
00455         H460_FeatureParameter & AddParameter(H460_FeatureID & id, H460_FeatureContent & con);
00456 
00460         void AddParameter(H225_EnumeratedParameter & Xparam);
00461 
00467         H460_FeatureParameter & GetParameter(PINDEX id);
00468 
00475     H460_FeatureParameter & GetParameter(const H460_FeatureID & id);
00476 
00481         PINDEX GetParameterIndex(const H460_FeatureID & id);
00482 
00487         BOOL HasParameter(const H460_FeatureID & id);
00488 
00493         void RemoveParameter(PINDEX id);
00494 
00499         void RemoveParameter(const H460_FeatureID & id);
00500 
00505     void ReplaceParameter(const H460_FeatureID & id, H460_FeatureContent & con);
00506 
00510         int ParameterCount() { return GetSize(); };
00511 
00519         BOOL ParameterIsUnique(const H460_FeatureID & id);
00520 
00523     inline H460_FeatureParameter & operator[](
00524       PINDEX id  
00525     ) const { return operator[](id); };
00526 
00529         H460_FeatureParameter & operator[](
00530       PINDEX id  
00531     );
00533 
00534 };
00535 
00537 
00541 class H323EndPoint;
00542 class H323Connection;
00543 class H460_Feature : public H460<H225_FeatureDescriptor>
00544 {
00545   public:
00548 
00551         H460_Feature();
00552 
00555     H460_Feature(unsigned Identifier);
00556 
00559         H460_Feature(PString Identifier);
00560 
00563         H460_Feature(OpalOID Indentifier);
00564 
00567         H460_Feature(const H225_FeatureDescriptor & descriptor);
00568 
00570 
00573 
00574         enum {
00575       FeatureNeeded = 1,      
00576       FeatureDesired,         
00577       FeatureSupported        
00578         } FeatureCategory;
00579 
00580 
00581         enum {
00582           FeatureBase      =4,        
00583           FeatureBaseAll   =5,        
00584           FeatureBaseRas   =6,        
00585           FeatureBaseSignal=7,        
00586       FeatureRas       =8,        
00587           FeatureSignal    =16        
00588         } FeatureInstance;
00589 
00591 
00596        operator unsigned () const { return (H460_FeatureID)m_id; };
00597 
00600  //      operator OpalOID () const { return (H460_FeatureID)m_id; };
00601 
00604        operator PString () const { return (H460_FeatureID)m_id; };
00605 
00608            H460_FeatureID GetFeatureID() { return m_id; };
00609 
00612        void SetFeatureID(const H460_FeatureID & id) { m_id = id; };
00613 
00616            PString GetFeatureIDAsString();
00617 
00620            unsigned GetFeatureType() { return ((H460_FeatureID)m_id).GetFeatureType(); };
00622 
00627         virtual H460_FeatureParameter & AddParameter(H460_FeatureID * id, H460_FeatureContent & con);
00628 
00631         virtual void AddParameter(H460_FeatureParameter * param);
00632 
00635         virtual void RemoveParameter(PINDEX id);
00636 
00639         virtual void ReplaceParameter(H460_FeatureID id, H460_FeatureContent & con);
00640 
00643     H460_FeatureParameter & GetFeatureParameter(PINDEX id);
00644 
00647     H460_FeatureParameter & GetFeatureParameter(const H460_FeatureID & id);
00648 
00651         BOOL HasFeatureParameter(const H460_FeatureID & id);
00652  
00655         BOOL Contains(const H460_FeatureID & id);
00656 
00659     H460_FeatureParameter & Value(const H460_FeatureID & id);
00660 
00663     inline H460_FeatureParameter & operator()(
00664       PINDEX id  //* Index position in the collection of the object.
00665     ) const { return operator()(id); };
00666 
00667         H460_FeatureParameter & operator()(
00668       PINDEX id  
00669     );
00670 
00673     inline H460_FeatureParameter & operator[](
00674       const H460_FeatureID & id  //< FeatureID of the object.
00675     ) const { return operator()(id); };
00676 
00677         H460_FeatureParameter & operator()(
00678       const H460_FeatureID & id  
00679     );
00680 
00683         int GetParameterCount() 
00684                 { return CurrentTable->ParameterCount(); };
00685 
00688         H460_FeatureTable & GetCurrentTable();
00689 
00692         void SetCurrentTable(H460_FeatureTable & table);
00693 
00696         void SetCurrentTable(H460_FeatureParameter & param);
00697 
00700         void SetDefaultTable();
00701 
00703 
00708         static PStringList GetFeatureNames(PPluginManager * pluginMgr = NULL);
00709 
00712         static PStringList GetFeatureFriendlyNames(const PString & feature, PPluginManager * pluginMgr = NULL);
00713 
00716     static H460_Feature * CreateFeature(const PString & featurename,        
00717                                                                                 int FeatureType = FeatureBase,          
00718                                                                                 PPluginManager * pluginMgr = NULL   
00719                                         );
00722     static PStringList GetFeatureName() { return PStringList("empty"); };
00723 
00726     static PStringList GetFeatureFriendlyName() { return PStringList("empty"); };
00727 
00731         static int GetPurpose() { return FeatureBase; };
00732 
00735         virtual void AttachEndPoint(H323EndPoint * _ep);
00736 
00739         virtual void AttachConnection(H323Connection * _con);
00740 
00742 
00745         /* These are the main calls which can be overridden to
00746                 allow the various derived features access to the GEF
00747                 interface.
00748         */
00749   // PDU calls (Used in the H225_RAS Class)
00750     virtual BOOL OnSendGatekeeperRequest(H225_FeatureDescriptor & pdu) { return FALSE; };
00751     virtual BOOL OnSendGatekeeperConfirm(H225_FeatureDescriptor & pdu) { return FALSE; };
00752     virtual BOOL OnSendGatekeeperReject(H225_FeatureDescriptor & pdu) { return FALSE; };
00753 
00754     virtual void OnReceiveGatekeeperRequest(const H225_FeatureDescriptor & pdu) {};
00755     virtual void OnReceiveGatekeeperConfirm(const H225_FeatureDescriptor & pdu) {};
00756     virtual void OnReceiveGatekeeperReject(const H225_FeatureDescriptor & pdu) {};
00757 
00758     virtual BOOL OnSendRegistrationRequest(H225_FeatureDescriptor & pdu) { return FALSE; };
00759     virtual BOOL OnSendRegistrationConfirm(H225_FeatureDescriptor & pdu) { return FALSE; };
00760     virtual BOOL OnSendRegistrationReject(H225_FeatureDescriptor & pdu) { return FALSE; };
00761 
00762     virtual void OnReceiveRegistrationRequest(const H225_FeatureDescriptor & pdu) {};
00763     virtual void OnReceiveRegistrationConfirm(const H225_FeatureDescriptor & pdu) {};
00764     virtual void OnReceiveRegistrationReject(const H225_FeatureDescriptor & pdu) {};
00765 
00766     virtual BOOL OnSendAdmissionRequest(H225_FeatureDescriptor & pdu) { return FALSE; };
00767     virtual BOOL OnSendAdmissionConfirm(H225_FeatureDescriptor & pdu) { return FALSE; };
00768     virtual BOOL OnSendAdmissionReject(H225_FeatureDescriptor & pdu) { return FALSE; };
00769 
00770     virtual void OnReceiveAdmissionRequest(const H225_FeatureDescriptor & pdu) {};
00771     virtual void OnReceiveAdmissionConfirm(const H225_FeatureDescriptor & pdu) {};
00772     virtual void OnReceiveAdmissionReject(const H225_FeatureDescriptor & pdu) {};
00773 
00774     virtual BOOL OnSendLocationRequest(H225_FeatureDescriptor & pdu) { return FALSE; };
00775     virtual BOOL OnSendLocationConfirm(H225_FeatureDescriptor & pdu) { return FALSE; };
00776     virtual BOOL OnSendLocationReject(H225_FeatureDescriptor & pdu) { return FALSE; };
00777 
00778     virtual void OnReceiveLocationRequest(const H225_FeatureDescriptor & pdu) {};
00779     virtual void OnReceiveLocationConfirm(const H225_FeatureDescriptor & pdu) {};
00780     virtual void OnReceiveLocationReject(const H225_FeatureDescriptor & pdu) {};
00781 
00782     virtual BOOL OnSendServiceControlIndication(H225_FeatureDescriptor & pdu) { return FALSE; };
00783     virtual BOOL OnSendServiceControlResponse(H225_FeatureDescriptor & pdu) { return FALSE; };
00784 
00785     virtual void OnReceiveServiceControlIndication(const H225_FeatureDescriptor & pdu) {};
00786     virtual void OnReceiveServiceControlResponse(const H225_FeatureDescriptor & pdu) {};
00787 
00788 
00789     virtual BOOL OnSendNonStandardMessage(H225_FeatureDescriptor & pdu) { return FALSE; };
00790     virtual void OnReceiveNonStandardMessage(const H225_FeatureDescriptor & pdu) {};
00791 
00792         virtual BOOL OnSendEndpoint(H225_FeatureDescriptor & pdu) { return FALSE; };
00793         virtual void OnReceiveEndpoint(const H225_FeatureDescriptor & pdu) {};
00795 
00798   // UUIE Calls (Used in the H323SignalPDU Class)
00799     virtual BOOL OnSendSetup_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00800     virtual void OnReceiveSetup_UUIE(const H225_FeatureDescriptor & pdu) {};
00801 
00802     virtual BOOL OnSendAlerting_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00803     virtual void OnReceiveAlerting_UUIE(const H225_FeatureDescriptor & pdu) {};
00804 
00805     virtual BOOL OnSendCallProceeding_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00806     virtual void OnReceiveCallProceeding_UUIE(const H225_FeatureDescriptor & pdu) {};
00807 
00808     virtual BOOL OnSendCallConnect_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00809     virtual void OnReceiveCallConnect_UUIE(const H225_FeatureDescriptor & pdu) {};
00810 
00811     virtual BOOL OnSendFacility_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00812     virtual void OnReceiveFacility_UUIE(const H225_FeatureDescriptor & pdu) {};
00813 
00814         virtual BOOL OnSendReleaseComplete_UUIE(H225_FeatureDescriptor & pdu) { return FALSE; };
00815         virtual void OnReceiveReleaseComplete_UUIE(const H225_FeatureDescriptor & pdu) {};
00816 
00817         virtual BOOL OnSendUnAllocatedPDU(H225_FeatureDescriptor & pdu) { return FALSE; };
00818         virtual void OnReceivedUnAllocatedPDU(const H225_FeatureDescriptor & pdu) {};
00819 
00821 
00824   // H501 Calls (To Be Implemented
00825                 // H501_MessageCommonInfo
00826                 // H501_AddressTemplate
00827                 // H501_ContactInformation
00828                 // H501_RouteInformation
00830 
00831   protected:
00832           H460_FeatureTable * CurrentTable;
00833           H323EndPoint * ep;
00834           H323Connection * con;
00835 };
00836 
00837 class H460_FeatureStd : public H460_Feature
00838 {
00839     PCLASSINFO(H460_FeatureStd, H460_Feature);
00840   public:
00841 
00844           H460_FeatureStd() {};
00845 
00848         H460_FeatureStd(unsigned Identifier);
00850 
00855         H460_FeatureParameter & Add(unsigned id, H460_FeatureContent & con);
00856 
00859         void Remove(unsigned id);
00860 
00863         void Replace(unsigned id, H460_FeatureContent & con);
00864 
00867         BOOL HasParameter(unsigned id);
00868 
00871         H460_FeatureParameter & GetParameter(unsigned id);
00873 
00876     inline H460_FeatureParameter & operator[] (
00877       unsigned id  
00878     ) { return GetParameter(id); };
00879 
00880 };
00881 
00882 class H460_FeatureNonStd : public H460_Feature
00883 {
00884     PCLASSINFO(H460_FeatureNonStd, H460_Feature);
00885   public:
00886 
00891         H460_FeatureNonStd(PString Identifier);
00893 
00898         H460_FeatureParameter & Add(PString id, H460_FeatureContent & con);
00899 
00902         void Remove(PString id);
00903 
00906         void Replace(PString id, H460_FeatureContent & con);
00907 
00910         BOOL HasParameter(PString id);
00911 
00913 
00916     inline H460_FeatureParameter & operator[](
00917       PString id  
00918     ) const { return operator[](id); };
00919 
00922         H460_FeatureParameter & operator[](
00923       PString id  
00924     );
00925 
00926 };
00927 
00928 class H460_FeatureOID : public H460_Feature
00929 {
00930     PCLASSINFO(H460_FeatureOID, H460_Feature);
00931   public:
00932 
00937         H460_FeatureOID(OpalOID Identifier);
00939 
00944         H460_FeatureParameter & Add(const PString & id, H460_FeatureContent & con);
00945 
00948         void Remove(const PString & id);
00949 
00952         void Replace(const PString & id, H460_FeatureContent & con);
00953 
00956         BOOL HasParameter(OpalOID id);
00957 
00960         BOOL Contains(const PString & id);
00961 
00964         H460_FeatureParameter & Value(const PString & id);
00965 
00967 
00970     inline H460_FeatureParameter & operator[](
00971       OpalOID id  
00972     ) const { return operator[](id); };
00973 
00976         H460_FeatureParameter & operator[](
00977       OpalOID id  
00978     );
00979 
00980   protected:
00981     PString GetBase();
00982 
00983 };
00985 // Dictionary/List of Features
00986 
00987 PDICTIONARY(H460_Features, H460_FeatureID , H460_Feature);
00988 
00990 // FeatureSet Main Calling Class
00991 class H323EndPoint;
00992 class H460_FeatureSet : public PObject
00993 {
00994     PCLASSINFO(H460_FeatureSet, PObject);
00995   public:
00996 
00999         H460_FeatureSet();
01000 
01003     H460_FeatureSet(H460_FeatureSet * _base);
01004 
01007         H460_FeatureSet(const H225_FeatureSet & fs);
01008 
01011         H460_FeatureSet(const H225_ArrayOf_GenericData & generic);
01012 
01015         H460_FeatureSet & DeriveNewFeatureSet();
01016 
01019         virtual BOOL LoadFeatureSet(int inst = H460_Feature::FeatureBase,
01020                                                   H323Connection * con = NULL);
01021 
01026         BOOL ProcessFirstPDU(const H225_FeatureSet & fs);
01027 
01030         virtual BOOL CreateFeatureSet(const H225_FeatureSet & fs);
01031 
01034         virtual BOOL LoadFeature(const PString & featid);
01035         
01038         BOOL AddFeature(H460_Feature * Nfeat);
01039 
01042         void RemoveFeature(H460_FeatureID id);
01043 
01046         H460_Feature * GetFeature(const H460_FeatureID & id);
01047 
01050         BOOL HasFeature(const H460_FeatureID & feat);
01051 
01055         void ReceiveFeature(unsigned id, const H225_FeatureSet & Message);
01056 
01060         BOOL SendFeature(unsigned id, H225_FeatureSet & Message);       
01061 
01064         virtual void AttachEndPoint(H323EndPoint * _ep);
01065 
01068         virtual void AttachBaseFeatureSet(H460_FeatureSet * _baseSet);
01069 
01072         H323EndPoint * GetEndPoint() { return ep; };
01073 
01074   protected:
01075 
01076    BOOL CreateFeatureSetPDU(H225_FeatureSet & fs, unsigned MessageID);
01077 
01078    void ReadFeatureSetPDU(const H225_FeatureSet & fs, unsigned MessageID);
01079 
01080    H460_FeatureID GetFeatureIDPDU(H225_FeatureDescriptor & pdu);
01081 
01082    BOOL CreateFeaturePDU(H460_Feature & Feat, H225_FeatureDescriptor & pdu, unsigned MessageID);
01083    void ReadFeaturePDU(H460_Feature & Feat, const H225_FeatureDescriptor & pdu, unsigned MessageID);
01084 
01085    PString PTracePDU(PINDEX id) const;
01086 
01087    H460_Features  Features;
01088    H323EndPoint * ep;
01089    H460_FeatureSet * baseSet;
01090 
01091 };
01092 
01094 
01095 template <class className> class H460PluginServiceDescriptor : public PDevicePluginServiceDescriptor
01096 {
01097   public:
01098     virtual PObject *   CreateInstance(int /*userData*/) const { return new className; }
01099     virtual PStringList GetDeviceNames(int /*userData*/) const { return className::GetFeatureFriendlyName(); }
01100     virtual bool  ValidateDeviceName(const PString & deviceName, int userData) const 
01101         { 
01102              PStringList devices = className::GetFeatureName(); 
01103                  if ((deviceName == devices[0]) &&
01104                          (className::GetPurpose() >= userData) && 
01105                          (className::GetPurpose() < userData*2)) {
01106 
01107                         return TRUE; 
01108                  } else
01109                             return FALSE;
01110         } 
01111 };
01112 
01113 #define H460_FEATURE(name)    \
01114 static H460PluginServiceDescriptor<H460_Feature##name> H460_Feature##name##_descriptor; \
01115 PCREATE_PLUGIN(H460_Feature##name##, H460_Feature, &H460_Feature##name##_descriptor); \
01116 
01117 
01118 #ifdef _MSC_VER
01119 #pragma warning(disable:4100)
01120 #endif
01121 
01122 #endif // !defined(_H460_H)
01123 

Generated on Fri Mar 7 06:33:35 2008 for OPAL by  doxygen 1.5.1