h245sig.h
资源名称:h323.zip [点击查看]
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:14k
源码类别:
IP电话/视频会议
开发平台:
WINDOWS
- /*
- * $Revision: 1.6 $
- * $Date: 1998/10/14 22:49:54 $
- */
- ////////////////////////////////////////////////////////////////
- // Copyright (c) 1996,97 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 : h245sig.h //
- // //
- // Description: The H245 control signalling protocol. //
- // //
- // //
- // 10_Mar_1997 Created //
- // 03_Apr_1997 Connection Manager changes.. //
- // 08_May_1997 Profile 1B changes //
- // 20_May_1997 added conference request and response functions //
- // 10_Dec_1997 Destructor made virtual //
- // 01_Oct_1997 Support for fallback procedures from faststart //
- // InheritLC //
- // GetOutLCDataType,GetInLCDataType(overloaded) //
- // GetInLCParams,GetOutLCParams(overloaded) //
- // GetRemoteMuxCap,GetMuxCap(overloaded) //
- // //
- /////////////////////////////////////////////////////////////////
- #if !defined(__H245SIG_H__)
- #define __H245SIG_H__
- #include "util/platform.h"
- #include "api/h245sigerr.h"
- #include "api/h245types.h"
- #include "api/h245caps.h"
- #include "api/h245ind.h"
- #include "api/h245cmd.h"
- #include "api/h245rr.h"
- #include "api/connmgr.h"
- class H245Client;
- class H245Engine;
- class Logger;
- class DLLEXPORT H245Protocol : public ConnectionEntity
- {
- public:
- // terminal_type is from the set H245SigTerminalType
- H245Protocol(int identifier, int terminal_type,
- ProtReturnCode& returnCode);
- virtual ~H245Protocol();
- /////////////////////////////////////////////////////////////////////////
- /// H245 Commands and Indications
- /////////////////////////////////////////////////////////////////////////
- // Used to send a command to the remote end.
- // Note: If an EndSession command is specified, then all open
- // logical channels will be closed. No further API calls
- // can be made following a call to send an EndSession command.
- ProtReturnCode SendCommand(H245SigCommand &command);
- // Used to send an indication to the remote end.
- ProtReturnCode SendIndication(H245SigIndication &indication);
- /////////////////////////////////////////////////////////////////////////
- /// H245 Master slave determination functions.
- /////////////////////////////////////////////////////////////////////////
- // Invoked to initiate outgoing master-slave determination procedure.
- ProtReturnCode DetermineMS();
- /////////////////////////////////////////////////////////////////////////
- /// H245 Terminal capabilities functions.
- /////////////////////////////////////////////////////////////////////////
- // Method to send the terminal capability set. Called at the end
- // of master slave determination (success) notification.
- ProtReturnCode SendTermCaps(H245SigMuxCap* mux_cap,
- H245SigCapTable* cap_table,
- H245SigCapDescs* cap_descriptors);
- // Called by the user to ack the remote ends terminal capabilitity set.
- ProtReturnCode AckTermCaps(void);
- // Called by the user to reject the remote ends terminal capability set.
- // cause indicates the reason for rejecting the remote termcap set and
- // it is one from the set H245SigCapRejectReason.
- // exceeded_type specified if the terminal capability set was processed or
- // not before rejecting it. Valid only if cause is set to
- // CRR_TABLE_ENTRY_CAPACITY_EXCEEDED
- // max_entry indicates the sequence number of the capability table entry
- // number for which this negative acknowledgement was generated. Valid
- // only if exceeded_type is TRUE
- ProtReturnCode RejectTermCaps(
- int cause,
- boolean exceeded_type,
- int max_entry);
- /////////////////////////////////////////////////////////////////////////
- /// H245 Open Logical Channel Functions.
- /////////////////////////////////////////////////////////////////////////
- // Open a Logical Channel for the specified data type.
- // forward_lc_num indicates the number to be associated with the LC
- // port_number is an user to user parameter.
- // data_type describes the type of media to be transferred on the LC.
- // lc_mux_params describes the transport related parameters for the LC.
- ProtReturnCode OpenLC(int forward_lc_num,
- unsigned short port_number,
- H245SigDataType& data_type,
- H245SigMuxParams& lc_mux_params);
- // Reject a open channel request made by the remote end
- // lc_num indicates the (remote end's) logical channel number which is
- // being rejected.
- // reason indicates the reason for rejection and it is one from the set
- // H245SigOLCRejectReason
- ProtReturnCode RejectOpenLCReq(int lc_num, int reason);
- // Ack a open channel request made by the peer
- // lc_num indicates the (remote end's) logical channel number which is
- // being acknowledged.
- // lc_ack_params specifies the transport parameters for the acknowledged LC.
- // lc_ack_params need to be set only for H.225 (H.222, H.223 and V.76 don't
- // need it)
- ProtReturnCode AckOpenLCReq(int lc_num,
- H245SigH225AckParams *h225_lc_ack_params = NULL);
- // Inherit a logical channel created using the fast start mechanism
- // defined in H.323. Note that InheritLC will return a failure if
- // the procedure is attempted before the masterslave determination
- // completes. direction specifies the Q.931 call direction.
- // Values of Q931CallDir are defined in q931_event.h
- // DIR_OUTGOING = 0, DIR_INCOMING = 1
- ProtReturnCode InheritLC(H245SigOpenLogicalChannel &olcInfo, int direction);
- /////////////////////////////////////////////////////////////////////////
- /// H245 Close Logical Channel Functions.
- /////////////////////////////////////////////////////////////////////////
- // Close a logical channel opened by this end.
- // lc_num indicates the forward logical number that is being closed.
- ProtReturnCode CloseOutLC(int lc_num);
- // Request to close a logical channel created by the other end..
- // lc_num indicates the logical number whose closure is being requested.
- ProtReturnCode CloseInLC(int lc_num);
- // Ack a close channel request made by the remote end for closing a
- // channel opened by this end.
- // lc_num indicates the logical number whose closure was requested.
- ProtReturnCode AckCloseOutLCReq(int lc_num);
- // Reject a close channel request, for a logical channel opened by this end.
- ProtReturnCode RejectCloseOutLCReq(int lc_num);
- /////////////////////////////////////////////////////////////////////////
- /// Other requests and response messages
- /////////////////////////////////////////////////////////////////////////
- // Use the following to send conference request and conference response
- // messages.
- ProtReturnCode SendConfRequest(H245SigConfRequest &conference_req);
- ProtReturnCode SendConfResponse(H245SigConfResponse &conference_resp);
- /////////////////////////////////////////////////////////////////////////
- /// Query functions.
- /////////////////////////////////////////////////////////////////////////
- // Returns the remote capabilities
- ProtReturnCode GetRemoteMuxCapType(int& type);
- ProtReturnCode GetRemoteMuxCap(H245SigMuxCap& mux_cap);
- ProtReturnCode GetRemoteCapTable(H245SigCapTable& cap_table);
- ProtReturnCode GetRemoteCapDescs(H245SigCapDescs& cap_descriptors);
- // Return local capabilities.
- ProtReturnCode GetMuxCapType(int& type);
- ProtReturnCode GetMuxCap(H245SigMuxCap& mux_cap);
- ProtReturnCode GetCapTable(H245SigCapTable& cap_table);
- ProtReturnCode GetCapDescs(H245SigCapDescs& cap_descriptors);
- // Query the data type for a logical channel
- ProtReturnCode GetTypeOfInLCDataType(int lc_num, int &type);
- ProtReturnCode GetInLCDataType(int lc_num, H245SigDataType& data_type);
- ProtReturnCode GetTypeOfOutLCDataType(int lc_num, int &type);
- ProtReturnCode GetOutLCDataType(int lc_num, H245SigDataType& dataType);
- // Query the logical channel parameters for the logical channel.
- ProtReturnCode GetTypeOfInLCParams(int lc_num, int& type);
- ProtReturnCode GetInLCParams(int lc_num, H245SigMuxParams& lc_params);
- ProtReturnCode GetTypeOfOutLCParams(int lc_num, int& type);
- ProtReturnCode GetOutLCParams(int lc_num, H245SigMuxParams& lc_params);
- /////////////////////////////////////////////////////////////////////////
- // Command and Indication message notifications.
- /////////////////////////////////////////////////////////////////////////
- // An indication has arrived from the remote endpoint or the MC.
- virtual void NotifyIndication(H245SigIndication &indication) = 0;
- // A command has been sent by the remote endpoint or the MC.
- virtual void NotifyCommand(H245SigCommand &command) = 0;
- /////////////////////////////////////////////////////////////////////////
- // Master Slave Determination notifications.
- /////////////////////////////////////////////////////////////////////////
- // Notify user of an error in the master-slave determination procedure.
- // error specifies the reason for the error and is one from the set
- // H245SigMSDError
- virtual void NotifyMSDError(int error) = 0;
- // Notifies the user that master-slave determination completed
- // successfully. The decision value indicates master or slave and
- // is one from the set H245SigMSDResult.
- virtual void NotifyMSDConfirm(int decision) = 0;
- /////////////////////////////////////////////////////////////////////////
- // Terminal capabilities exchange notifications.
- /////////////////////////////////////////////////////////////////////////
- // Remote end has sent its capabilities.
- virtual void NotifyRemoteTermCaps(
- H245SigMuxCap *mux_cap,
- H245SigCapTable *cap_table,
- H245SigCapDescs *cap_descriptors) = 0;
- // Remote end has ack'ed SendTermCaps call.
- virtual void NotifyTermCapsAck() = 0;
- // Remote end has rejected SendTermCaps call.
- // cause specifies the reason for rejection and is one from the set
- // H245SigCapRejectReason . If cause is set to
- // CRR_TABLE_ENTRY_CAPACITY_EXCEEDED then exceed_type indicates whether
- // the cap table was processed or not before rejecting. If exceed_type
- // is set to TRUE, then max_entry denotes the last entry in cap table
- // that was processed before the remote end rejected the capabilities.
- // direction specifies the signalling entity that notifies the
- // rejection. If direction is CESE_OUTGOING it indicates the remote
- // end rejected the capability set sent earlier. If direction is
- // CESE_INCOMING it indicates that the remote end reset its capabilites
- // sent earlier because it did not recieve an ack from us on time.
- virtual void NotifyTermCapsReject(int cause, boolean exceed_type,
- int max_entry, int direction) = 0;
- /////////////////////////////////////////////////////////////////////////
- // Logical Channel signalling notifications.
- /////////////////////////////////////////////////////////////////////////
- // Notifies of an Error during logical channel signalling.
- // error_code is one from the set of H245SigLCSError
- virtual void NotifyOutLCError(int lc_num, int errorCode) = 0;
- virtual void NotifyInLCError(int lc_num, int error_code) = 0;
- /////////////////////////////////////////////////////////////////////////
- /// H245 Open Logical Channel Notifications.
- /////////////////////////////////////////////////////////////////////////
- // Called upon receipt of OpenLogicalChannel Request from the remote end.
- virtual void NotifyOpenLCReq(
- int lc_num,
- unsigned short port_number,
- H245SigDataType& data_type,
- H245SigMuxParams& lc_mux_params) = 0;
- // Callback to notify that the remote end has rejected the OpenLC call.
- // reason indicates cause for rejection and is one from the set
- // H245SigOpenLCRejectType
- virtual void NotifyOpenLCReject(int lc_num, int reason) = 0;
- // Callback for notifying that the remote end has ack'ed the OpenLC call.
- // Note that h225_lc_ack_params will be NULL for the non H.225 cases.
- virtual void NotifyOpenLCAck(int lc_num,
- H245SigH225AckParams *h225_lc_ack_params) = 0;
- /////////////////////////////////////////////////////////////////////////
- /// H245 Close Logical Channel Notifications.
- /////////////////////////////////////////////////////////////////////////
- // Remote endpoint has made a request to close a logical channel
- // opened by this end.
- virtual void NotifyCloseOutLCReq(int lc_num) = 0;
- // Remote end has ack'ed a CloseOutLC call.
- virtual void NotifyCloseOutLCAck(int lc_num) = 0;
- // Remote end has indicated a closure of a logical channel which it
- // opened earlier.
- // The user does not have to ACK or NAK.
- virtual void NotifyCloseInLC(int lc_num) = 0;
- // Remote end has ack'ed an earlier CloseInLC call.
- virtual void NotifyCloseInLCAck(int lc_num) = 0;
- // Remote end has rejected an earlier CloseInLC call.
- virtual void NotifyCloseInLCReject(int lc_num) = 0;
- /////////////////////////////////////////////////////////////////////////
- /// Other requests and response message notifications
- /////////////////////////////////////////////////////////////////////////
- // Notification of a conference request from the remote end
- // or a response to a request sent out previously.
- virtual void NotifyConfRequest(H245SigConfRequest &conference_req) = 0;
- virtual void NotifyConfResponse(H245SigConfResponse &conference_resp) = 0;
- /////////////////////////////////////////////////////////////////////////
- /// Begin private section, End of API specification
- /////////////////////////////////////////////////////////////////////////
- private:
- friend class H245Client;
- H245Client *client;
- H245Engine *eng;
- Logger *_logger;
- };
- extern DLLEXPORT const char * H245SigGetVersionString();
- extern DLLEXPORT unsigned long H245SigGetVersionNumber();
- #endif // __H245SIG_H__