msg.h
资源名称:h323.zip [点击查看]
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:7k
源码类别:
IP电话/视频会议
开发平台:
WINDOWS
- /*
- * $Revision: 1.9 $
- * $Date: 1999/03/15 22:49:37 $
- */
- ////////////////////////////////////////////////////////////////
- // Copyright (c) 1996,97 Lucent Technologies //
- // All Rights Reserved //
- // //
- // THIS IS UNPUBLISHED //
- // PROPRIETARY SOURCE //
- // CODE OF Lucent Technologies //
- // AND elemedia //
- // //
- ////////////////////////////////////////////////////////////////
- //
- ////////////////////////////////////////////////////////////////
- // Example programs are provided soley to demonstrate one //
- // possible use of the stack libraries and are included for //
- // instructional purposes only. You are free to use, modify //
- // and/or redistribute any portion of code in the example //
- // programs. However, such examples are not intended to //
- // represent production quality code. //
- // //
- // THE COPYRIGHT HOLDERS PROVIDE THESE EXAMPLE PROGRAMS //
- // "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED //
- // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED //
- // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A //
- // PARTICULAR PURPOSE. //
- ////////////////////////////////////////////////////////////////
- #if !defined(__MSG_H__)
- #define __MSG_H__
- #include "api/h225types.h"
- #include "api/h245types.h"
- #include "api/h245rr.h"
- #include "mq.h"
- #include "h450msgs.h"
- class H245SigIndication;
- class H245SigCommand;
- #define PROT_CALL_MSG (WM_USER + 1)
- #define PROT_EXCH_MSG (WM_USER + 2)
- #define PROT_UI_MSG (WM_USER + 3)
- #define PROT_RAS_MSG (WM_USER + 4)
- // Various Wparams
- enum
- {
- // Connection Manager related.
- CB_NEW_CONNECTION,
- CB_CONNECTION_STATUS,
- CB_CONNECTION_CLOSED,
- CB_LISTEN_ERROR,
- // Q.931 related
- CB_Q931_EVENT,
- CB_FACILITY_MESSAGE,
- // H.245 related
- CB_MSD_ERROR,
- CB_MSD_CONFIRM,
- CB_REMOTE_TERM_CAPS,
- CB_TERM_CAPS_ACK,
- CB_TERM_CAPS_REJECT,
- CB_OUT_LC_ERROR,
- CB_IN_LC_ERROR,
- CB_OLC_REQUEST,
- CB_OLC_REJECT,
- CB_OLC_ACK,
- CB_CLOSE_OUT_LC_REQUEST,
- CB_CLOSE_OUT_LC_ACK,
- CB_CLOSE_IN_LC,
- CB_CLOSE_IN_LC_ACK,
- CB_CLOSE_IN_LC_REJECT,
- CB_NOTIFY_CMD,
- CB_NOTIFY_IND,
- CB_CONF_REQ,
- CB_CONF_RESP,
- CB_RAS_EVENT,
- CB_SEND_ARQ,
- // Messages sent from the user interface.
- UI_CMD_PLACE_CALL,
- UI_CMD_HANGUP,
- UI_CMD_FACILITY,
- UI_CMD_EXIT,
- UI_CMD_CTRL,
- // other exchange messages..
- XC_CALL_DROPPED
- };
- class CBData
- {
- public:
- virtual ~CBData()
- {
- }
- };
- class Q931Evt : public CBData
- {
- public:
- int old_state;
- int new_state;
- int event_type;
- Q931Message *message;
- H225CSUUIE* ie;
- Q931Error *err;
- Q931Evt()
- {
- old_state = new_state = 0;
- ie = NULL;
- message = NULL;
- err = NULL;
- event_type = 0;
- }
- ~Q931Evt()
- {
- if (ie)
- {
- delete ie;
- }
- if (message)
- {
- delete message;
- }
- if(err)
- {
- delete err;
- }
- }
- };
- class MSDError : public CBData
- {
- public:
- H323Call *call;
- int error;
- };
- class MSDConfirm : public CBData
- {
- public:
- H323Call *call;
- int decision;
- };
- class RemoteTermCaps : public CBData
- {
- public:
- RemoteTermCaps()
- {
- mux_cap = NULL;
- cap_table = NULL;
- cap_desc = NULL;
- }
- H323Call *call;
- H245SigMuxCap *mux_cap;
- H245SigH225Cap _h225_mux_cap;
- H245SigCapTable _cap_table;
- H245SigCapTable *cap_table;
- H245SigCapDescs _cap_desc;
- H245SigCapDescs *cap_desc;
- };
- class TermCapsReject : public CBData
- {
- public:
- H323Call *call;
- int cause;
- int direction;
- };
- // used by outLCError and inLCError
- class LCError : public CBData
- {
- public:
- H323Call *call;
- int lc_num;
- int error;
- };
- class OLCReq : public CBData
- {
- public:
- H323Call *call;
- int lc_num;
- unsigned short port;
- H245SigDataType *data_type;
- H245SigVidDataType vid;
- H245SigAudDataType aud;
- H245SigNonStdDataType non_std;
- H245SigMuxParams *mux_params;
- H245SigH225Params h225_params;
- };
- class OLCReject : public CBData
- {
- public:
- H323Call *call;
- int lc_num;
- int reason;
- };
- class OLCAck : public CBData
- {
- public:
- H323Call *call;
- int lc_num;
- H245SigH225AckParams* ack_params;
- H245SigH225AckParams _ack_params;
- };
- class CloseXXX : public CBData
- {
- public:
- H323Call *call;
- int lc_num;
- };
- class H245IND : public CBData
- {
- public:
- H245IND()
- {
- ind = NULL;
- }
- ~H245IND()
- {
- delete ind;
- }
- H323Call *call;
- H245SigIndication *ind;
- };
- class H245CMD : public CBData
- {
- public:
- H245CMD()
- {
- cmd = NULL;
- }
- ~H245CMD()
- {
- delete cmd;
- }
- H323Call *call;
- H245SigCommand *cmd;
- };
- class TermCapsAck : public CBData
- {
- public:
- H323Call *call;
- };
- class ConfRequest : public CBData
- {
- public:
- H245SigConfRequest req;
- };
- class ConfResponse : public CBData
- {
- public:
- H245SigConfResponse resp;
- };
- class SendARQdata : public CBData
- {
- public:
- H323Call *call;
- int index;
- char e164dst[32];
- char e164src[32];
- char h323IDdst[32];
- char h323IDsrc[32];
- struct sockaddr_in *callsigdst;
- SendARQdata()
- {
- e164dst[0] = ' ';
- e164src[0] = ' ';
- h323IDdst[0] = ' ';
- h323IDsrc[0] = ' ';
- callsigdst = NULL;
- }
- ~SendARQdata()
- {
- if (callsigdst)
- delete callsigdst;
- }
- };
- class SendRRQdata : public CBData
- {
- public:
- char e164src[32];
- char h323IDsrc[32];
- SendRRQdata()
- {
- e164src[0] = ' ';
- h323IDsrc[0] = ' ';
- }
- };
- class XchgNewConnection : public CBData
- {
- public:
- int identifier;
- int conn_ref;
- sockaddr_in new_addr;
- };
- class XchgConnectionStatus : public CBData
- {
- public:
- ConnectionEntity *conn;
- ProtReturnCode status;
- };
- class XchgConnectionClosed : public CBData
- {
- public:
- ConnectionEntity *conn;
- ProtReturnCode reason;
- };
- class XchgListenError : public CBData
- {
- public:
- int identifier;
- ProtReturnCode status;
- };
- #if defined(USE_RAS)
- class XchgRASMessage : public CBData
- {
- public:
- XchgRASMessage()
- {
- ras_message = NULL;
- }
- ~XchgRASMessage()
- {
- delete ras_message;
- }
- struct sockaddr *origin;
- H225RASMessage *ras_message;
- };
- #endif
- class UICmdPlaceCall : public CBData
- {
- public:
- sockaddr_in remote_addr;
- // Addition call info if required.
- // Like phone number to call etc..
- char dest_addr[256];
- int dest_addr_length;
- int do_faststart;
- int transfer_flag;
- int invokeID;
- char callID[5];
- int parent_index;
- };
- class UICmdFacility : public CBData
- {
- public:
- UICmdFacility()
- {
- suppsvcs = NULL;
- }
- ~UICmdFacility()
- {
- if (suppsvcs)
- deleteSSlist(suppsvcs);
- }
- int line_no;
- H450SSseq *suppsvcs;
- };
- class UICmdHangup : public CBData
- {
- public:
- int line_no;
- int transfer_flag;
- };
- class UICmdExit : public CBData
- {
- public:
- int dummy;
- };
- // the values for the command field are in the following
- #define UI_CTRL_CMD_ENABLE_FASTSTART 1
- #define UI_CTRL_CMD_DISABLE_FASTSTART 2
- #define UI_CTRL_CMD_ENABLE_TUNNELING 3
- #define UI_CTRL_CMD_DISABLE_TUNNELING 4
- #define UI_CTRL_CMD_ENABLE_OVERLAP_SEND 5
- #define UI_CTRL_CMD_DISABLE_OVERLAP_SEND 6
- #define UI_CTRL_CMD_ENABLE_ALERTING 7
- #define UI_CTRL_CMD_DISABLE_ALERTING 8
- #define UI_CTRL_CMD_ENABLE_CALLPROC 9
- #define UI_CTRL_CMD_DISABLE_CALLPROC 10
- class UICmdCtrl : public CBData
- {
- public:
- int command[32];
- int num_cmds;
- };
- #endif