h225csp.h
资源名称:h323.zip [点击查看]
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:8k
源码类别:
IP电话/视频会议
开发平台:
WINDOWS
- /*
- * $Revision: 1.8 $
- * $Date: 1998/05/19 18:29:20 $
- */
- ////////////////////////////////////////////////////////////////
- // 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 : h225csp.h //
- // //
- // History: //
- // //
- // 3_Mar_1997 Created //
- // 28_Apr_1997 Code Review PASS1. //
- // 29_Apr_1997 Code Review PASS2. //
- // 17_Sep_1997 New variant of InvokeCCPrim added, namely //
- // InvokeCCPrim(int, Q931Message *) //
- // 25_Sep_1997 Comments for NotifyEvent call //
- // 17_Oct_1997 H225 version made short[] from char[] //
- // 11_Nov_1997 Added the GetCRV call //
- // 10_Dec_1997 Destructor made virtual //
- // 06_Apr_1998 Added SetCallID and GetCallID in H225CSProtocol//
- // Addition of conference_id_length member. //
- // 08_Apr_1998 h225_version no longer static(private change). //
- // H225 version made long[] from short[] //
- // 08_May_1998 New overloaded methods for set/get protocolids.//
- // //
- /////////////////////////////////////////////////////////////////
- #if !defined(__H225CSP_H__)
- #define __H225CSP_H__
- #include "util/platform.h"
- #include "api/h225csperr.h"
- #include "api/h225types.h"
- #include "api/connmgr.h"
- class H225Q931Client;
- class Logger;
- // The H225 Call signalling protocol API class.
- class DLLEXPORT H225CSProtocol : public ConnectionEntity
- {
- public:
- H225CSProtocol(int identifier,
- H225CSEndpointType& endpoint_type,
- ProtReturnCode& result,
- char *display_string = NULL);
- virtual ~H225CSProtocol();
- ProtReturnCode GetEndpointType(H225CSEndpointType&);
- // Methods to get/set conference id.
- ProtReturnCode GetConfID(unsigned char*& buf, int& length);
- ProtReturnCode SetConfID(unsigned char* buf, int length);
- // Methods to get/set call identifier.
- ProtReturnCode GetCallID(H225CSCallID& call_id);
- ProtReturnCode SetCallID(H225CSCallID& call_id);
- // Method to get protocolid, this contains the H225 version number
- // In the overloaded versions, the parameters are integers
- // that refer to version numbers. version is one of H225VersionNumber
- // NOTE: setting the protocolid will result in the pid being set
- // to this value in future messages. The default is version 2.
- ProtReturnCode GetProtocolID(unsigned char*& buf, int& length);
- ProtReturnCode SetProtocolID(int version);
- ProtReturnCode GetProtocolID(int &version);
- // Method to get the crv associated with this call.
- // Note: for outgoing calls, the crv is allocated only at the
- // time of sending the setup message. An error is returned
- // if an attempt is made to retrive the crv prior to this stage.
- // For incoming messages, the crv is also available via the
- // Q931Message::GetCRV method.
- ProtReturnCode GetCRV(unsigned short& crv);
- // Method to respond to an incoming message, or initiate an outgoing
- // message.
- //
- // primitive is one of the following which specifies what message
- // to send out next.
- // CCP_SETUP_REQUEST
- // CCP_PROCEEDING_REQUEST
- // CCP_ALERTING_REQUEST
- // CCP_SETUP_RESPONSE
- // CCP_REJECT_REQUEST
- // CCP_RELEASE_REQUEST
- //
- // message specifies any additional information elements, which the
- // user requires to be sent out in the message, that is a result of
- // the primitive passed. User specified information elements will
- // override internally generated ones. Note that there is an
- // additional parameter to specifiy the user to user information
- // elements. If present in message it will override the parameter ie.
- //
- // ie specifies the user to user information element, to be sent
- // as a part of the message. Note that messages sent out as a
- // result of the allowed primitives must mandatorily contain
- // the user to user information element, as dictated by H.225
- ProtReturnCode InvokeCCPrim(int primitive,
- Q931Message* message, H225CSUUIE& ie);
- // Variant of the previous InvokeCCPrim function. Some of the Q.931
- // messages do not have the user to user information element as a
- // part of the message. Use this member to send out such messages.
- //
- // primitive specifies what message to send out next. It can be one of
- // CCP_SETUP_REQUEST
- // CCP_PROCEEDING_REQUEST
- // CCP_ALERTING_REQUEST
- // CCP_SETUP_RESPONSE
- // CCP_REJECT_REQUEST
- // CCP_RELEASE_REQUEST
- // CCP_STATUS_ENQUIRY
- // CCP_STATUS
- //
- // message specifies any additional information elements, which the
- // user requires to be sent out in the message, that is a result of
- // the primitive passed. User specified information elements will
- // override internally generated ones.
- //
- // NOTE: Use InvokeCCPrim(int , Q931Message* , H225CSUUIE& ) to
- // send messages that have a mandatory User to User information
- // element. The user is responsible for making sure that a user to
- // user information element is present if the
- // InvokeCCPrim(int , Q931Message *) is called for such messages,
- // say for example CCP_ALERTING_REQUEST.
- //
- // NOTE regarding CCP_STATUS: note that the stack generates a status
- // message internally for cases when either a status enquiry was
- // sent by the remote end or when a packet arrives for an inconsistant
- // state. CCP_STATUS is to be used for cases where the users decide
- // to send a status message on their own without any stimulus. Also
- // note that the cause information element is optional under H.323
- // and the callstate ie is generated internally by default.
- ProtReturnCode InvokeCCPrim(int primitive, Q931Message* message);
- // Set the value for the timeouts used by the Q.931 engine.
- // timer_name selects the timer value to modify, and is from
- // enum Q931TimerTypes and value specifies in seconds,
- // the timeout to use in place of the internal defaults.
- ProtReturnCode SetTimeout(int timer_name, int value);
- // Method returns the current state of the q931 finite state
- // machine.
- int GetCallState();
- // Method to return the Call direction, whether outgoing or
- // incoming.
- int GetCallDirection();
- // Callback to notify user of a Q931 event. old_state and
- // new_state specify the state of the Q931 Finite State Machince
- // before and after the occurence of the event. If the event
- // is arrival of a network message then "ie" points to the
- // user to user information element in that message (if any).
- // Note: event can be NULL for cases where notification
- // is for informational purposes (like a state transition
- // in the state machine when a setup is sent out).
- virtual void NotifyEvent(int old_state, int new_state,
- Q931Event* event, H225CSUUIE* ie) = 0;
- private:
- friend class H225Q931Client;
- H225CSEndpointType* endpoint_type;
- H225Q931Client* callsig;
- H225CSUUIE* current_uuie;
- Q931Message* other_ies;
- unsigned char conference_id[16];
- int conference_id_length;
- H225CSCallID call_id;
- unsigned long h225_version[6];
- Logger *_logger;
- };
- extern DLLEXPORT const char * H225CSGetVersionString();
- extern DLLEXPORT unsigned long H225CSGetVersionNumber();
- #endif // __H225CSP_H__