h4501suppserv.h
资源名称:h323.zip [点击查看]
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:15k
源码类别:
IP电话/视频会议
开发平台:
WINDOWS
- //@DELB
- /*
- * $Revision: 1.7 $
- * $Date: 1998/12/21 16:51:46 $
- */
- ////////////////////////////////////////////////////////////////
- // Copyright (c) 1996 Lucent Technologies //
- // All Rights Reserved //
- // //
- // THIS IS UNPUBLISHED //
- // PROPRIETARY SOURCE //
- // CODE OF Lucent Technologies //
- // AND elemedia //
- // //
- // The copyright notice above does not evidence any //
- // actual or intended publication of such source code //
- ////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////
- // File : h4501suppserv.h //
- // //
- // //
- // History: //
- // 28 July 1998 Created //
- // //
- // //
- ////////////////////////////////////////////////////////////////
- #if (!defined(__H4501SUPPSERV_H__))
- #define __H4501SUPPSERV_H__
- #include "api/h225types.h"
- #include "api/h450err.h"
- #include "api/h450types.h"
- #include "api/h4502resarg.h"
- #include "api/h4503types.h"
- #include "api/h4503resarg.h"
- // Forward declarations
- class H4501FacilityExt;
- class H4501ROS;
- class H4501Invoke;
- class H4501ReturnResult;
- class H4501ReturnError;
- class H4501Reject;
- class H4501SuppService;
- class ASN1Codec;
- struct EmNetworkFacilityExtension;
- struct EmROS;
- struct EmH4501SupplementaryService;
- #define PDUTYPE_INVALID -1
- //@DELE
- // - enum Call Transfer Operation type.
- // @See:
- // - H4501Invoke H4501ReturnResult H4501Code
- enum H4502CTOperationType
- {
- CTOT_INVALID = 0, // invalid selection
- CTOT_IDENTIFY = 7, // callTransferIdentify OPERATION
- CTOT_ABANDON = 8, // callTransferAbondon OPERATION
- CTOT_INITIATE = 9, // callTransferInitiate OPERATION
- CTOT_SETUP = 10, // callTransferSetup OPERATION
- CTOT_ACTIVE = 11, // callTransferActive OPERATION
- CTOT_COMPLETE = 12, // callTransferComplete OPERATION
- CTOT_UPDATE = 13, // callTransferUpdate OPERATION
- CTOT_TRANSFER = 14 // subaddressTransfer OPERATION
- };
- // - enum Call Diversion Operation type.
- // @See:
- // - H4501Invoke H4501ReturnResult H4501Code
- enum H4503CDOperationType
- {
- CDOT_INVALID = 0, // invalid selection
- CDOT_ACTIVATEDIVERSIONQ = 15, // activateDiversionQ
- CDOT_DEACTIVATEDIVERSIONQ = 16, // deactivateDiversionQ
- CDOT_INTERROGATEDIVERSIONQ = 17, // interrogateDiversionQ
- CDOT_CHECKRESTRICTION = 18, // checkRestriction
- CDOT_CALLREROUTING = 19, // callRerouting
- CDOT_DIVERTINGLEGINFO1 = 20, // divertingLegInformation1
- CDOT_DIVERTINGLEGINFO2 = 21, // divertingLegInformation2
- CDOT_DIVERTINGLEGINFO3 = 22, // divertingLegInformation3
- CDOT_DIVERTINGLEGINFO4 = 100, // divertingLegInformation4
- CDOT_CFNRDIVLEGFAIL = 23 // cfnrDivertedLegFailed
- };
- /*
- * This defines the networkFacilityExtension field.
- * This is used in the H4501SupplementaryService ASN.1 sequence as
- * specified in H.450.1. This field is optional but when included, the
- * mandatory Set methods of this class must be used to properly create
- * this object.
- *
- * @See:
- * - Used in H4501SuppService
- */
- class DLLEXPORT H4501FacilityExt
- {
- public:
- // Constructor
- H4501FacilityExt();
- H4501FacilityExt(H4501FacilityExt &);
- // Destructor
- ~H4501FacilityExt();
- // Mandatory - this sets the sourceEntity field.
- // @See:
- // - enum H4501EntityType
- ProtReturnCode SetSrcEntity(int);
- // Mandatory - this gets the sourceEntity field.
- // @See:
- // - enum H4501EntityType
- ProtReturnCode GetSrcEntity(int &);
- // Optional - this sets the sourceEntityAddress field.
- ProtReturnCode SetSrcEntityAddr(H450AliasAddress &);
- // Optional - this gets the sourceEntityAddress field.
- ProtReturnCode GetSrcEntityAddr(H450AliasAddress &);
- // Mandatory - this sets the destinationEntity field.
- // @See:
- // - enum H4501EntityType
- ProtReturnCode SetDstEntity(int);
- // Mandatory - this gets the destinationEntity field.
- // @See:
- // - enum H4501EntityType
- ProtReturnCode GetDstEntity(int &);
- // Optional - this sets the destinationEntityAddress field.
- ProtReturnCode SetDstEntityAddr(H450AliasAddress &);
- // Optional - this gets the destinationEntityAddress field.
- ProtReturnCode GetDstEntityAddr(H450AliasAddress &);
- H4501FacilityExt & operator=(H4501FacilityExt &);
- // Determines if the class has been sufficiently created
- boolean Valid();
- //@DELB
- // For protocol internal use.
- EmNetworkFacilityExtension *GetPriv();
- ProtReturnCode SetPriv(EmNetworkFacilityExtension *);
- void SetValid();
- private:
- void Init();
- EmNetworkFacilityExtension *mExtPtr;
- int mIsValid;
- int mSrcFlag;
- int mDstFlag;
- //@DELE
- };
- /*
- * This is a virtual base class for the four types of ROS Operations.
- * Thse oprerations are Invoke, ReturnResult, ReturnError,
- * and Reject.
- * A ROS defines a single ServiceApdus field used in the
- * H4501SupplemtaryService ASN.1 sequence. The H4501SuppService class
- * manages a sequence of these objects.
- * @See:
- * - H4501Invoke H4501ReturnResult H4501ReturnError H4501Reject
- */
- class DLLEXPORT H4501ROS
- {
- public:
- // Constructor
- // @See:
- // - enum H4501ROSType
- H4501ROS(int);
- // Destructor
- virtual ~H4501ROS();
- // get type of ROS
- // @See:
- // - enum H4501ROSType
- int GetType();
- // Mandatory - this sets the invokeId field
- virtual ProtReturnCode SetInvokeId(int) = 0;
- // Mandatory - this gets the invokeId field
- virtual ProtReturnCode GetInvokeId(int &) = 0;
- H4501ROS & operator=(H4501ROS &);
- // Determines if the class has been sufficiently created
- virtual boolean Valid() = 0;
- //@DELB
- public:
- // For protocol internal use.
- virtual void *GetPriv() = 0;
- virtual ProtReturnCode SetPriv(void *) = 0;
- struct CodeToNum
- {
- int Code;
- int ArgPDUNum;
- int ResPDUNum;
- int ArgType;
- int ResType;
- };
- protected:
- int GetArgPDUNum(int Code);
- int GetResPDUNum(int Code);
- int GetArgType(int Code);
- int GetResType(int Code);
- static CodeToNum MapTable[];
- private:
- int mType;
- //@DELE
- };
- /*
- * This defines the ROS Invoke APDU.
- *
- * @See:
- * - Used in H4501SuppService
- */
- class DLLEXPORT H4501Invoke : public H4501ROS
- {
- public:
- // Constructor
- H4501Invoke();
- H4501Invoke(H4501Invoke &);
- // Destructor
- ~H4501Invoke();
- // Mandatory - this sets the invokeId field which is
- // a user supplied id that must be unambiguous.
- ProtReturnCode SetInvokeId(int);
- // Mandatory - this gets the invokeId field which is
- ProtReturnCode GetInvokeId(int &);
- // Mandatory - this sets the code field.
- // @Caveats:
- // <B>This field must be set before SetArgument is used.</B>
- ProtReturnCode SetCode(H4501Code &);
- // Mandatory - this gets the code field.
- ProtReturnCode GetCode(H4501Code &);
- // Optional - this sets the argument field.
- // @Caveats:
- // <B>The Code field must be set before the argument is set.</B>
- ProtReturnCode SetArgument(H450Arg &);
- // Optional - this gets the argument type.
- // @See:
- // - enum H450ArgumentType
- ProtReturnCode GetArgumentType(int &);
- // Optional - this gets the argument field.
- // @Caveats:
- // GetArgumentType should be called before GetArgument
- // in order to determine the argument received
- ProtReturnCode GetArgument(H450Arg &);
- // Optional - this sets the LinkedId field.
- ProtReturnCode SetLinkedId(int);
- // Optional - this gets the LinkedId field.
- ProtReturnCode GetLinkedId(int &);
- // Determines if the class has been sufficiently created
- boolean Valid();
- //@DELB
- // For protocol internal use.
- void *GetPriv();
- ProtReturnCode SetPriv(void *);
- void SetValid();
- private:
- void Init();
- boolean AllocArg(int Type, void **ppDst);
- boolean FreeArg(int Type, void *pDst);
- boolean InitArg(int Type, void *pDst);
- boolean CopyArg(int Type, void *pSrc, void *pDst);
- EmROS *mRosPtr;
- int mIsValid;
- int mCodeSet;
- int mIdSet;
- ASN1Codec *mCodecObjPtr;
- void *mArgStructPtr;
- int mArgType;
- void *mEncodedArgPtr;
- //@DELE
- };
- /*
- * This defines the ROS ReturnResult APDU.
- *
- * @See:
- * - Used in H4501SuppService
- */
- class DLLEXPORT H4501ReturnResult : public H4501ROS
- {
- public:
- // Constructor
- H4501ReturnResult();
- H4501ReturnResult(H4501ReturnResult &);
- // Destructor
- ~H4501ReturnResult();
- // Mandatory - this sets the invokeId field.
- ProtReturnCode SetInvokeId(int);
- // Mandatory - this gets the invokeId field.
- ProtReturnCode GetInvokeId(int &);
- // Optional - this sets the result field.
- ProtReturnCode SetResult(H4501Code &, H450Res &);
- // Optional - this gets the result type.
- // @See:
- // - enum H450ResultType
- ProtReturnCode GetResultType(int &);
- // Optional - this gets the result field.
- // @Caveats:
- // GetResultType should be called before GetResult
- // in order to determine the result received
- ProtReturnCode GetResult(H4501Code &, H450Res &);
- // Determines if the class has been sufficiently created
- boolean Valid();
- //@DELB
- // For protocol internal use.
- void *GetPriv();
- ProtReturnCode SetPriv(void *);
- void SetValid();
- private:
- void Init();
- boolean AllocRes(int Type, void **ppDst);
- boolean FreeRes(int Type, void *pDst);
- boolean InitRes(int Type, void *pDst);
- boolean CopyRes(int Type, void *pSrc, void *pDst);
- EmROS *mRosPtr;
- int mIsValid;
- ASN1Codec *mCodecObjPtr;
- void *mResStructPtr;
- int mResType;
- void *mEncodedResPtr;
- //@DELE
- };
- /*
- * This defines the ROS ReturnError APDU.
- *
- * @See:
- * - Used in H4501SuppService
- */
- class DLLEXPORT H4501ReturnError : public H4501ROS
- {
- public:
- // Constructor
- H4501ReturnError();
- H4501ReturnError(H4501ReturnError &);
- // Destructor
- ~H4501ReturnError();
- // Mandatory - this sets the invokeId field.
- ProtReturnCode SetInvokeId(int);
- // Mandatory - this gets the invokeId field.
- ProtReturnCode GetInvokeId(int &);
- // Mandatory - this sets the errcode field.
- ProtReturnCode SetCode(H4501Code &);
- // Mandatory - this gets the errcode field.
- ProtReturnCode GetCode(H4501Code &);
- // Optional - this sets the parameter field.
- ProtReturnCode SetError(H450Error &);
- // Optional - this gets the parameter field.
- ProtReturnCode GetError(H450Error &);
- // Determines if the class has been sufficiently created
- boolean Valid();
- //@DELB
- // For protocol internal use.
- void *GetPriv();
- ProtReturnCode SetPriv(void *);
- void SetValid();
- private:
- void Init();
- EmROS *mRosPtr;
- int mIsValid;
- int mCodeSet;
- int mIdSet;
- ASN1Codec *mCodecObjPtr;
- void *mErrStructPtr;
- int mParamType;
- void *mEncodedErrPtr;
- //@DELE
- };
- /*
- * This defines the ROS Reject APDU.
- *
- * @See:
- * - Used in H4501SuppService
- */
- class DLLEXPORT H4501Reject : public H4501ROS
- {
- public:
- // Constructor
- H4501Reject();
- H4501Reject(H4501Reject &);
- // Destructor
- ~H4501Reject();
- // Mandatory - this sets the invokeId field.
- ProtReturnCode SetInvokeId(int);
- // Mandatory - this gets the invokeId field.
- ProtReturnCode GetInvokeId(int &);
- // Mandatory - this sets the problem field
- ProtReturnCode SetProblem(H4501Problem &);
- // Mandatory - this gets the problem field
- ProtReturnCode GetProblem(H4501Problem &);
- // Determines if the class has been sufficiently created
- boolean Valid();
- //@DELB
- // For protocol internal use.
- void *GetPriv();
- ProtReturnCode SetPriv(void *);
- void SetValid();
- private:
- void Init();
- EmROS *mRosPtr;
- int mIsValid;
- int mProbSet;
- int mIdSet;
- //@DELE
- };
- /*
- * This is for the H4501SupplementaryService ASN.1 sequence.
- * It is the top level class used to implement supplemnetary services.
- */
- class DLLEXPORT H4501SuppService
- {
- public:
- // Constructor
- H4501SuppService();
- H4501SuppService(H4501SuppService &);
- // Destructor
- ~H4501SuppService();
- // Optional - this sets the networkFacilityExtension field.
- ProtReturnCode SetNetFacExt(H4501FacilityExt &);
- // Optional - this gets the networkFacilityExtension field.
- ProtReturnCode GetNetFacExt(H4501FacilityExt &);
- // Optional - this sets the interpretationApdu ASN.1 CHOICE
- // @See:
- // - enum H4501InterpretationAPDU
- ProtReturnCode SetInterpAPDU(int);
- // Optional - this gets the interpretationApdu ASN.1 CHOICE
- // @See:
- // - enum H4501InterpretationAPDU
- ProtReturnCode GetInterpAPDU(int &);
- // Mandatory - this adds a ROS the serviceApdu field.
- ProtReturnCode AddROS(H4501ROS &);
- // Mandatory - this gets a ROS from the serviceApdu field.
- // The index and ros type should match the index and
- // ROS type received in the list from GetROSTypes()
- //
- // @Caveats:
- // To get the ROS[s] from this class the following sequence
- // should be followed:
- // <OL>
- // <LI> Use GetNumROSs() so that an int array of sufficient
- // length can be allocated for the ROS types list.
- // <LI> Use GetROSTypes() to get the ROS types list.
- // <LI> Call GetROS() for each entry in the ROS types list
- // with the appropriate instance of ROS
- // </OL>
- ProtReturnCode GetROS(int index, H4501ROS &ros);
- // Mandatory - this gets the number of ROSs in serviceApdu field.
- // See GetROS for sequence of calls to get ROSs
- ProtReturnCode GetNumROSs(int &count);
- // Mandatory - this gets the types of ROSs in serviceApdu field.
- // See GetROS for sequence of calls to get ROSs
- ProtReturnCode GetROSTypes(int types[], int &count);
- // Determines if the class has been sufficiently created
- boolean Valid();
- H4501SuppService & operator=(H4501SuppService &);
- //@DELB
- // For protocol internal use.
- EmH4501SupplementaryService *GetPriv();
- ProtReturnCode SetPriv(EmH4501SupplementaryService *);
- ProtReturnCode GetASN1Msg(unsigned int *length, unsigned char **);
- ProtReturnCode SetASN1Msg(unsigned int length, unsigned char *);
- private:
- void Init();
- ASN1Codec *mCodecObjPtr;
- void *mEncodedMsgPtr;
- EmH4501SupplementaryService *mSupServPtr;
- int mIsValid;
- //@DELE
- };
- //@DELB
- #endif // __H4501SUPPSERV_H__
- //@DELE