Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
3.1 KiB

  1. /*******************************************************************************
  2. Module: work.h
  3. Author: Qianbo Huai
  4. Abstract:
  5. defines all the classes for the bridge test application
  6. *******************************************************************************/
  7. #ifndef _WORK_H
  8. #define _WORK_H
  9. #include "resource.h"
  10. // H323 call listener sends event to dialog box
  11. #define WM_PRIVATETAPIEVENT WM_USER+101
  12. // helper
  13. void DoMessage (LPWSTR pszMessage);
  14. class CBridge;
  15. class CBridgeCall;
  16. class CTAPIEventNotification;
  17. class CBridge
  18. /*//////////////////////////////////////////////////////////////////////////////
  19. encapsulates methods operated on ITTAPI, ITAddress.
  20. contains the bridge call object
  21. ////*/
  22. {
  23. public:
  24. CBridge () {};
  25. ~CBridge () {};
  26. // helper
  27. HRESULT FindAddress (long dwAddrType, BSTR bstrAddrName, long lMediaType, ITAddress **ppAddr);
  28. BOOL AddressSupportsMediaType (ITAddress *pAddr, long lMediaType);
  29. // methods related with tapi
  30. HRESULT InitTapi ();
  31. void ShutdownTapi ();
  32. // methods related with terminal support
  33. HRESULT GetSDPAddress (ITAddress **ppAddress);
  34. // methods related with calls
  35. HRESULT CreateH323Call (IDispatch *pEvent);
  36. HRESULT CreateSDPCall ();
  37. HRESULT BridgeCalls ();
  38. void Clear ();
  39. BOOL HasH323Call ();
  40. private:
  41. ITTAPI *m_pTapi;
  42. ITAddress *m_pH323Addr;
  43. ITAddress *m_pSDPAddr;
  44. long m_lH323MediaType;
  45. long m_lSDPMediaType;
  46. CBridgeCall *m_pBridgeCall;
  47. };
  48. /*//////////////////////////////////////////////////////////////////////////////
  49. encapsulates methods operated on ITBasicCallControl
  50. ////*/
  51. class CBridgeCall
  52. {
  53. public:
  54. CBridgeCall (CBridge *pBridge);
  55. ~CBridgeCall ();
  56. void SetH323Call (ITBasicCallControl *pCall)
  57. {
  58. pCall->AddRef ();
  59. m_pH323Call = pCall;
  60. }
  61. void SetSDPCall (ITBasicCallControl *pCall)
  62. {
  63. pCall->AddRef ();
  64. m_pSDPCall = pCall;
  65. }
  66. BOOL HasH323Call ()
  67. {
  68. return (m_pH323Call!=NULL);
  69. }
  70. HRESULT SelectBridgeTerminals ();
  71. HRESULT SetupParticipantInfo ();
  72. HRESULT SetMulticastMode ();
  73. HRESULT BridgeCalls ();
  74. void Clear ();
  75. private:
  76. BOOL IsStream (ITStream *pStream, long lMediaType, TERMINAL_DIRECTION tdDirection);
  77. private:
  78. CBridge *m_pBridge;
  79. ITBasicCallControl *m_pH323Call;
  80. ITBasicCallControl *m_pSDPCall;
  81. };
  82. /*//////////////////////////////////////////////////////////////////////////////
  83. used by ITTAPI to notify event coming
  84. ////*/
  85. class CTAPIEventNotification
  86. :public ITTAPIEventNotification
  87. {
  88. public:
  89. CTAPIEventNotification ()
  90. {
  91. m_dwRefCount = 1;
  92. }
  93. ~CTAPIEventNotification () {}
  94. // IUnknow stuff
  95. HRESULT STDMETHODCALLTYPE QueryInterface (REFIID iid, void **ppvObj);
  96. ULONG STDMETHODCALLTYPE AddRef ();
  97. ULONG STDMETHODCALLTYPE Release ();
  98. HRESULT STDMETHODCALLTYPE Event (TAPI_EVENT TapiEvent, IDispatch *pEvent);
  99. private:
  100. long m_dwRefCount;
  101. };
  102. #endif // _WORK_H