msg.h
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:7k
源码类别:

IP电话/视频会议

开发平台:

WINDOWS

  1. /*
  2.  * $Revision: 1.9 $
  3.  * $Date: 1999/03/15 22:49:37 $
  4.  */
  5. ////////////////////////////////////////////////////////////////
  6. //               Copyright (c) 1996,97 Lucent Technologies    //
  7. //                       All Rights Reserved                  //
  8. //                                                            //
  9. //                       THIS IS UNPUBLISHED                  //
  10. //                       PROPRIETARY SOURCE                   //
  11. //                   CODE OF Lucent Technologies              //
  12. // AND elemedia   //
  13. //                                                            //
  14. ////////////////////////////////////////////////////////////////
  15. //
  16. ////////////////////////////////////////////////////////////////
  17. // Example programs are provided soley to demonstrate one     //
  18. // possible use of the stack libraries and are included for   //
  19. // instructional purposes only.  You are free to use, modify  //
  20. // and/or redistribute any portion of code in the example     //
  21. // programs.  However, such examples are not intended to      //
  22. // represent production quality code.                         //
  23. //                                                            //
  24. // THE COPYRIGHT HOLDERS PROVIDE THESE EXAMPLE PROGRAMS       //
  25. // "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED     //
  26. // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED     //
  27. // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A            //
  28. // PARTICULAR PURPOSE.                                        //
  29. ////////////////////////////////////////////////////////////////
  30. #if !defined(__MSG_H__)
  31. #define __MSG_H__
  32. #include "api/h225types.h"
  33. #include "api/h245types.h"
  34. #include "api/h245rr.h"
  35. #include "mq.h"
  36. #include "h450msgs.h"
  37. class H245SigIndication;
  38. class H245SigCommand;
  39. #define PROT_CALL_MSG (WM_USER + 1)
  40. #define PROT_EXCH_MSG (WM_USER + 2)
  41. #define PROT_UI_MSG (WM_USER + 3)
  42. #define PROT_RAS_MSG (WM_USER + 4)
  43. // Various Wparams
  44. enum 
  45. {
  46. // Connection Manager related.
  47. CB_NEW_CONNECTION,
  48. CB_CONNECTION_STATUS,
  49. CB_CONNECTION_CLOSED,
  50. CB_LISTEN_ERROR,
  51. // Q.931 related
  52. CB_Q931_EVENT,
  53. CB_FACILITY_MESSAGE,
  54. // H.245 related
  55. CB_MSD_ERROR,
  56. CB_MSD_CONFIRM,
  57. CB_REMOTE_TERM_CAPS,
  58. CB_TERM_CAPS_ACK,
  59. CB_TERM_CAPS_REJECT,
  60. CB_OUT_LC_ERROR,
  61. CB_IN_LC_ERROR,
  62. CB_OLC_REQUEST,
  63. CB_OLC_REJECT,
  64. CB_OLC_ACK,
  65. CB_CLOSE_OUT_LC_REQUEST,
  66. CB_CLOSE_OUT_LC_ACK,
  67. CB_CLOSE_IN_LC,
  68. CB_CLOSE_IN_LC_ACK,
  69. CB_CLOSE_IN_LC_REJECT,
  70. CB_NOTIFY_CMD,
  71. CB_NOTIFY_IND,
  72. CB_CONF_REQ,
  73. CB_CONF_RESP,
  74. CB_RAS_EVENT,
  75. CB_SEND_ARQ,
  76. // Messages sent from the user interface.
  77. UI_CMD_PLACE_CALL,
  78. UI_CMD_HANGUP,
  79. UI_CMD_FACILITY,
  80. UI_CMD_EXIT,
  81. UI_CMD_CTRL,
  82. // other exchange messages..
  83. XC_CALL_DROPPED
  84. };
  85. class CBData
  86. {
  87. public:
  88. virtual ~CBData()
  89. {
  90. }
  91. };
  92. class Q931Evt : public CBData
  93. {
  94. public:
  95. int old_state;
  96. int new_state;
  97. int event_type;
  98. Q931Message *message;
  99. H225CSUUIE* ie;
  100. Q931Error *err;
  101. Q931Evt()
  102. {
  103. old_state = new_state = 0;
  104. ie = NULL;
  105. message = NULL;
  106. err = NULL;
  107. event_type = 0;
  108. }
  109. ~Q931Evt()
  110. {
  111. if (ie)
  112. {
  113. delete ie;
  114. }
  115. if (message)
  116. {
  117. delete message;
  118. }
  119. if(err)
  120. {
  121. delete err;
  122. }
  123. }
  124. };
  125. class MSDError : public CBData
  126. {
  127. public:
  128. H323Call *call;
  129. int error;
  130. };
  131. class MSDConfirm : public CBData
  132. {
  133. public:
  134. H323Call *call;
  135. int decision;
  136. };
  137. class RemoteTermCaps : public CBData
  138. {
  139. public:
  140. RemoteTermCaps()
  141. {
  142. mux_cap = NULL;
  143. cap_table = NULL;
  144. cap_desc = NULL;
  145. }
  146. H323Call *call;
  147. H245SigMuxCap *mux_cap;
  148. H245SigH225Cap _h225_mux_cap;
  149. H245SigCapTable _cap_table;
  150. H245SigCapTable *cap_table;
  151. H245SigCapDescs _cap_desc;
  152. H245SigCapDescs *cap_desc;
  153. };
  154. class TermCapsReject : public CBData
  155. {
  156. public:
  157. H323Call *call;
  158. int cause;
  159. int direction;
  160. };
  161. // used by outLCError and inLCError
  162. class LCError : public CBData
  163. {
  164. public:
  165. H323Call *call;
  166. int lc_num;
  167. int error;
  168. };
  169. class OLCReq : public CBData
  170. {
  171. public:
  172. H323Call *call;
  173. int lc_num;
  174. unsigned short port;
  175. H245SigDataType *data_type;
  176. H245SigVidDataType vid;
  177. H245SigAudDataType aud;
  178. H245SigNonStdDataType non_std;
  179. H245SigMuxParams *mux_params;
  180. H245SigH225Params h225_params;
  181. };
  182. class OLCReject : public CBData
  183. {
  184. public:
  185. H323Call *call;
  186. int lc_num;
  187. int reason;
  188. };
  189. class OLCAck : public CBData
  190. {
  191. public:
  192. H323Call *call;
  193. int lc_num;
  194. H245SigH225AckParams* ack_params;
  195. H245SigH225AckParams _ack_params;
  196. };
  197. class CloseXXX : public CBData
  198. {
  199. public:
  200. H323Call *call;
  201. int lc_num;
  202. };
  203. class H245IND : public CBData
  204. {
  205. public:
  206. H245IND()
  207. {
  208. ind = NULL;
  209. }
  210. ~H245IND()
  211. {
  212. delete ind;
  213. }
  214. H323Call *call;
  215. H245SigIndication *ind;
  216. };
  217. class H245CMD : public CBData
  218. {
  219. public:
  220. H245CMD()
  221. {
  222. cmd = NULL;
  223. }
  224. ~H245CMD()
  225. {
  226. delete cmd;
  227. }
  228. H323Call *call;
  229. H245SigCommand *cmd;
  230. };
  231. class TermCapsAck : public CBData
  232. {
  233. public:
  234. H323Call *call;
  235. };
  236. class ConfRequest : public CBData
  237. {
  238. public:
  239. H245SigConfRequest req;
  240. };
  241. class ConfResponse : public CBData
  242. {
  243. public:
  244. H245SigConfResponse resp;
  245. };
  246. class SendARQdata : public CBData
  247. {
  248. public:
  249. H323Call *call;
  250. int index;
  251. char e164dst[32];
  252. char e164src[32];
  253. char h323IDdst[32];
  254. char h323IDsrc[32];
  255. struct sockaddr_in  *callsigdst;
  256. SendARQdata()
  257. {
  258. e164dst[0] = '';
  259. e164src[0] = '';
  260. h323IDdst[0] = '';
  261. h323IDsrc[0] = '';
  262. callsigdst = NULL;
  263. }
  264. ~SendARQdata()
  265. {
  266. if (callsigdst) 
  267. delete callsigdst;
  268. }
  269. };
  270. class SendRRQdata : public CBData
  271. {
  272. public:
  273. char e164src[32];
  274. char h323IDsrc[32];
  275. SendRRQdata()
  276. {
  277. e164src[0] = '';
  278. h323IDsrc[0] = '';
  279. }
  280. };
  281. class XchgNewConnection : public CBData
  282. {
  283. public:
  284. int identifier;
  285. int conn_ref;
  286. sockaddr_in new_addr;
  287. };
  288. class XchgConnectionStatus : public CBData
  289. {
  290. public:
  291. ConnectionEntity *conn;
  292. ProtReturnCode status;
  293. };
  294. class XchgConnectionClosed : public CBData
  295. {
  296. public:
  297. ConnectionEntity *conn;
  298. ProtReturnCode reason;
  299. };
  300. class XchgListenError : public CBData
  301. {
  302. public:
  303. int identifier;
  304. ProtReturnCode status;
  305. };
  306. #if defined(USE_RAS)
  307. class XchgRASMessage : public CBData
  308. {
  309. public:
  310. XchgRASMessage()
  311. {
  312. ras_message = NULL;
  313. }
  314. ~XchgRASMessage()
  315. {
  316. delete ras_message;
  317. }
  318. struct sockaddr *origin;
  319. H225RASMessage *ras_message;
  320. };
  321. #endif
  322. class UICmdPlaceCall : public CBData
  323. {
  324. public:
  325. sockaddr_in remote_addr; 
  326. // Addition call info if required.
  327. // Like phone number to call etc..
  328. char dest_addr[256];
  329. int dest_addr_length;
  330. int do_faststart;
  331. int transfer_flag;
  332. int invokeID;
  333. char callID[5];
  334. int parent_index;
  335.  
  336. };
  337. class UICmdFacility : public CBData
  338. {
  339. public:
  340. UICmdFacility()
  341. {
  342. suppsvcs = NULL;
  343. }
  344. ~UICmdFacility()
  345. {
  346. if (suppsvcs)
  347. deleteSSlist(suppsvcs);
  348. }
  349. int line_no;
  350. H450SSseq *suppsvcs;
  351. };
  352. class UICmdHangup : public CBData
  353. {
  354. public:
  355. int line_no;
  356. int transfer_flag;
  357. };
  358. class UICmdExit  : public CBData
  359. {
  360. public:
  361. int dummy;
  362. };
  363. // the values for the command field are in the following
  364. #define UI_CTRL_CMD_ENABLE_FASTSTART 1
  365. #define UI_CTRL_CMD_DISABLE_FASTSTART 2
  366. #define UI_CTRL_CMD_ENABLE_TUNNELING 3
  367. #define UI_CTRL_CMD_DISABLE_TUNNELING 4
  368. #define UI_CTRL_CMD_ENABLE_OVERLAP_SEND 5
  369. #define UI_CTRL_CMD_DISABLE_OVERLAP_SEND 6
  370. #define UI_CTRL_CMD_ENABLE_ALERTING 7
  371. #define UI_CTRL_CMD_DISABLE_ALERTING 8
  372. #define UI_CTRL_CMD_ENABLE_CALLPROC 9
  373. #define UI_CTRL_CMD_DISABLE_CALLPROC 10
  374. class UICmdCtrl : public CBData
  375. {
  376. public:
  377. int command[32];
  378. int num_cmds;
  379. };
  380. #endif