# h4601.h

Go to the documentation of this file.

    00001 // H4601.h:
    00002 /*
    00003  * Virteos H.460 Implementation for the h323plus Library.
    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  * Alternatively, the contents of this file may be used under the terms
    00015  * of the General Public License (the  "GNU License"), in which case the
    00016  * provisions of GNU License are applicable instead of those
    00017  * above. If you wish to allow use of your version of this file only
    00018  * under the terms of the GNU License and not to allow others to use
    00019  * your version of this file under the MPL, indicate your decision by
    00020  * deleting the provisions above and replace them with the notice and
    00021  * other provisions required by the GNU License. If you do not delete
    00022  * the provisions above, a recipient may use your version of this file
    00023  * under either the MPL or the GNU License."
    00024  *
    00025  * Software distributed under the License is distributed on an "AS IS"
    00026  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
    00027  * the License for the specific language governing rights and limitations
    00028  * under the License.
    00029  *
    00030  * The Original Code is derived from and used in conjunction with the
    00031  * OpenH323 Project (www.openh323.org/)
    00032  *
    00033  * The Initial Developer of the Original Code is ISVO (Asia) Pte Ltd.
    00034  *
    00035  *
    00036  * Contributor(s): Many thanks to Simon Horne.
    00037  *
    00038  * $Revision: 28069 $
    00039  * $Author: rjongbloed $
    00040  * $Date: 2012-07-19 19:45:49 -0500 (Thu, 19 Jul 2012) $
    00041 */
    00042
    00043 #ifndef OPAL_H460_H4601_H
    00044 #define OPAL_H460_H4601_H
    00045
    00046 #ifdef P_USE_PRAGMA
    00047 #pragma interface
    00048 #endif
    00049
    00050 #include <opal/buildopts.h>
    00051
    00052 #if OPAL_H460
    00053
    00054 #include <asn/h225.h>
    00055 #include <h323/transaddr.h>
    00056 #include <opal/guid.h>
    00057 #include <ptlib/pluginmgr.h>
    00058 #include <ptclib/url.h>
    00059
    00060
    00061 #ifdef _MSC_VER
    00062 #pragma warning(disable:4100)
    00063 #endif
    00064
    00066
    00067 template<class H225>
    00068 class H460 : public H225 {
    00069 public:
    00070
    00076     virtual void OnReceivedPDU(
    00077       const H225 & /*id*/
    00078           ) {};
    00079
    00084     virtual PBoolean OnSendingPDU(
    00085       H225 & /*id*/
    00086           ) const { return FALSE;};
    00087
    00088 protected:
    00089
    00090 };
    00091
    00092 class OpalOID : public PASN_ObjectId
    00093 {
    00094   public:
    00095     OpalOID();
    00096     OpalOID(
    00097       const char * str
    00098     );
    00099
    00100     OpalOID & operator+(const char *);
    00101
    00102     unsigned GetLastIdentifier()
    00103     { return (*this)[GetSize()-1]; }
    00104 };
    00105
    00106
    00107
    00109
    00119 class H460_FeatureID : public H460<H225_GenericIdentifier>
    00120 {
    00121
    00122   public:
    00123
    00128         H460_FeatureID();
    00129
    00132         H460_FeatureID(unsigned ID);
    00133
    00136     H460_FeatureID(OpalOID ID);
    00137
    00140         H460_FeatureID(PString ID);
    00141
    00142         H460_FeatureID(H225_GenericIdentifier ID);
    00144
    00149        operator unsigned () const
    00150                 { return ((PASN_Integer *)choice)->GetValue(); };
    00151
    00154        operator OpalOID & ()
    00155            { return (OpalOID &)*choice; };
    00156
    00159        operator PString () const
    00160            { return ((H225_GloballyUniqueID *)choice)->AsString(); };
    00161
    00162
    00163            PINLINE H460_FeatureID & operator=(unsigned ID);
    00164
    00165            PINLINE H460_FeatureID & operator=(OpalOID ID);
    00166
    00167            PINLINE H460_FeatureID & operator=(PString ID);
    00168
    00171            unsigned GetFeatureType() const { return GetTag(); };
    00172
    00173            PString IDString() const;
    00175
    00178     PObject * Clone() const;
    00179
    00180         PObject::Comparison Compare(const PObject & obj) const;
    00182
    00183 };
    00184
    00185
    00187
    00192 class H460_Feature;
    00193 class H460_FeatureTable;
    00194 class H460_FeatureContent : public H460<H225_Content>
    00195 {
    00196
    00197    public:
    00198
    00203            H460_FeatureContent();
    00204
    00208            H460_FeatureContent(PASN_OctetString & param);
    00209
    00212            H460_FeatureContent(const PString & param);
    00213
    00216            H460_FeatureContent(PASN_BMPString & param);
    00217
    00220            H460_FeatureContent(PBoolean param);
    00221
    00224            H460_FeatureContent(unsigned param, unsigned len);
    00225
    00228            H460_FeatureContent(const H460_FeatureID & id);
    00229
    00232            H460_FeatureContent(const H225_AliasAddress & add);
    00233
    00236        H460_FeatureContent(const PURL & add);
    00237
    00240            H460_FeatureContent(const H323TransportAddress & add);
    00241
    00244            H460_FeatureContent(const H460_FeatureTable & table);
    00245
    00248            H460_FeatureContent(const OpalGloballyUniqueID & guid);
    00249
    00252            H460_FeatureContent(H460_Feature * data);
    00253
    00256            H460_FeatureContent(const H225_Content & param);
    00257
    00259
    00262         operator PASN_OctetString () const { return *((PASN_OctetString *)choice); };
    00263         operator PString () const
    00264         {
    00265                 switch (GetTag()) {
    00266                         case e_text:
    00267                                 return ((PASN_IA5String &)*choice).GetValue();
    00268                         case e_transport:
    00269                                 return H323TransportAddress(*(H225_TransportAddress *)choice);
    00270                         default:
    00271                                 break;
    00272                 }
    00273
    00274                 return PString();
    00275         };
    00276
    00277         operator PASN_BMPString () const { return *(PASN_BMPString *)choice; };
    00278         operator PBoolean () const { return *(PASN_Boolean *)choice; };
    00279
    00280         operator unsigned () const
    00281         {
    00282                 switch (GetTag()) {
    00283                         case e_number8:
    00284                         case e_number16:
    00285                         case e_number32:
    00286                                 return *(PASN_Integer*)choice;
    00287                         default:
    00288                                 return 0;
    00289                  }
    00290         }
    00291
    00292         operator H460_FeatureID () const { return *(H225_GenericIdentifier *)choice; };
    00293         operator H225_AliasAddress () const { return *(H225_AliasAddress *)choice; };
    00294         operator H323TransportAddress () const { return H323TransportAddress(*(H225_TransportAddress *)choice); };
    00295         operator H460_FeatureTable *() { return (H460_FeatureTable *)choice; };
    00296         operator H460_Feature *() { return (H460_Feature *)choice; };
    00297
    00299 };
    00300
    00302
    00307 class H460_Feature;
    00308 class H460_FeatureParameter : public H460<H225_EnumeratedParameter>
    00309 {
    00310
    00311   public:
    00312
    00317     H460_FeatureParameter();
    00318
    00321     H460_FeatureParameter(unsigned Identifier);
    00322
    00325         H460_FeatureParameter(const PString & Identifier);
    00326
    00329         H460_FeatureParameter(const OpalOID & Identifier);
    00330
    00333         H460_FeatureParameter(const H225_EnumeratedParameter & param);
    00334
    00337         H460_FeatureParameter(const H460_FeatureID & ID);
    00339
    00344         const H460_FeatureID ID() { return m_id; };
    00345
    00348          void addContent(const H460_FeatureContent & con )
    00349          { IncludeOptionalField(e_content);  m_content = con; };
    00350
    00353          void replaceContent(const H460_FeatureContent & con )
    00354                         { if (hasContent())
    00355                                         delete &m_content;
    00356                                 m_content = con; };
    00357
    00360          PBoolean hasContent()
    00361                         { return (GetTag() == e_content); };
    00362
    00364
    00365
    00368         operator PASN_OctetString &();
    00369         operator PString &();
    00370         operator PASN_BMPString &();
    00371         operator PBoolean ();
    00372         operator unsigned ();
    00373         operator H460_FeatureID &();
    00374         operator H225_AliasAddress &();
    00375         operator H323TransportAddress ();
    00376         operator H225_ArrayOf_EnumeratedParameter &();
    00377         operator PURL &();
    00378         operator OpalGloballyUniqueID ();
    00379
    00380
    00381         H460_FeatureContent operator=(
    00382         const PASN_OctetString & value
    00383         );
    00384
    00385         H460_FeatureContent operator=(
    00386         const PString & value
    00387         );
    00388
    00389         H460_FeatureContent operator=(
    00390         const PASN_BMPString & value
    00391         );
    00392
    00393         H460_FeatureContent operator=(
    00394         const PBoolean & value
    00395         );
    00396
    00397         H460_FeatureContent operator=(
    00398         const unsigned & value
    00399         );
    00400
    00401         H460_FeatureContent operator=(
    00402         const H460_FeatureID & value
    00403         );
    00404
    00405         H460_FeatureContent operator=(
    00406         const H225_AliasAddress & value
    00407         );
    00408
    00409         H460_FeatureContent operator=(
    00410         const H323TransportAddress & value
    00411         );
    00412
    00413         H460_FeatureContent operator=(
    00414         const H460_FeatureTable & value
    00415         );
    00416
    00417         H460_FeatureContent operator=(
    00418         H460_Feature * value
    00419         );
    00420
    00421         H460_FeatureContent operator=(
    00422         const OpalGloballyUniqueID & value
    00423         );
    00424
    00425
    00426 };
    00427
    00429
    00434 class H460_FeatureTable : public H460<H225_ArrayOf_EnumeratedParameter>
    00435
    00436 {
    00437   public:
    00438
    00443         H460_FeatureTable();
    00444
    00447         H460_FeatureTable(const H225_ArrayOf_EnumeratedParameter & Xparams);
    00449
    00452
    00457         H460_FeatureParameter & AddParameter(const H460_FeatureID & id, const H460_FeatureContent & con);
    00458
    00462         H460_FeatureParameter & AddParameter(const H460_FeatureID & id);
    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         PBoolean 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, const H460_FeatureContent & con);
    00513
    00517         int ParameterCount() { return GetSize(); };
    00518
    00526         PBoolean 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, const H460_FeatureContent & con);
    00635
    00638         virtual H460_FeatureParameter & AddParameter(H460_FeatureID * id);
    00639
    00642         virtual void AddParameter(H460_FeatureParameter * param);
    00643
    00646         virtual void RemoveParameter(PINDEX id);
    00647
    00650         virtual void ReplaceParameter(const H460_FeatureID id, const H460_FeatureContent & con);
    00651
    00654     H460_FeatureParameter & GetFeatureParameter(PINDEX id);
    00655
    00658     H460_FeatureParameter & GetFeatureParameter(const H460_FeatureID & id);
    00659
    00662         PBoolean HasFeatureParameter(const H460_FeatureID & id);
    00663
    00666         PBoolean Contains(const H460_FeatureID & id);
    00667
    00670     H460_FeatureParameter & Value(const H460_FeatureID & id);
    00671
    00674     inline H460_FeatureParameter & operator()(
    00675       PINDEX id  //* Index position in the collection of the object.
    00676     ) const { return operator()(id); };
    00677
    00678         H460_FeatureParameter & operator()(
    00679       PINDEX id
    00680     );
    00681
    00684     inline H460_FeatureParameter & operator[](
    00685       const H460_FeatureID & id  //< FeatureID of the object.
    00686     ) const { return operator()(id); };
    00687
    00688         H460_FeatureParameter & operator()(
    00689       const H460_FeatureID & id
    00690     );
    00691
    00694         int GetParameterCount()
    00695                 { return CurrentTable->ParameterCount(); };
    00696
    00699         H460_FeatureTable & GetCurrentTable();
    00700
    00703         void SetCurrentTable(H460_FeatureTable & table);
    00704
    00707         void SetCurrentTable(H460_FeatureParameter & param);
    00708
    00711         void SetDefaultTable();
    00712
    00714
    00719         static PStringList GetFeatureNames(PPluginManager * pluginMgr = NULL);
    00720
    00723         static PStringList GetFeatureFriendlyNames(const PString & feature, PPluginManager * pluginMgr = NULL);
    00724
    00727     static H460_Feature * CreateFeature(const PString & featurename,
    00728                                                                                 int FeatureType = FeatureBase,
    00729                                                                                 PPluginManager * pluginMgr = NULL
    00730                                         );
    00733     static PStringList GetFeatureName() { return PStringList("empty"); };
    00734
    00737     static PStringList GetFeatureFriendlyName() { return PStringList("empty"); };
    00738
    00742         static int GetPurpose() { return FeatureBase; };
    00743
    00746         virtual void AttachEndPoint(H323EndPoint * _ep);
    00747
    00750         virtual void AttachConnection(H323Connection * _con);
    00751
    00753
    00756         /* These are the main calls which can be overridden to
    00757                 allow the various derived features access to the GEF
    00758                 interface.
    00759         */
    00760   // PDU calls (Used in the H225_RAS Class)
    00761     virtual PBoolean OnSendGatekeeperRequest(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00762     virtual PBoolean OnSendGatekeeperConfirm(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00763     virtual PBoolean OnSendGatekeeperReject(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00764
    00765     virtual void OnReceiveGatekeeperRequest(const H225_FeatureDescriptor & /*pdu*/) {};
    00766     virtual void OnReceiveGatekeeperConfirm(const H225_FeatureDescriptor & /*pdu*/) {};
    00767     virtual void OnReceiveGatekeeperReject(const H225_FeatureDescriptor & /*pdu*/) {};
    00768
    00769     virtual PBoolean OnSendRegistrationRequest(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00770     virtual PBoolean OnSendRegistrationConfirm(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00771     virtual PBoolean OnSendRegistrationReject(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00772
    00773     virtual void OnReceiveRegistrationRequest(const H225_FeatureDescriptor & /*pdu*/) {};
    00774     virtual void OnReceiveRegistrationConfirm(const H225_FeatureDescriptor & /*pdu*/) {};
    00775     virtual void OnReceiveRegistrationReject(const H225_FeatureDescriptor & /*pdu*/) {};
    00776
    00777     virtual PBoolean OnSendAdmissionRequest(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00778     virtual PBoolean OnSendAdmissionConfirm(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00779     virtual PBoolean OnSendAdmissionReject(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00780
    00781     virtual void OnReceiveAdmissionRequest(const H225_FeatureDescriptor & /*pdu*/) {};
    00782     virtual void OnReceiveAdmissionConfirm(const H225_FeatureDescriptor & /*pdu*/) {};
    00783     virtual void OnReceiveAdmissionReject(const H225_FeatureDescriptor & /*pdu*/) {};
    00784
    00785     virtual PBoolean OnSendLocationRequest(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00786     virtual PBoolean OnSendLocationConfirm(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00787     virtual PBoolean OnSendLocationReject(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00788
    00789     virtual void OnReceiveLocationRequest(const H225_FeatureDescriptor & /*pdu*/) {};
    00790     virtual void OnReceiveLocationConfirm(const H225_FeatureDescriptor & /*pdu*/) {};
    00791     virtual void OnReceiveLocationReject(const H225_FeatureDescriptor & /*pdu*/) {};
    00792
    00793     virtual PBoolean OnSendServiceControlIndication(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00794     virtual PBoolean OnSendServiceControlResponse(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00795
    00796     virtual void OnReceiveServiceControlIndication(const H225_FeatureDescriptor & /*pdu*/) {};
    00797     virtual void OnReceiveServiceControlResponse(const H225_FeatureDescriptor & /*pdu*/) {};
    00798
    00799     virtual PBoolean OnSendNonStandardMessage(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00800     virtual void OnReceiveNonStandardMessage(const H225_FeatureDescriptor & /*pdu*/) {};
    00801
    00802         virtual PBoolean OnSendUnregistrationRequest(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00803         virtual void OnReceiveUnregistrationRequest(const H225_FeatureDescriptor & /*pdu*/) {};
    00804
    00805         virtual PBoolean OnSendEndpoint(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00806         virtual void OnReceiveEndpoint(const H225_FeatureDescriptor & /*pdu*/) {};
    00807
    00808     virtual PBoolean OnSendInfoRequestMessage(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00809     virtual void OnReceiveInfoRequestMessage(const H225_FeatureDescriptor & /*pdu*/) {};
    00810
    00811         virtual PBoolean OnSendInfoRequestResponseMessage(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00812         virtual void OnReceiveInfoRequestResponseMessage(const H225_FeatureDescriptor & /*pdu*/) {};
    00813
    00814     virtual PBoolean OnSendDisengagementRequestMessage(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00815     virtual void OnReceiveDisengagementRequestMessage(const H225_FeatureDescriptor & /*pdu*/) {};
    00816
    00817         virtual PBoolean OnSendDisengagementConfirmMessage(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00818         virtual void OnReceiveDisengagementConfirmMessage(const H225_FeatureDescriptor & /*pdu*/) {};
    00820
    00823   // UUIE Calls (Used in the H323SignalPDU Class)
    00824     virtual PBoolean OnSendSetup_UUIE(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00825     virtual void OnReceiveSetup_UUIE(const H225_FeatureDescriptor & /*pdu*/) {};
    00826
    00827     virtual PBoolean OnSendAlerting_UUIE(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00828     virtual void OnReceiveAlerting_UUIE(const H225_FeatureDescriptor & /*pdu*/) {};
    00829
    00830     virtual PBoolean OnSendCallProceeding_UUIE(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00831     virtual void OnReceiveCallProceeding_UUIE(const H225_FeatureDescriptor & /*pdu*/) {};
    00832
    00833     virtual PBoolean OnSendCallConnect_UUIE(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00834     virtual void OnReceiveCallConnect_UUIE(const H225_FeatureDescriptor & /*pdu*/) {};
    00835
    00836     virtual PBoolean OnSendFacility_UUIE(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00837     virtual void OnReceiveFacility_UUIE(const H225_FeatureDescriptor & /*pdu*/) {};
    00838
    00839         virtual PBoolean OnSendReleaseComplete_UUIE(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00840         virtual void OnReceiveReleaseComplete_UUIE(const H225_FeatureDescriptor & /*pdu*/) {};
    00841
    00842         virtual PBoolean OnSendUnAllocatedPDU(H225_FeatureDescriptor & /*pdu*/) { return FALSE; };
    00843         virtual void OnReceivedUnAllocatedPDU(const H225_FeatureDescriptor & /*pdu*/) {};
    00844
    00846
    00849   // H501 Calls (To Be Implemented
    00850                 // H501_MessageCommonInfo
    00851                 // H501_AddressTemplate
    00852                 // H501_ContactInformation
    00853                 // H501_RouteInformation
    00855
    00856   protected:
    00857           H460_FeatureTable * CurrentTable;
    00858           H323EndPoint * ep;
    00859           H323Connection * con;
    00860 };
    00861
    00862 class H460_FeatureStd : public H460_Feature
    00863 {
    00864     PCLASSINFO(H460_FeatureStd, H460_Feature);
    00865   public:
    00866
    00869           H460_FeatureStd() {};
    00870
    00873         H460_FeatureStd(unsigned Identifier);
    00875
    00880         H460_FeatureParameter & Add(unsigned id, const H460_FeatureContent & con);
    00881
    00884         void Remove(unsigned id);
    00885
    00888         void Replace(unsigned id,const H460_FeatureContent & con);
    00889
    00892         PBoolean HasParameter(unsigned id);
    00893
    00896         H460_FeatureParameter & GetParameter(unsigned id);
    00898
    00901     inline H460_FeatureParameter & operator[] (
    00902       unsigned id
    00903     ) { return GetParameter(id); };
    00904
    00905 };
    00906
    00907 class H460_FeatureNonStd : public H460_Feature
    00908 {
    00909     PCLASSINFO(H460_FeatureNonStd, H460_Feature);
    00910   public:
    00911
    00916         H460_FeatureNonStd(PString Identifier);
    00918
    00923         H460_FeatureParameter & Add(const PString id, const H460_FeatureContent & con);
    00924
    00927         void Remove(const PString & id);
    00928
    00931         void Replace( const PString & id, const H460_FeatureContent & con);
    00932
    00935         PBoolean HasParameter(PString id);
    00936
    00938
    00941     inline H460_FeatureParameter & operator[](
    00942       PString id
    00943     ) const { return operator[](id); };
    00944
    00947         H460_FeatureParameter & operator[](
    00948       PString id
    00949     );
    00950
    00951 };
    00952
    00953 class H460_FeatureOID : public H460_Feature
    00954 {
    00955     PCLASSINFO(H460_FeatureOID, H460_Feature);
    00956   public:
    00957
    00962         H460_FeatureOID(OpalOID Identifier);
    00964
    00969         H460_FeatureParameter & Add(const PString & id, const H460_FeatureContent & con);
    00970
    00973         void Remove(const PString & id);
    00974
    00977         void Replace(const PString & id, const H460_FeatureContent & con);
    00978
    00981         PBoolean HasParameter(OpalOID id);
    00982
    00985         PBoolean Contains(const PString & id);
    00986
    00989         H460_FeatureParameter & Value(const PString & id);
    00990
    00992
    00995     inline H460_FeatureParameter & operator[](
    00996       OpalOID id
    00997     ) const { return operator[](id); };
    00998
    01001         H460_FeatureParameter & operator[](
    01002       OpalOID id
    01003     );
    01004
    01005   protected:
    01006     PString GetBase();
    01007
    01008 };
    01010 // Dictionary/List of Features
    01011
    01012 PDICTIONARY(H460_Features, H460_FeatureID , H460_Feature);
    01013
    01015 // FeatureSet Main Calling Class
    01016 class H323EndPoint;
    01017 class H460_FeatureSet : public PObject
    01018 {
    01019     PCLASSINFO(H460_FeatureSet, PObject);
    01020   public:
    01021
    01024     H460_FeatureSet();
    01025
    01028     H460_FeatureSet(H460_FeatureSet * base);
    01029
    01032     H460_FeatureSet(const H225_FeatureSet & fs);
    01033
    01036     H460_FeatureSet(const H225_ArrayOf_GenericData & genericData);
    01037
    01040     H460_FeatureSet * DeriveNewFeatureSet();
    01041
    01044     virtual PBoolean LoadFeatureSet(int inst = H460_Feature::FeatureBase,
    01045       H323Connection * con = NULL);
    01046
    01051     PBoolean ProcessFirstPDU(const H225_FeatureSet & fs);
    01052
    01055     virtual PBoolean CreateFeatureSet(const H225_FeatureSet & fs);
    01056
    01059     virtual PBoolean LoadFeature(const PString & featid);
    01060
    01063     PBoolean AddFeature(H460_Feature * feat);
    01064
    01067     void RemoveFeature(H460_FeatureID id);
    01068
    01071     H460_Feature * GetFeature(const H460_FeatureID & id);
    01072
    01075     PBoolean HasFeature(const H460_FeatureID & feat);
    01076
    01080     void ReceiveFeature(unsigned id, const H225_FeatureSet & Message);
    01081
    01085     PBoolean SendFeature(unsigned id, H225_FeatureSet & Message);
    01086
    01089     virtual void AttachEndPoint(H323EndPoint * ep);
    01090
    01093     virtual void AttachBaseFeatureSet(H460_FeatureSet * baseSet);
    01094
    01097     H323EndPoint * GetEndPoint() { return m_endpoint; };
    01098
    01099   protected:
    01100
    01101     PBoolean CreateFeatureSetPDU(H225_FeatureSet & fs, unsigned MessageID);
    01102
    01103     void ReadFeatureSetPDU(const H225_FeatureSet & fs, unsigned MessageID);
    01104
    01105     H460_FeatureID GetFeatureIDPDU(H225_FeatureDescriptor & pdu);
    01106
    01107     PBoolean CreateFeaturePDU(H460_Feature & Feat, H225_FeatureDescriptor & pdu, unsigned MessageID);
    01108     void ReadFeaturePDU(H460_Feature & Feat, const H225_FeatureDescriptor & pdu, unsigned MessageID);
    01109
    01110     PString PTracePDU(PINDEX id) const;
    01111
    01112     H460_Features     m_features;
    01113     H323EndPoint    * m_endpoint;
    01114     H460_FeatureSet * m_baseSet;
    01115 };
    01116
    01118
    01119 template <class className> class H460PluginServiceDescriptor : public PDevicePluginServiceDescriptor
    01120 {
    01121   public:
    01122     virtual PObject *   CreateInstance(int /*userData*/) const { return new className; }
    01123     virtual PStringArray GetDeviceNames(int /*userData*/) const { return className::GetFeatureFriendlyName(); }
    01124     virtual bool  ValidateDeviceName(const PString & deviceName, int userData) const
    01125         {
    01126              PStringList devices = className::GetFeatureName();
    01127                  if ((deviceName == devices[0]) &&
    01128                          (className::GetPurpose() >= userData) &&
    01129                          (className::GetPurpose() < userData*2)) {
    01130
    01131                         return TRUE;
    01132                  } else
    01133                             return FALSE;
    01134         }
    01135 };
    01136
    01137 #define H460_FEATURE(name)    \
    01138 static H460PluginServiceDescriptor<H460_Feature##name> H460_Feature##name##_descriptor; \
    01139 PCREATE_PLUGIN_STATIC(name, H460_Feature, &H460_Feature##name##_descriptor); \
    01140
    01141
    01142 #ifdef _MSC_VER
    01143 #pragma warning(disable:4100)
    01144 #endif
    01145
    01146 #endif // OPAL_H460
    01147
    01148 #endif // OPAL_H460_H4601_H