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.

9688 lines
351 KiB

  1. #include "precomp.h"
  2. DEBUG_FILEZONE(ZONE_T120_SAP);
  3. /*
  4. * csap.cpp
  5. *
  6. * Copyright (c) 1995 by DataBeam Corporation, Lexington, KY
  7. *
  8. * Abstract:
  9. * This implementation file for the CControlSAP class contains Service
  10. * Access entry and exit points specific to the Node Controller. This
  11. * module inherits the common entry and exit points from the CBaseSap object.
  12. * On request and responses, parameter checking is performed to ensure that
  13. * they can be properly processed. Queuing and flushing of out bound
  14. * messages is taken care of in the base class.
  15. *
  16. * Protected Instance Variables:
  17. * See file SAP.CPP for definitions of instance variables.
  18. *
  19. * Private Instance Variables:
  20. * m_nJoinResponseTag:
  21. * This tag is used to match join request with join responses from the
  22. * node controller.
  23. *
  24. * m_JoinResponseTagList2:
  25. * This list keeps up with all the outstanding join response tags.
  26. * Tags are added to this list on a join indication and removed
  27. * from this list on a Join response.
  28. *
  29. * Private Member Functions:
  30. * IsNumericNameValid
  31. * This routine is used to validate a numeric string by checking to
  32. * make sure that none of the constraints imposed by the ASN.1
  33. * specification are violated.
  34. * IsTextNameValid
  35. * This routine is used to validate a text string by checking to make
  36. * sure that none of the constraints imposed by the ASN.1 specification
  37. * are violated.
  38. * QueueJoinIndication
  39. * This routine is used to place join indications into the queue of
  40. * messages to be delivered to the node controller.
  41. * HandleResourceFailure
  42. * This routine is used to clean up after any resource allocation
  43. * failures which may have occurred by sending a status indication
  44. * reporting the error.
  45. * FreeCallbackMessage
  46. * This routine is used to free up any data which was allocated in
  47. * order to send a callback message to the node controller.
  48. * RetrieveUserDataList
  49. * This routine is used to fill in a user data list using a
  50. * CUserDataListContainer container. The memory needed to hold the user data
  51. * will be allocated by this routine.
  52. *
  53. * Caveats:
  54. * None.
  55. *
  56. * Author:
  57. * blp
  58. */
  59. #include "ms_util.h"
  60. #include "csap.h"
  61. #include "conf.h"
  62. #include "gcontrol.h"
  63. // Defintions to support Join Response Tag hash list
  64. #define MAXIMUM_CONFERENCE_NAME_LENGTH 255
  65. // This is how much time the apps have to cleanup with MCS and GCC
  66. // after GCCCleanup is called. They may be terminated if they do not
  67. // cleanup in this amount of time.
  68. #define PROCESS_TERMINATE_TIME 5000
  69. /*
  70. * Static variables used within the C to C++ converter.
  71. *
  72. * Static_Controller
  73. * This is a pointer to the one-and-only controller created within the
  74. * GCC system. This object is created during
  75. * GCCStartup by the process
  76. * that is taking on the responsibilities of the node controller.
  77. */
  78. GCCController *g_pGCCController = NULL;
  79. CControlSAP *g_pControlSap = NULL;
  80. char g_szGCCWndClassName[24];
  81. // The MCS main thread handle
  82. extern HANDLE g_hMCSThread;
  83. /*
  84. * GCCError GCCStartup()
  85. *
  86. * Public
  87. *
  88. * Functional Description:
  89. * This API entry point is used to initialize the GCC DLL for action. It
  90. * creates an instance of the Controller, which controls all activity
  91. * during a GCC session. Note that there is only one instance of the
  92. * Controller, no matter how many applications are utilizing GCC
  93. * services.
  94. */
  95. GCCError WINAPI T120_CreateControlSAP
  96. (
  97. IT120ControlSAP **ppIControlSap,
  98. LPVOID pUserDefined,
  99. LPFN_T120_CONTROL_SAP_CB pfnControlSapCallback
  100. )
  101. {
  102. GCCError rc;
  103. if (NULL != ppIControlSap && NULL != pfnControlSapCallback)
  104. {
  105. if (NULL == g_pGCCController && NULL == g_pControlSap)
  106. {
  107. //
  108. // Create the window class for all the SAPs, including both
  109. // control SAP and applet SAP.
  110. //
  111. WNDCLASS wc;
  112. ::wsprintfA(g_szGCCWndClassName, "GCC%0lx_%0lx", (UINT) ::GetCurrentProcessId(), (UINT) ::GetTickCount());
  113. ASSERT(::lstrlenA(g_szGCCWndClassName) < sizeof(g_szGCCWndClassName));
  114. ::ZeroMemory(&wc, sizeof(wc));
  115. // wc.style = 0;
  116. wc.lpfnWndProc = SapNotifyWndProc;
  117. // wc.cbClsExtra = 0;
  118. // wc.cbWndExtra = 0;
  119. wc.hInstance = g_hDllInst;
  120. // wc.hIcon = NULL;
  121. // wc.hbrBackground = NULL;
  122. // wc.hCursor = NULL;
  123. // wc.lpszMenuName = NULL;
  124. wc.lpszClassName = g_szGCCWndClassName;
  125. if (::RegisterClass(&wc))
  126. {
  127. /*
  128. * This process is to become the node controller. Create a
  129. * controller object to carry out these duties.
  130. */
  131. DBG_SAVE_FILE_LINE
  132. g_pGCCController = new GCCController(&rc);
  133. if (NULL != g_pGCCController && GCC_NO_ERROR == rc)
  134. {
  135. /*
  136. ** Create the control SAP. Note that the Node Controller
  137. ** interface must be in place before this is called so
  138. ** that the control SAP can register itself.
  139. */
  140. DBG_SAVE_FILE_LINE
  141. g_pControlSap = new CControlSAP();
  142. if (NULL != g_pControlSap)
  143. {
  144. /*
  145. * Tell the application interface object what it
  146. * needs to know send callbacks to the node
  147. * controller.
  148. */
  149. TRACE_OUT(("T120_CreateControlSAP: controller successfully created"));
  150. *ppIControlSap = g_pControlSap;
  151. g_pControlSap->RegisterNodeController(pfnControlSapCallback, pUserDefined);
  152. }
  153. else
  154. {
  155. ERROR_OUT(("T120_CreateControlSAP: can't create CControlSAP"));
  156. rc = GCC_ALLOCATION_FAILURE;
  157. }
  158. }
  159. else
  160. {
  161. ERROR_OUT(("T120_CreateControlSAP: deleting faulty controller"));
  162. if (NULL != g_pGCCController)
  163. {
  164. g_pGCCController->Release();
  165. g_pGCCController = NULL;
  166. }
  167. rc = GCC_ALLOCATION_FAILURE;
  168. }
  169. }
  170. else
  171. {
  172. ERROR_OUT(("T120_CreateControlSAP: can't register window class, err=%u", (UINT) GetLastError()));
  173. rc = GCC_ALLOCATION_FAILURE;
  174. }
  175. }
  176. else
  177. {
  178. ERROR_OUT(("T120_CreateControlSAP: GCC has already been initialized, g_pControlSap=0x%x, g_pGCCCotnroller=0x%x", g_pControlSap, g_pGCCController));
  179. rc = GCC_ALREADY_INITIALIZED;
  180. }
  181. }
  182. else
  183. {
  184. ERROR_OUT(("T120_CreateControlSAP: null pointers, ppIControlSap=0x%x, pfnControlSapCallback=0x%x", ppIControlSap, pfnControlSapCallback));
  185. rc = GCC_INVALID_PARAMETER;
  186. }
  187. return rc;
  188. }
  189. /*
  190. * GCCError GCCCleanup()
  191. *
  192. * Public
  193. *
  194. * Functional Description:
  195. * This function deletes the controller (if one exists). It is VERY
  196. * important that only the routine that successfully called
  197. * GCCInitialize call this routine. Once this routine has been called,
  198. * all other GCC calls will fail.
  199. */
  200. void CControlSAP::ReleaseInterface ( void )
  201. {
  202. UnregisterNodeController();
  203. /*
  204. * Destroy the controller, which will clean up all
  205. * resources in use at this time. Then reset the flag
  206. * indicating that GCC is initialized (since it no
  207. * longer is).
  208. */
  209. TRACE_OUT(("GCCControlSap::ReleaseInterface: deleting controller"));
  210. g_pGCCController->Release();
  211. // This is how much time the apps have to cleanup with MCS and GCC
  212. // after GCCCleanup is called. They may be terminated if they do not
  213. // cleanup in this amount of time.
  214. if (WAIT_TIMEOUT == ::WaitForSingleObject(g_hMCSThread, PROCESS_TERMINATE_TIME))
  215. {
  216. WARNING_OUT(("GCCControlSap::ReleaseInterface: Timed out waiting for MCS thread to exit. Apps did not cleanup in time."));
  217. }
  218. ::CloseHandle(g_hMCSThread);
  219. g_hMCSThread = NULL;
  220. //
  221. // LONCHANC: We should free control sap after exiting the GCC work thread
  222. // because the work thread may still use the control sap to flush messages.
  223. //
  224. Release();
  225. ::UnregisterClass(g_szGCCWndClassName, g_hDllInst);
  226. }
  227. /*
  228. * CControlSAP()
  229. *
  230. * Public Function Description
  231. * This is the control sap constructor. It is responsible for
  232. * registering control sap with the application interface via
  233. * an owner callback.
  234. */
  235. CControlSAP::CControlSAP ( void )
  236. :
  237. CBaseSap(MAKE_STAMP_ID('C','S','a','p')),
  238. m_pfnNCCallback(NULL),
  239. m_pNCData(NULL),
  240. m_nJoinResponseTag(0),
  241. m_JoinResponseTagList2()
  242. {
  243. }
  244. /*
  245. * ~CControlSap()
  246. *
  247. * Public Function Description
  248. * This is the controller destructor. It is responsible for
  249. * flushing any pending upward bound messages and freeing all
  250. * the resources tied up with pending messages. Also it clears
  251. * the message queue and queue of command targets that are registered
  252. * with it. Actually all command targets at this point should
  253. * already have been unregistered but this is just a double check.
  254. */
  255. CControlSAP::~CControlSAP ( void )
  256. {
  257. //
  258. // No one should use this global pointer any more.
  259. //
  260. ASSERT(this == g_pControlSap);
  261. g_pControlSap = NULL;
  262. }
  263. void CControlSAP::PostCtrlSapMsg ( GCCCtrlSapMsgEx *pCtrlSapMsgEx )
  264. {
  265. //
  266. // LONCHANC: GCC WorkThread may also get to here.
  267. // For instance, the following stack trace happen during exiting a conference.
  268. // CControlSAP::AddToMessageQueue()
  269. // CControlSAP::ConfDisconnectConfirm()
  270. // CConf::DisconnectProviderIndication()
  271. // CConf::Owner-Callback()
  272. // MCSUser::FlushOutgoingPDU()
  273. // CConf::FlushOutgoingPDU()
  274. // GCCController::EventLoop()
  275. // GCCControllerThread(void * 0x004f1bf0)
  276. //
  277. ASSERT(NULL != m_hwndNotify);
  278. if( 0 == ::PostMessage(m_hwndNotify,
  279. CSAPMSG_BASE + (UINT) pCtrlSapMsgEx->Msg.message_type,
  280. (WPARAM) pCtrlSapMsgEx,
  281. (LPARAM) this) )
  282. {
  283. delete pCtrlSapMsgEx;
  284. pCtrlSapMsgEx = NULL;
  285. }
  286. }
  287. #if defined(GCCNC_DIRECT_INDICATION) || defined(GCCNC_DIRECT_CONFIRM)
  288. void CControlSAP::SendCtrlSapMsg ( GCCCtrlSapMsg *pCtrlSapMsg )
  289. {
  290. extern DWORD g_dwNCThreadID;
  291. ASSERT(g_dwNCThreadID == ::GetCurrentThreadId());
  292. if (NULL != m_pfnNCCallback)
  293. {
  294. pCtrlSapMsg->user_defined = m_pNCData;
  295. (*m_pfnNCCallback)(pCtrlSapMsg);
  296. }
  297. }
  298. #endif // GCCNC_DIRECT_INDICATION || GCCNC_DIRECT_CONFIRM
  299. /*
  300. * void RegisterNodeController()
  301. *
  302. * Public Functional Description:
  303. * This routine sets up the node controller callback structure which
  304. * holds all the information needed by GCC to perform a node controller
  305. * callback. It also sets up the task switching window required to
  306. * perform the context switch.
  307. */
  308. /*
  309. * void UnregisterNodeController()
  310. *
  311. * Public Functional Description:
  312. */
  313. /*
  314. * ConfCreateRequest()
  315. *
  316. * Public Function Description
  317. * This function is called by the interface when it gets a conference
  318. * create request from the node controller. This function just passes this
  319. * request to the controller via an owner callback.
  320. */
  321. GCCError CControlSAP::ConfCreateRequest
  322. (
  323. GCCConfCreateRequest *pReq,
  324. GCCConfID *pnConfID
  325. )
  326. {
  327. GCCError rc;
  328. CONF_CREATE_REQUEST ccr;
  329. DebugEntry(CControlSAP::ConferenceCreateRequest);
  330. // initialize for cleanup
  331. ccr.convener_password = NULL;
  332. ccr.password = NULL;
  333. ccr.user_data_list = NULL;
  334. // copy security setting
  335. ccr.fSecure = pReq->fSecure;
  336. /*
  337. ** This section of the code performs all the necessary parameter
  338. ** checking.
  339. */
  340. // Check for invalid conference name
  341. if (pReq->Core.conference_name != NULL)
  342. {
  343. /*
  344. ** Do not allow non-numeric or zero length strings to get
  345. ** past this point.
  346. */
  347. if (pReq->Core.conference_name->numeric_string != NULL)
  348. {
  349. if (! IsNumericNameValid(pReq->Core.conference_name->numeric_string))
  350. {
  351. ERROR_OUT(("CControlSAP::ConfCreateRequest: invalid numeric name=%s", pReq->Core.conference_name->numeric_string));
  352. rc = GCC_INVALID_CONFERENCE_NAME;
  353. goto MyExit;
  354. }
  355. }
  356. else
  357. {
  358. ERROR_OUT(("CControlSAP::ConfCreateRequest: null numeric string"));
  359. rc = GCC_INVALID_CONFERENCE_NAME;
  360. goto MyExit;
  361. }
  362. if (pReq->Core.conference_name->text_string != NULL)
  363. {
  364. if (! IsTextNameValid(pReq->Core.conference_name->text_string))
  365. {
  366. ERROR_OUT(("CControlSAP::ConfCreateRequest: invalid text name=%s", pReq->Core.conference_name->text_string));
  367. rc = GCC_INVALID_CONFERENCE_NAME;
  368. goto MyExit;
  369. }
  370. }
  371. }
  372. else
  373. {
  374. ERROR_OUT(("CControlSAP::ConfCreateRequest: null conf name"));
  375. rc = GCC_INVALID_CONFERENCE_NAME;
  376. goto MyExit;
  377. }
  378. // Check for valid conference modifier
  379. if (pReq->Core.conference_modifier != NULL)
  380. {
  381. if (! IsNumericNameValid(pReq->Core.conference_modifier))
  382. {
  383. ERROR_OUT(("CControlSAP::ConfCreateRequest: invalid conf modifier=%s", pReq->Core.conference_modifier));
  384. rc = GCC_INVALID_CONFERENCE_MODIFIER;
  385. goto MyExit;
  386. }
  387. }
  388. // Check for valid convener password
  389. if (pReq->convener_password != NULL)
  390. {
  391. if (pReq->convener_password->numeric_string != NULL)
  392. {
  393. if (! IsNumericNameValid(pReq->convener_password->numeric_string))
  394. {
  395. ERROR_OUT(("CControlSAP::ConfCreateRequest: invalid convener password=%s", pReq->convener_password->numeric_string));
  396. rc = GCC_INVALID_PASSWORD;
  397. goto MyExit;
  398. }
  399. }
  400. else
  401. {
  402. ERROR_OUT(("CControlSAP::ConfCreateRequest: null convener password numeric string"));
  403. rc = GCC_INVALID_PASSWORD;
  404. goto MyExit;
  405. }
  406. // Construct the convener password container
  407. DBG_SAVE_FILE_LINE
  408. ccr.convener_password = new CPassword(pReq->convener_password, &rc);
  409. if (ccr.convener_password == NULL || GCC_NO_ERROR != rc)
  410. {
  411. ERROR_OUT(("CControlSAP::ConfCreateRequest: can't create convener password"));
  412. rc = GCC_ALLOCATION_FAILURE;
  413. goto MyExit;
  414. }
  415. }
  416. // Check for valid password
  417. if (pReq->password != NULL)
  418. {
  419. if (pReq->password->numeric_string != NULL)
  420. {
  421. if (! IsNumericNameValid(pReq->password->numeric_string))
  422. {
  423. ERROR_OUT(("CControlSAP::ConfCreateRequest: invalid password=%s", pReq->password->numeric_string));
  424. rc = GCC_INVALID_PASSWORD;
  425. goto MyExit;
  426. }
  427. }
  428. else
  429. {
  430. ERROR_OUT(("CControlSAP::ConfCreateRequest: null password numeric string"));
  431. rc = GCC_INVALID_PASSWORD;
  432. goto MyExit;
  433. }
  434. // Construct the password container
  435. DBG_SAVE_FILE_LINE
  436. ccr.password = new CPassword(pReq->password, &rc);
  437. if (ccr.password == NULL || GCC_NO_ERROR != rc)
  438. {
  439. ERROR_OUT(("CControlSAP::ConfCreateRequest: can't create password"));
  440. rc = GCC_ALLOCATION_FAILURE;
  441. goto MyExit;
  442. }
  443. }
  444. if (pReq->Core.connection_handle == NULL)
  445. {
  446. ERROR_OUT(("CControlSAP::ConfCreateRequest: bad connection handle"));
  447. rc = GCC_BAD_CONNECTION_HANDLE_POINTER;
  448. goto MyExit;
  449. }
  450. /*
  451. ** If no errors occurred start building the general purpose containers
  452. ** to be passed on.
  453. */
  454. // copy the core component which has the same representation in both API and internal
  455. ccr.Core = pReq->Core;
  456. // Construct the user data list container
  457. if (pReq->number_of_user_data_members != 0)
  458. {
  459. DBG_SAVE_FILE_LINE
  460. ccr.user_data_list = new CUserDataListContainer(pReq->number_of_user_data_members, pReq->user_data_list, &rc);
  461. if (ccr.user_data_list == NULL || GCC_NO_ERROR != rc)
  462. {
  463. ERROR_OUT(("CControlSAP::ConfCreateRequest: can't create user data list container"));
  464. rc = GCC_ALLOCATION_FAILURE;
  465. goto MyExit;
  466. }
  467. }
  468. // Perform the owner callback
  469. ::EnterCriticalSection(&g_csGCCProvider);
  470. rc = g_pGCCController->ConfCreateRequest(&ccr, pnConfID);
  471. ::LeaveCriticalSection(&g_csGCCProvider);
  472. MyExit:
  473. // Free up all the containers
  474. // Free up the convener password container
  475. if (ccr.convener_password != NULL)
  476. {
  477. ccr.convener_password->Release();
  478. }
  479. // Free up the password container
  480. if (ccr.password != NULL)
  481. {
  482. ccr.password->Release();
  483. }
  484. // Free up any memory used in callback
  485. if (ccr.user_data_list != NULL)
  486. {
  487. ccr.user_data_list->Release();
  488. }
  489. DebugExitINT(CControlSAP::ConferenceCreateRequest, rc);
  490. return rc;
  491. }
  492. /*
  493. * ConfCreateResponse ()
  494. *
  495. * Public Function Description
  496. * This function is called by the interface when it gets a conference
  497. * create response from the node controller, to be sent to the provider
  498. * that issued the conference create request. This function just passes
  499. * this request to the controller via an owner callback.
  500. */
  501. GCCError CControlSAP::ConfCreateResponse
  502. (
  503. GCCNumericString conference_modifier,
  504. GCCConfID conference_id,
  505. BOOL use_password_in_the_clear,
  506. PDomainParameters domain_parameters,
  507. UINT number_of_network_addresses,
  508. PGCCNetworkAddress * local_network_address_list,
  509. UINT number_of_user_data_members,
  510. PGCCUserData * user_data_list,
  511. GCCResult result
  512. )
  513. {
  514. GCCError rc = GCC_NO_ERROR;
  515. ConfCreateResponseInfo create_response_info;
  516. DebugEntry(CControlSAP::ConfCreateResponse);
  517. /*
  518. ** This section of the code performs all the necessary parameter
  519. ** checking.
  520. */
  521. // Check for valid conference modifier
  522. if (conference_modifier != NULL)
  523. {
  524. if (IsNumericNameValid(conference_modifier) == FALSE)
  525. {
  526. ERROR_OUT(("CControlSAP::ConfCreateResponse: invalid conf modifier"));
  527. rc = GCC_INVALID_CONFERENCE_MODIFIER;
  528. }
  529. }
  530. /*
  531. ** If no errors occurred fill in the info structure and pass it on to the
  532. ** owner object.
  533. */
  534. if (rc == GCC_NO_ERROR)
  535. {
  536. // Construct the user data list
  537. if (number_of_user_data_members != 0)
  538. {
  539. DBG_SAVE_FILE_LINE
  540. create_response_info.user_data_list = new CUserDataListContainer(
  541. number_of_user_data_members,
  542. user_data_list,
  543. &rc);
  544. if (create_response_info.user_data_list == NULL)
  545. {
  546. ERROR_OUT(("CControlSAP::ConfCreateResponse: can't create CUserDataListContainer"));
  547. rc = GCC_ALLOCATION_FAILURE;
  548. }
  549. }
  550. else
  551. {
  552. create_response_info.user_data_list = NULL;
  553. }
  554. if (rc == GCC_NO_ERROR)
  555. {
  556. // Fill in the conference create info structure and send it on
  557. create_response_info.conference_modifier = conference_modifier;
  558. create_response_info.conference_id = conference_id;
  559. create_response_info.use_password_in_the_clear =
  560. use_password_in_the_clear;
  561. create_response_info.domain_parameters = domain_parameters;
  562. create_response_info.number_of_network_addresses =
  563. number_of_network_addresses;
  564. create_response_info.network_address_list =
  565. local_network_address_list;
  566. create_response_info.result = result;
  567. // Perform the owner callback
  568. ::EnterCriticalSection(&g_csGCCProvider);
  569. rc = g_pGCCController->ConfCreateResponse(&create_response_info);
  570. ::LeaveCriticalSection(&g_csGCCProvider);
  571. }
  572. if (create_response_info.user_data_list != NULL)
  573. {
  574. create_response_info.user_data_list->Release();
  575. }
  576. }
  577. DebugExitINT(CControlSAP::ConfCreateResponse, rc);
  578. return rc;
  579. }
  580. /*
  581. * ConfQueryRequest ()
  582. *
  583. * Public Function Description
  584. * This function is called by the interface when it gets a conference
  585. * query request from the node controller. This function just passes
  586. * this request to the controller via an owner callback.
  587. */
  588. GCCError CControlSAP::ConfQueryRequest
  589. (
  590. GCCNodeType node_type,
  591. PGCCAsymmetryIndicator asymmetry_indicator,
  592. TransportAddress calling_address,
  593. TransportAddress called_address,
  594. BOOL fSecure,
  595. UINT number_of_user_data_members,
  596. PGCCUserData * user_data_list,
  597. PConnectionHandle connection_handle
  598. )
  599. {
  600. GCCError rc = GCC_NO_ERROR;
  601. ConfQueryRequestInfo conf_query_request_info;
  602. DebugEntry(CControlSAP::ConfQueryRequest);
  603. // Check for an invalid called address.
  604. if (called_address == NULL)
  605. {
  606. ERROR_OUT(("CControlSAP::ConfQueryRequest: invalid transport"));
  607. rc = GCC_INVALID_TRANSPORT;
  608. }
  609. // Check for an invalid connection handle.
  610. if (connection_handle == NULL)
  611. {
  612. ERROR_OUT(("CControlSAP::ConfQueryRequest: null connection handle"));
  613. rc = GCC_BAD_CONNECTION_HANDLE_POINTER;
  614. }
  615. // Check for a valid node type.
  616. if ((node_type != GCC_TERMINAL) &&
  617. (node_type != GCC_MULTIPORT_TERMINAL) &&
  618. (node_type != GCC_MCU))
  619. {
  620. ERROR_OUT(("CControlSAP::ConfQueryRequest: invalid node type=%u", (UINT) node_type));
  621. rc = GCC_INVALID_NODE_TYPE;
  622. }
  623. // Check for an invalid asymmetry indicator.
  624. if (asymmetry_indicator != NULL)
  625. {
  626. if ((asymmetry_indicator->asymmetry_type != GCC_ASYMMETRY_CALLER) &&
  627. (asymmetry_indicator->asymmetry_type != GCC_ASYMMETRY_CALLED) &&
  628. (asymmetry_indicator->asymmetry_type != GCC_ASYMMETRY_UNKNOWN))
  629. {
  630. ERROR_OUT(("CControlSAP::ConfQueryRequest: invalid asymmetry indicator=%u", (UINT) asymmetry_indicator->asymmetry_type));
  631. rc = GCC_INVALID_ASYMMETRY_INDICATOR;
  632. }
  633. }
  634. // Create user data container if necessary.
  635. if ((number_of_user_data_members != 0) &&
  636. (rc == GCC_NO_ERROR))
  637. {
  638. DBG_SAVE_FILE_LINE
  639. conf_query_request_info.user_data_list = new CUserDataListContainer (
  640. number_of_user_data_members,
  641. user_data_list,
  642. &rc);
  643. if (conf_query_request_info.user_data_list == NULL)
  644. {
  645. ERROR_OUT(("CControlSAP::ConfQueryRequest: can't create CUserDataListContainer"));
  646. rc = GCC_ALLOCATION_FAILURE;
  647. }
  648. }
  649. else
  650. {
  651. conf_query_request_info.user_data_list = NULL;
  652. }
  653. // Call back the controller to send the response.
  654. if (rc == GCC_NO_ERROR)
  655. {
  656. conf_query_request_info.node_type = node_type;
  657. conf_query_request_info.asymmetry_indicator = asymmetry_indicator;
  658. conf_query_request_info.calling_address = calling_address;
  659. conf_query_request_info.called_address = called_address;
  660. conf_query_request_info.connection_handle = connection_handle;
  661. conf_query_request_info.fSecure = fSecure;
  662. ::EnterCriticalSection(&g_csGCCProvider);
  663. rc = g_pGCCController->ConfQueryRequest(&conf_query_request_info);
  664. ::LeaveCriticalSection(&g_csGCCProvider);
  665. }
  666. if (conf_query_request_info.user_data_list != NULL)
  667. {
  668. conf_query_request_info.user_data_list->Release();
  669. }
  670. DebugExitINT(CControlSAP::ConfQueryRequest, rc);
  671. return rc;
  672. }
  673. void CControlSAP::CancelConfQueryRequest ( ConnectionHandle hQueryReqConn )
  674. {
  675. DebugEntry(CControlSAP::CancelConfQueryRequest);
  676. ::EnterCriticalSection(&g_csGCCProvider);
  677. g_pGCCController->CancelConfQueryRequest(hQueryReqConn);
  678. ::LeaveCriticalSection(&g_csGCCProvider);
  679. DebugExitVOID(CControlSAP::CancelConfQueryRequest);
  680. }
  681. /*
  682. * ConfQueryResponse ()
  683. *
  684. * Public Function Description
  685. * This function is called by the DLL interface when it gets a conference
  686. * query response from the node controller. This function just passes
  687. * this response to the controller via an owner callback.
  688. */
  689. GCCError CControlSAP::ConfQueryResponse
  690. (
  691. GCCResponseTag query_response_tag,
  692. GCCNodeType node_type,
  693. PGCCAsymmetryIndicator asymmetry_indicator,
  694. UINT number_of_user_data_members,
  695. PGCCUserData * user_data_list,
  696. GCCResult result
  697. )
  698. {
  699. GCCError rc = GCC_NO_ERROR;
  700. ConfQueryResponseInfo conf_query_response_info;
  701. DebugEntry(CControlSAP::ConfQueryResponse);
  702. // Check for a valid node type.
  703. if ((node_type != GCC_TERMINAL) &&
  704. (node_type != GCC_MULTIPORT_TERMINAL) &&
  705. (node_type != GCC_MCU))
  706. {
  707. ERROR_OUT(("CControlSAP::ConfQueryResponse: invalid node type=%u", (UINT) node_type));
  708. rc = GCC_INVALID_NODE_TYPE;
  709. }
  710. // Check for an invalid asymmetry indicator.
  711. if (asymmetry_indicator != NULL)
  712. {
  713. if ((asymmetry_indicator->asymmetry_type != GCC_ASYMMETRY_CALLER) &&
  714. (asymmetry_indicator->asymmetry_type != GCC_ASYMMETRY_CALLED) &&
  715. (asymmetry_indicator->asymmetry_type != GCC_ASYMMETRY_UNKNOWN))
  716. {
  717. ERROR_OUT(("CControlSAP::ConfQueryResponse: invalid asymmetry indicator=%u", (UINT) asymmetry_indicator->asymmetry_type));
  718. rc = GCC_INVALID_ASYMMETRY_INDICATOR;
  719. }
  720. }
  721. // Create user data container if necessary.
  722. if ((number_of_user_data_members != 0) &&
  723. (rc == GCC_NO_ERROR))
  724. {
  725. DBG_SAVE_FILE_LINE
  726. conf_query_response_info.user_data_list = new CUserDataListContainer(
  727. number_of_user_data_members,
  728. user_data_list,
  729. &rc);
  730. if (conf_query_response_info.user_data_list == NULL)
  731. {
  732. ERROR_OUT(("CControlSAP::ConfQueryResponse: can't create CUserDataListContainer"));
  733. rc = GCC_ALLOCATION_FAILURE;
  734. }
  735. }
  736. else
  737. {
  738. conf_query_response_info.user_data_list = NULL;
  739. }
  740. // Call back the controller to send the response.
  741. if (rc == GCC_NO_ERROR)
  742. {
  743. conf_query_response_info.query_response_tag = query_response_tag;
  744. conf_query_response_info.node_type = node_type;
  745. conf_query_response_info.asymmetry_indicator = asymmetry_indicator;
  746. conf_query_response_info.result = result;
  747. ::EnterCriticalSection(&g_csGCCProvider);
  748. rc = g_pGCCController->ConfQueryResponse(&conf_query_response_info);
  749. ::LeaveCriticalSection(&g_csGCCProvider);
  750. }
  751. // Free the data associated with the user data container.
  752. if (conf_query_response_info.user_data_list != NULL)
  753. {
  754. conf_query_response_info.user_data_list->Release();
  755. }
  756. DebugExitINT(CControlSAP::ConfQueryResponse, rc);
  757. return rc;
  758. }
  759. /*
  760. * AnnouncePresenceRequest()
  761. *
  762. * Public Function Description
  763. * This function is called by the interface when it gets an announce
  764. * presence request from the node controller. This function passes this
  765. * request on to the appropriate conference object as obtained from
  766. * the list of command targets that control sap maintains. The ConferenceID
  767. * passed in is used to index the list of command targets to get the
  768. * correct conference.
  769. */
  770. GCCError CControlSAP::AnnouncePresenceRequest
  771. (
  772. GCCConfID conference_id,
  773. GCCNodeType node_type,
  774. GCCNodeProperties node_properties,
  775. LPWSTR pwszNodeName,
  776. UINT number_of_participants,
  777. LPWSTR * participant_name_list,
  778. LPWSTR pwszSiteInfo,
  779. UINT number_of_network_addresses,
  780. PGCCNetworkAddress * network_address_list,
  781. LPOSTR alternative_node_id,
  782. UINT number_of_user_data_members,
  783. PGCCUserData * user_data_list
  784. )
  785. {
  786. GCCError rc = GCC_NO_ERROR;
  787. GCCNodeRecord node_record;
  788. DebugEntry(CControlSAP::AnnouncePresenceRequest);
  789. // Check for a valid node type
  790. if ((node_type != GCC_TERMINAL) &&
  791. (node_type != GCC_MULTIPORT_TERMINAL) &&
  792. (node_type != GCC_MCU))
  793. {
  794. ERROR_OUT(("CControlSAP::AnnouncePresenceRequest: invalid node type=%u", node_type));
  795. rc = GCC_INVALID_NODE_TYPE;
  796. }
  797. // Check for valid node properties.
  798. if ((node_properties != GCC_PERIPHERAL_DEVICE) &&
  799. (node_properties != GCC_MANAGEMENT_DEVICE) &&
  800. (node_properties != GCC_PERIPHERAL_AND_MANAGEMENT_DEVICE) &&
  801. (node_properties != GCC_NEITHER_PERIPHERAL_NOR_MANAGEMENT))
  802. {
  803. ERROR_OUT(("CControlSAP::AnnouncePresenceRequest: invalid node properties=%u", node_properties));
  804. rc = GCC_INVALID_NODE_PROPERTIES;
  805. }
  806. // Check to make sure the conference exists.
  807. if (rc == GCC_NO_ERROR)
  808. {
  809. CConf *pConf;
  810. ::EnterCriticalSection(&g_csGCCProvider);
  811. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  812. {
  813. // Fill in the node record and pass it on.
  814. node_record.node_type = node_type;
  815. node_record.node_properties = node_properties;
  816. node_record.node_name = pwszNodeName;
  817. node_record.number_of_participants = (USHORT)number_of_participants;
  818. node_record.participant_name_list = participant_name_list;
  819. node_record.site_information = pwszSiteInfo;
  820. node_record.number_of_network_addresses = number_of_network_addresses;
  821. node_record.network_address_list = network_address_list;
  822. node_record.alternative_node_id = alternative_node_id;
  823. node_record.number_of_user_data_members = (USHORT)number_of_user_data_members;
  824. node_record.user_data_list = user_data_list;
  825. // Pass the record on to the conference object.
  826. rc = pConf->ConfAnnouncePresenceRequest(&node_record);
  827. }
  828. else
  829. {
  830. TRACE_OUT(("CControlSAP::AnnouncePresenceRequest: invalid conference ID=%u", (UINT) conference_id));
  831. rc = GCC_INVALID_CONFERENCE;
  832. }
  833. ::LeaveCriticalSection(&g_csGCCProvider);
  834. }
  835. DebugExitINT(CControlSAP::AnnouncePresenceRequest, rc);
  836. return rc;
  837. }
  838. /*
  839. * ConfDisconnectRequest()
  840. *
  841. * Public Function Description
  842. * This function is called by the interface when it gets a conference
  843. * disconnect request from the node controller. This function passes the
  844. * request on to the appropriate conference object as obtained from
  845. * the list of command targets that the control sap maintains.
  846. */
  847. GCCError CControlSAP::ConfDisconnectRequest ( GCCConfID conference_id )
  848. {
  849. GCCError rc;
  850. CConf *pConf;
  851. DebugEntry(CControlSAP::ConfDisconnectRequest);
  852. ::EnterCriticalSection(&g_csGCCProvider);
  853. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  854. {
  855. // Pass the disconnect on to the conference object.
  856. rc = pConf->ConfDisconnectRequest();
  857. }
  858. else
  859. {
  860. WARNING_OUT(("CControlSAP::ConfDisconnectRequest: invalid conference ID=%u", (UINT) conference_id));
  861. rc = GCC_INVALID_CONFERENCE;
  862. }
  863. ::LeaveCriticalSection(&g_csGCCProvider);
  864. DebugExitINT(CControlSAP::ConfDisconnectRequest, rc);
  865. return rc;
  866. }
  867. /*
  868. * ConfTerminateRequest()
  869. *
  870. * Public Function Description
  871. * This function is called by the interface when it gets a conference
  872. * terminate request from the node controller. This function passes the
  873. * request on to the appropriate conference object as obtained from
  874. * the list of command targets that the control sap maintains.
  875. */
  876. #ifdef JASPER
  877. GCCError CControlSAP::ConfTerminateRequest
  878. (
  879. GCCConfID conference_id,
  880. GCCReason reason
  881. )
  882. {
  883. GCCError rc;
  884. CConf *pConf;
  885. DebugEntry(CControlSAP::ConfTerminateRequest);
  886. ::EnterCriticalSection(&g_csGCCProvider);
  887. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  888. {
  889. // Pass the disconnect on to the conference object
  890. rc = pConf->ConfTerminateRequest(reason);
  891. }
  892. else
  893. {
  894. WARNING_OUT(("CControlSAP::ConfTerminateRequest: invalid conference ID=%u", (UINT) conference_id));
  895. rc = GCC_INVALID_CONFERENCE;
  896. }
  897. ::LeaveCriticalSection(&g_csGCCProvider);
  898. DebugExitINT(CControlSAP::ConfTerminateRequest, rc);
  899. return rc;
  900. }
  901. #endif // JASPER
  902. /*
  903. * ConfEjectUserRequest()
  904. *
  905. * Public Function Description
  906. * This function is called by the interface when it gets a conference
  907. * eject user request from the node controller. This function passes the
  908. * request on to the appropriate conference object as obtained from
  909. * the list of command targets that the control sap maintains.
  910. */
  911. GCCError CControlSAP::ConfEjectUserRequest
  912. (
  913. GCCConfID conference_id,
  914. UserID ejected_node_id,
  915. GCCReason reason
  916. )
  917. {
  918. GCCError rc;
  919. CConf *pConf;
  920. DebugEntry(CControlSAP::ConfEjectUserRequest);
  921. ::EnterCriticalSection(&g_csGCCProvider);
  922. if (ejected_node_id < MINIMUM_USER_ID_VALUE)
  923. {
  924. ERROR_OUT(("CControlSAP::ConfEjectUserRequest: invalid mcs user ID=%u", (UINT) ejected_node_id));
  925. rc = GCC_INVALID_MCS_USER_ID;
  926. }
  927. else
  928. // Check to make sure the conference exists.
  929. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  930. {
  931. // Pass the command on to the conference object
  932. rc = pConf->ConfEjectUserRequest(ejected_node_id, reason);
  933. }
  934. else
  935. {
  936. WARNING_OUT(("CControlSAP::ConfEjectUserRequest: invalid conference ID=%u", (UINT) conference_id));
  937. rc = GCC_INVALID_CONFERENCE;
  938. }
  939. ::LeaveCriticalSection(&g_csGCCProvider);
  940. DebugExitINT(CControlSAP::ConfEjectUserRequest, rc);
  941. return rc;
  942. }
  943. /*
  944. * ConfJoinRequest ()
  945. *
  946. * Public Function Description
  947. * This function is called by the interface when it gets a conference
  948. * join request from the node controller, to be sent to the top provider
  949. * either directly or through a directly connected intermediate provider.
  950. * This function just passes this request to the controller via an owner
  951. * callback.
  952. */
  953. GCCError CControlSAP::ConfJoinRequest
  954. (
  955. PGCCConferenceName conference_name,
  956. GCCNumericString called_node_modifier,
  957. GCCNumericString calling_node_modifier,
  958. PGCCPassword convener_password,
  959. PGCCChallengeRequestResponse password_challenge,
  960. LPWSTR pwszCallerID,
  961. TransportAddress calling_address,
  962. TransportAddress called_address,
  963. BOOL fSecure,
  964. PDomainParameters domain_parameters,
  965. UINT number_of_network_addresses,
  966. PGCCNetworkAddress * local_network_address_list,
  967. UINT number_of_user_data_members,
  968. PGCCUserData * user_data_list,
  969. PConnectionHandle connection_handle,
  970. GCCConfID * pnConfID
  971. )
  972. {
  973. GCCError rc = GCC_NO_ERROR;
  974. ConfJoinRequestInfo join_request_info;
  975. DebugEntry(CControlSAP::ConfJoinRequest);
  976. // Check for invalid conference name
  977. if (conference_name != NULL)
  978. {
  979. /*
  980. ** Check to make sure a valid conference name exists.
  981. */
  982. if ((conference_name->numeric_string == NULL) &&
  983. (conference_name->text_string == NULL))
  984. {
  985. ERROR_OUT(("CControlSAP::ConfJoinRequest: invalid conference name (1)"));
  986. rc = GCC_INVALID_CONFERENCE_NAME;
  987. }
  988. /*
  989. ** If both numeric and text versions of the conference name exist,
  990. ** make sure they are both valid.
  991. */
  992. else if ((conference_name->numeric_string != NULL) &&
  993. (conference_name->text_string != NULL))
  994. {
  995. if ((IsNumericNameValid(conference_name->numeric_string) == FALSE)
  996. || (IsTextNameValid(conference_name->text_string) == FALSE))
  997. {
  998. ERROR_OUT(("CControlSAP::ConfJoinRequest: invalid conference name (2)"));
  999. rc = GCC_INVALID_CONFERENCE_NAME;
  1000. }
  1001. }
  1002. /*
  1003. ** If only a numeric version of the conference name is provided, check
  1004. ** to make sure it is valid.
  1005. */
  1006. else if (conference_name->numeric_string != NULL)
  1007. {
  1008. if (IsNumericNameValid(conference_name->numeric_string) == FALSE)
  1009. {
  1010. ERROR_OUT(("CControlSAP::ConfJoinRequest: invalid conference name (3)"));
  1011. rc = GCC_INVALID_CONFERENCE_NAME;
  1012. }
  1013. }
  1014. /*
  1015. ** If only a text version of the conference name is provided, check to
  1016. ** make sure it is valid.
  1017. */
  1018. else
  1019. {
  1020. if (IsTextNameValid(conference_name->text_string) == FALSE)
  1021. {
  1022. ERROR_OUT(("CControlSAP::ConfJoinRequest: invalid conference name (4)"));
  1023. rc = GCC_INVALID_CONFERENCE_NAME;
  1024. }
  1025. }
  1026. }
  1027. else
  1028. {
  1029. ERROR_OUT(("CControlSAP::ConfJoinRequest: invalid conference name (5)"));
  1030. rc = GCC_INVALID_CONFERENCE_NAME;
  1031. }
  1032. // Check for valid called_node_modifier.
  1033. if (called_node_modifier != NULL)
  1034. {
  1035. if (IsNumericNameValid(called_node_modifier) == FALSE)
  1036. {
  1037. ERROR_OUT(("CControlSAP::ConfJoinRequest: invalid called node modifier"));
  1038. rc = GCC_INVALID_CONFERENCE_MODIFIER;
  1039. }
  1040. }
  1041. // Check for valid calling_node_modifier
  1042. if (calling_node_modifier != NULL)
  1043. {
  1044. if (IsNumericNameValid(calling_node_modifier) == FALSE)
  1045. {
  1046. ERROR_OUT(("CControlSAP::ConfJoinRequest: invalid calling node modifier"));
  1047. rc = GCC_INVALID_CONFERENCE_MODIFIER;
  1048. }
  1049. }
  1050. // Check for valid convener password
  1051. if (convener_password != NULL)
  1052. {
  1053. if (convener_password->numeric_string != NULL)
  1054. {
  1055. if (IsNumericNameValid(convener_password->numeric_string) == FALSE)
  1056. {
  1057. ERROR_OUT(("CControlSAP::ConfJoinRequest: invalid convener password"));
  1058. rc = GCC_INVALID_PASSWORD;
  1059. }
  1060. }
  1061. else
  1062. {
  1063. ERROR_OUT(("CControlSAP::ConfJoinRequest: null convener password"));
  1064. rc = GCC_INVALID_PASSWORD;
  1065. }
  1066. }
  1067. if (connection_handle == NULL)
  1068. {
  1069. ERROR_OUT(("CControlSAP::ConfJoinRequest: null connection handle"));
  1070. rc = GCC_BAD_CONNECTION_HANDLE_POINTER;
  1071. }
  1072. if (called_address == NULL)
  1073. {
  1074. ERROR_OUT(("CControlSAP::ConfJoinRequest: null transport address"));
  1075. rc = GCC_INVALID_TRANSPORT_ADDRESS;
  1076. }
  1077. /*
  1078. ** If no errors occurred start building the general purpose containers
  1079. ** to be passed on.
  1080. */
  1081. if (rc == GCC_NO_ERROR)
  1082. {
  1083. // Construct a convener password container
  1084. if (convener_password != NULL)
  1085. {
  1086. DBG_SAVE_FILE_LINE
  1087. join_request_info.convener_password = new CPassword(convener_password, &rc);
  1088. if (join_request_info.convener_password == NULL)
  1089. {
  1090. ERROR_OUT(("CControlSAP::ConfJoinRequest: can't create CPassword (1)"));
  1091. rc = GCC_ALLOCATION_FAILURE;
  1092. }
  1093. }
  1094. else
  1095. {
  1096. join_request_info.convener_password = NULL;
  1097. }
  1098. // Construct a password challenge container
  1099. if ((password_challenge != NULL) && (rc == GCC_NO_ERROR))
  1100. {
  1101. DBG_SAVE_FILE_LINE
  1102. join_request_info.password_challenge = new CPassword(password_challenge, &rc);
  1103. if (join_request_info.password_challenge == NULL)
  1104. {
  1105. ERROR_OUT(("CControlSAP::ConfJoinRequest: can't create CPassword (2)"));
  1106. rc = GCC_ALLOCATION_FAILURE;
  1107. }
  1108. }
  1109. else
  1110. {
  1111. join_request_info.password_challenge = NULL;
  1112. }
  1113. // Construct the user data list
  1114. if ((number_of_user_data_members != 0) &&
  1115. (rc == GCC_NO_ERROR))
  1116. {
  1117. DBG_SAVE_FILE_LINE
  1118. join_request_info.user_data_list = new CUserDataListContainer(
  1119. number_of_user_data_members,
  1120. user_data_list,
  1121. &rc);
  1122. if (join_request_info.user_data_list == NULL)
  1123. {
  1124. ERROR_OUT(("CControlSAP::ConfJoinRequest: can't create CUserDataListContainer"));
  1125. rc = GCC_ALLOCATION_FAILURE;
  1126. }
  1127. }
  1128. else
  1129. {
  1130. join_request_info.user_data_list = NULL;
  1131. }
  1132. /*
  1133. ** If all the containers were successfully created go ahead and
  1134. ** fill in the rest of the create request info structure and pass
  1135. ** it on to the owner object.
  1136. */
  1137. if (rc == GCC_NO_ERROR)
  1138. {
  1139. join_request_info.conference_name = conference_name;
  1140. join_request_info.called_node_modifier = called_node_modifier;
  1141. join_request_info.calling_node_modifier =calling_node_modifier;
  1142. join_request_info.pwszCallerID = pwszCallerID;
  1143. join_request_info.calling_address = calling_address;
  1144. join_request_info.called_address = called_address;
  1145. join_request_info.fSecure = fSecure;
  1146. join_request_info.domain_parameters = domain_parameters;
  1147. join_request_info.number_of_network_addresses = number_of_network_addresses;
  1148. join_request_info.local_network_address_list = local_network_address_list;
  1149. join_request_info.connection_handle = connection_handle;
  1150. ::EnterCriticalSection(&g_csGCCProvider);
  1151. rc = g_pGCCController->ConfJoinRequest(&join_request_info, pnConfID);
  1152. ::LeaveCriticalSection(&g_csGCCProvider);
  1153. }
  1154. // Free up all the containers
  1155. // Free up the convener password container
  1156. if (join_request_info.convener_password != NULL)
  1157. {
  1158. join_request_info.convener_password->Release();
  1159. }
  1160. // Free up the password container
  1161. if (join_request_info.password_challenge != NULL)
  1162. {
  1163. join_request_info.password_challenge->Release();
  1164. }
  1165. // Free up any memory used in callback
  1166. if (join_request_info.user_data_list != NULL)
  1167. {
  1168. join_request_info.user_data_list->Release();
  1169. }
  1170. }
  1171. DebugExitINT(CControlSAP::ConfJoinRequest, rc);
  1172. return rc;
  1173. }
  1174. /*
  1175. * ConfJoinResponse ()
  1176. *
  1177. * Public Function Description
  1178. * This function is called by the interface when it gets a conference
  1179. * join response from the node controller. This routine is responsible
  1180. * for routing the response to either the conference that made the
  1181. * request or the controller. Responses which are routed to a conference
  1182. * are associated with requests that originate at a subnode that is a
  1183. * node removed from the Top Provider.
  1184. */
  1185. GCCError CControlSAP::ConfJoinResponse
  1186. (
  1187. GCCResponseTag join_response_tag,
  1188. PGCCChallengeRequestResponse password_challenge,
  1189. UINT number_of_user_data_members,
  1190. PGCCUserData * user_data_list,
  1191. GCCResult result
  1192. )
  1193. {
  1194. GCCError rc = GCC_NO_ERROR;
  1195. PJoinResponseStructure join_info;
  1196. CPassword *password_challenge_container = NULL;
  1197. CUserDataListContainer *user_data_container = NULL;
  1198. DebugEntry(CControlSAP::ConfJoinResponse);
  1199. ::EnterCriticalSection(&g_csGCCProvider);
  1200. if (NULL != (join_info = m_JoinResponseTagList2.Find(join_response_tag)))
  1201. {
  1202. /*
  1203. ** First create the data containers used in the join response.
  1204. */
  1205. // Set up the password challenge container
  1206. if (password_challenge != NULL)
  1207. {
  1208. DBG_SAVE_FILE_LINE
  1209. password_challenge_container = new CPassword(password_challenge, &rc);
  1210. if (password_challenge_container == NULL)
  1211. {
  1212. ERROR_OUT(("CControlSAP::ConfJoinResponse: can't create CPassword"));
  1213. rc = GCC_ALLOCATION_FAILURE;
  1214. }
  1215. }
  1216. // Set up the user data list container
  1217. if ((number_of_user_data_members != 0) && (rc == GCC_NO_ERROR))
  1218. {
  1219. DBG_SAVE_FILE_LINE
  1220. user_data_container = new CUserDataListContainer(number_of_user_data_members, user_data_list, &rc);
  1221. if (user_data_container == NULL)
  1222. {
  1223. ERROR_OUT(("CControlSAP::ConfJoinResponse: can't create CUserDataListContainer"));
  1224. rc = GCC_ALLOCATION_FAILURE;
  1225. }
  1226. }
  1227. if (rc == GCC_NO_ERROR)
  1228. {
  1229. if (join_info->command_target_call == FALSE)
  1230. {
  1231. ConfJoinResponseInfo join_response_info;
  1232. /*
  1233. ** Since the request originated from the Owner Object the
  1234. ** response gets routed to the Owner Object.
  1235. */
  1236. join_response_info.password_challenge =
  1237. password_challenge_container;
  1238. join_response_info.conference_id = join_info->conference_id;
  1239. join_response_info.connection_handle =
  1240. join_info->connection_handle;
  1241. join_response_info.user_data_list = user_data_container;
  1242. join_response_info.result = result;
  1243. rc = g_pGCCController->ConfJoinIndResponse(&join_response_info);
  1244. }
  1245. else
  1246. {
  1247. CConf *pConf;
  1248. /*
  1249. ** If the conference is terminated before the conference join
  1250. ** is responded to, a GCC_INVALID_CONFERENCE errror will occur.
  1251. */
  1252. if (NULL != (pConf = g_pGCCController->GetConfObject(join_info->conference_id)))
  1253. {
  1254. rc = pConf->ConfJoinReqResponse(
  1255. join_info->user_id,
  1256. password_challenge_container,
  1257. user_data_container,
  1258. result);
  1259. }
  1260. else
  1261. {
  1262. WARNING_OUT(("CControlSAP::ConfJoinResponse: invalid conference ID=%u", (UINT) join_info->conference_id));
  1263. rc = GCC_INVALID_CONFERENCE;
  1264. // If this error occurs go ahead and cleanup up
  1265. m_JoinResponseTagList2.Remove(join_response_tag);
  1266. delete join_info;
  1267. }
  1268. }
  1269. }
  1270. /*
  1271. ** Remove the join information structure from the join response list
  1272. ** if no error is returned.
  1273. */
  1274. if (rc == GCC_NO_ERROR)
  1275. {
  1276. m_JoinResponseTagList2.Remove(join_response_tag);
  1277. delete join_info;
  1278. }
  1279. // Free up all the containers
  1280. // Free up the password challenge container
  1281. if (password_challenge_container != NULL)
  1282. {
  1283. password_challenge_container->Release();
  1284. }
  1285. // Free up any memory used in callback
  1286. if (user_data_container != NULL)
  1287. {
  1288. user_data_container->Release();
  1289. }
  1290. }
  1291. else
  1292. {
  1293. rc = GCC_INVALID_JOIN_RESPONSE_TAG;
  1294. }
  1295. ::LeaveCriticalSection(&g_csGCCProvider);
  1296. DebugExitINT(CControlSAP::ConfJoinResponse, rc);
  1297. return rc;
  1298. }
  1299. /*
  1300. * ConfInviteRequest ()
  1301. *
  1302. * Public Function Description
  1303. * This function is called by the interface when it gets a conference
  1304. * invite request from the node controller. This function passes the
  1305. * request on to the appropriate conference object as obtained from
  1306. * the list of command targets that the control sap maintains.
  1307. */
  1308. GCCError CControlSAP::ConfInviteRequest
  1309. (
  1310. GCCConfID conference_id,
  1311. LPWSTR pwszCallerID,
  1312. TransportAddress calling_address,
  1313. TransportAddress called_address,
  1314. BOOL fSecure,
  1315. UINT number_of_user_data_members,
  1316. PGCCUserData * user_data_list,
  1317. PConnectionHandle connection_handle
  1318. )
  1319. {
  1320. GCCError rc = GCC_NO_ERROR;
  1321. CUserDataListContainer *user_data_list_ptr = NULL;
  1322. DebugEntry(CControlSAP::ConfInviteRequest);
  1323. if (called_address == NULL)
  1324. {
  1325. ERROR_OUT(("CControlSAP::ConfInviteRequest: null called address"));
  1326. rc = GCC_INVALID_TRANSPORT_ADDRESS;
  1327. }
  1328. if (connection_handle == NULL)
  1329. {
  1330. ERROR_OUT(("CControlSAP::ConfInviteRequest: null connection handle"));
  1331. rc = GCC_BAD_CONNECTION_HANDLE_POINTER;
  1332. }
  1333. if (rc == GCC_NO_ERROR)
  1334. {
  1335. CConf *pConf;
  1336. ::EnterCriticalSection(&g_csGCCProvider);
  1337. // Check to make sure the conference exists.
  1338. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1339. {
  1340. // Construct the user data list container
  1341. if (number_of_user_data_members != 0)
  1342. {
  1343. DBG_SAVE_FILE_LINE
  1344. user_data_list_ptr = new CUserDataListContainer(number_of_user_data_members, user_data_list, &rc);
  1345. if (user_data_list_ptr == NULL)
  1346. {
  1347. ERROR_OUT(("CControlSAP::ConfInviteRequest: can't create CUserDataListContainer"));
  1348. rc = GCC_ALLOCATION_FAILURE;
  1349. }
  1350. }
  1351. // Send the request on to the conference object.
  1352. if (rc == GCC_NO_ERROR)
  1353. {
  1354. rc = pConf->ConfInviteRequest(pwszCallerID,
  1355. calling_address,
  1356. called_address,
  1357. fSecure,
  1358. user_data_list_ptr,
  1359. connection_handle);
  1360. }
  1361. // Free up any memory used in callback
  1362. if (user_data_list_ptr != NULL)
  1363. {
  1364. user_data_list_ptr->Release();
  1365. }
  1366. }
  1367. else
  1368. {
  1369. rc = GCC_INVALID_CONFERENCE;
  1370. }
  1371. ::LeaveCriticalSection(&g_csGCCProvider);
  1372. }
  1373. DebugExitINT(CControlSAP::ConfInviteRequest, rc);
  1374. return rc;
  1375. }
  1376. void CControlSAP::CancelInviteRequest
  1377. (
  1378. GCCConfID nConfID,
  1379. ConnectionHandle hInviteReqConn
  1380. )
  1381. {
  1382. CConf *pConf;
  1383. DebugEntry(CControlSAP::CancelInviteRequest);
  1384. ::EnterCriticalSection(&g_csGCCProvider);
  1385. // Check to make sure the conference exists.
  1386. if (NULL != (pConf = g_pGCCController->GetConfObject(nConfID)))
  1387. {
  1388. pConf->CancelInviteRequest(hInviteReqConn);
  1389. }
  1390. ::LeaveCriticalSection(&g_csGCCProvider);
  1391. DebugExitVOID(CControlSAP::CancelInviteRequest);
  1392. }
  1393. GCCError CControlSAP::GetParentNodeID
  1394. (
  1395. GCCConfID nConfID,
  1396. GCCNodeID *pnidParent
  1397. )
  1398. {
  1399. GCCError rc = T120_INVALID_PARAMETER;
  1400. CConf *pConf;
  1401. DebugEntry(CControlSAP::GetParentNodeID);
  1402. if (NULL != pnidParent)
  1403. {
  1404. ::EnterCriticalSection(&g_csGCCProvider);
  1405. // Check to make sure the conference exists.
  1406. if (NULL != (pConf = g_pGCCController->GetConfObject(nConfID)))
  1407. {
  1408. *pnidParent = pConf->GetParentNodeID();
  1409. rc = GCC_NO_ERROR;
  1410. }
  1411. ::LeaveCriticalSection(&g_csGCCProvider);
  1412. }
  1413. DebugExitINT(CControlSAP::GetParentNodeID, rc);
  1414. return rc;
  1415. }
  1416. /*
  1417. * ConfInviteResponse ()
  1418. *
  1419. * Public Function Description
  1420. * This function is called by the interface when it gets a conference
  1421. * invite response from the node controller. This function passes the
  1422. * response on to the appropriate conference object as obtained from
  1423. * the list of command targets that the control sap maintains.
  1424. */
  1425. GCCError CControlSAP::ConfInviteResponse
  1426. (
  1427. GCCConfID conference_id,
  1428. GCCNumericString conference_modifier,
  1429. BOOL fSecure,
  1430. PDomainParameters domain_parameters,
  1431. UINT number_of_network_addresses,
  1432. PGCCNetworkAddress * local_network_address_list,
  1433. UINT number_of_user_data_members,
  1434. PGCCUserData * user_data_list,
  1435. GCCResult result
  1436. )
  1437. {
  1438. GCCError rc = GCC_NO_ERROR;
  1439. ConfInviteResponseInfo invite_response_info;
  1440. DebugEntry(CControlSAP::ConfInviteResponse);
  1441. // Check for invalid conference name
  1442. if (conference_modifier != NULL)
  1443. {
  1444. if (IsNumericNameValid(conference_modifier) == FALSE)
  1445. {
  1446. ERROR_OUT(("CControlSAP::ConfInviteResponse: invalid conference modifier"));
  1447. rc = GCC_INVALID_CONFERENCE_MODIFIER;
  1448. }
  1449. }
  1450. /*
  1451. ** If no errors occurred fill in the info structure and pass it on to the
  1452. ** owner object.
  1453. */
  1454. if (rc == GCC_NO_ERROR)
  1455. {
  1456. // Construct the user data list
  1457. if (number_of_user_data_members != 0)
  1458. {
  1459. DBG_SAVE_FILE_LINE
  1460. invite_response_info.user_data_list = new CUserDataListContainer(number_of_user_data_members, user_data_list, &rc);
  1461. if (invite_response_info.user_data_list == NULL)
  1462. {
  1463. ERROR_OUT(("CControlSAP::ConfInviteResponse: can't create CUserDataListContainer"));
  1464. rc = GCC_ALLOCATION_FAILURE;
  1465. }
  1466. }
  1467. else
  1468. {
  1469. invite_response_info.user_data_list = NULL;
  1470. }
  1471. if (rc == GCC_NO_ERROR)
  1472. {
  1473. invite_response_info.conference_id = conference_id;
  1474. invite_response_info.conference_modifier = conference_modifier;
  1475. invite_response_info.fSecure = fSecure;
  1476. invite_response_info.domain_parameters = domain_parameters;
  1477. invite_response_info.number_of_network_addresses =
  1478. number_of_network_addresses;
  1479. invite_response_info.local_network_address_list =
  1480. local_network_address_list;
  1481. invite_response_info.result = result;
  1482. // Call back the controller to issue invite response.
  1483. ::EnterCriticalSection(&g_csGCCProvider);
  1484. rc = g_pGCCController->ConfInviteResponse(&invite_response_info);
  1485. ::LeaveCriticalSection(&g_csGCCProvider);
  1486. }
  1487. // Free up the data associated with the user data container.
  1488. if (invite_response_info.user_data_list != NULL)
  1489. {
  1490. invite_response_info.user_data_list->Release();
  1491. }
  1492. }
  1493. DebugExitINT(CControlSAP::ConfInviteResponse, rc);
  1494. return rc;
  1495. }
  1496. /*
  1497. * ConfLockRequest ()
  1498. *
  1499. * Public Function Description:
  1500. * This function is called by the interface when it gets a conference
  1501. * lock request from the node controller. This function passes the
  1502. * request on to the appropriate conference object as obtained from
  1503. * the list of command targets that the control sap maintains.
  1504. */
  1505. #ifdef JASPER
  1506. GCCError CControlSAP::ConfLockRequest ( GCCConfID conference_id )
  1507. {
  1508. GCCError rc;
  1509. CConf *pConf;
  1510. DebugEntry(CControlSAP::ConfLockRequest);
  1511. ::EnterCriticalSection(&g_csGCCProvider);
  1512. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1513. {
  1514. rc = pConf->ConfLockRequest();
  1515. }
  1516. else
  1517. {
  1518. WARNING_OUT(("CControlSAP::ConfInviteResponse: invalid conference ID=%u", (UINT) conference_id));
  1519. rc = GCC_INVALID_CONFERENCE;
  1520. }
  1521. ::LeaveCriticalSection(&g_csGCCProvider);
  1522. DebugExitINT(CControlSAP::ConfLockRequest, rc);
  1523. return rc;
  1524. }
  1525. #endif // JASPER
  1526. /*
  1527. * ConfLockResponse ()
  1528. *
  1529. * Public Function Description:
  1530. * This function is called by the interface when it gets a conference
  1531. * lock response from the node controller. This function passes the
  1532. * response on to the appropriate conference object as obtained from
  1533. * the list of command targets that the control sap maintains.
  1534. */
  1535. GCCError CControlSAP::ConfLockResponse
  1536. (
  1537. GCCConfID conference_id,
  1538. UserID requesting_node,
  1539. GCCResult result
  1540. )
  1541. {
  1542. GCCError rc;
  1543. CConf *pConf;
  1544. DebugEntry(CControlSAP::ConfLockResponse);
  1545. ::EnterCriticalSection(&g_csGCCProvider);
  1546. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1547. {
  1548. rc = pConf->ConfLockResponse(requesting_node, result);
  1549. }
  1550. else
  1551. {
  1552. WARNING_OUT(("CControlSAP::ConfLockResponse: invalid conference ID=%u", (UINT) conference_id));
  1553. rc = GCC_INVALID_CONFERENCE;
  1554. }
  1555. ::LeaveCriticalSection(&g_csGCCProvider);
  1556. DebugExitINT(CControlSAP::ConfLockResponse, rc);
  1557. return rc;
  1558. }
  1559. /*
  1560. * ConfUnlockRequest ()
  1561. *
  1562. * Public Function Description:
  1563. * This function is called by the interface when it gets a conference
  1564. * unlock request from the node controller. This function passes the
  1565. * request on to the appropriate conference object as obtained from
  1566. * the list of command targets that the control sap maintains.
  1567. */
  1568. #ifdef JASPER
  1569. GCCError CControlSAP::ConfUnlockRequest ( GCCConfID conference_id )
  1570. {
  1571. GCCError rc;
  1572. CConf *pConf;
  1573. DebugEntry(CControlSAP::ConfUnlockRequest);
  1574. ::EnterCriticalSection(&g_csGCCProvider);
  1575. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1576. {
  1577. rc = pConf->ConfUnlockRequest();
  1578. }
  1579. else
  1580. {
  1581. WARNING_OUT(("CControlSAP::ConfUnlockRequest: invalid conference ID=%u", (UINT) conference_id));
  1582. rc = GCC_INVALID_CONFERENCE;
  1583. }
  1584. ::LeaveCriticalSection(&g_csGCCProvider);
  1585. DebugExitINT(CControlSAP::ConfUnlockRequest, rc);
  1586. return rc;
  1587. }
  1588. #endif // JASPER
  1589. /*
  1590. * ConfUnlockResponse ()
  1591. *
  1592. * Public Function Description:
  1593. * This function is called by the interface when it gets a conference
  1594. * unlock response from the node controller. This function passes the
  1595. * response on to the appropriate conference object as obtained from
  1596. * the list of command targets that the control sap maintains.
  1597. */
  1598. #ifdef JASPER
  1599. GCCError CControlSAP::ConfUnlockResponse
  1600. (
  1601. GCCConfID conference_id,
  1602. UserID requesting_node,
  1603. GCCResult result
  1604. )
  1605. {
  1606. GCCError rc;
  1607. CConf *pConf;
  1608. DebugEntry(CControlSAP::ConfUnlockResponse);
  1609. ::EnterCriticalSection(&g_csGCCProvider);
  1610. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1611. {
  1612. rc = pConf->ConfUnlockResponse(requesting_node, result);
  1613. }
  1614. else
  1615. {
  1616. WARNING_OUT(("CControlSAP::ConfUnlockResponse: invalid conference ID=%u", (UINT) conference_id));
  1617. rc = GCC_INVALID_CONFERENCE;
  1618. }
  1619. ::LeaveCriticalSection(&g_csGCCProvider);
  1620. DebugExitINT(CControlSAP::ConfUnlockResponse, rc);
  1621. return rc;
  1622. }
  1623. #endif // JASPER
  1624. /*
  1625. * ConductorAssignRequest ()
  1626. *
  1627. * Public Function Description
  1628. * This function is called by the interface when it gets a conductor
  1629. * assign request from the node controller. This function passes the
  1630. * request on to the appropriate conference object as obtained from
  1631. * the list of command targets that the control sap maintains.
  1632. */
  1633. #ifdef JASPER
  1634. GCCError CControlSAP::ConductorAssignRequest ( GCCConfID conference_id )
  1635. {
  1636. GCCError rc;
  1637. CConf *pConf;
  1638. DebugEntry(CControlSAP::ConductorAssignRequest);
  1639. ::EnterCriticalSection(&g_csGCCProvider);
  1640. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1641. {
  1642. rc = pConf->ConductorAssignRequest();
  1643. }
  1644. else
  1645. {
  1646. WARNING_OUT(("CControlSAP::ConductorAssignRequest: invalid conference ID=%u", (UINT) conference_id));
  1647. rc = GCC_INVALID_CONFERENCE;
  1648. }
  1649. ::LeaveCriticalSection(&g_csGCCProvider);
  1650. DebugExitINT(CControlSAP::ConductorAssignRequest, rc);
  1651. return rc;
  1652. }
  1653. #endif // JASPER
  1654. /*
  1655. * ConductorReleaseRequest ()
  1656. *
  1657. * Public Function Description
  1658. * This function is called by the interface when it gets a conductor
  1659. * release request from the node controller. This function passes the
  1660. * request on to the appropriate conference object as obtained from
  1661. * the list of command targets that the control sap maintains.
  1662. */
  1663. #ifdef JASPER
  1664. GCCError CControlSAP::ConductorReleaseRequest ( GCCConfID conference_id )
  1665. {
  1666. GCCError rc;
  1667. CConf *pConf;
  1668. DebugEntry(CControlSAP::ConductorReleaseRequest);
  1669. ::EnterCriticalSection(&g_csGCCProvider);
  1670. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1671. {
  1672. rc = pConf->ConductorReleaseRequest();
  1673. }
  1674. else
  1675. {
  1676. WARNING_OUT(("CControlSAP::ConductorReleaseRequest: invalid conference ID=%u", (UINT) conference_id));
  1677. rc = GCC_INVALID_CONFERENCE;
  1678. }
  1679. ::LeaveCriticalSection(&g_csGCCProvider);
  1680. DebugExitINT(CControlSAP::ConductorReleaseRequest, rc);
  1681. return rc;
  1682. }
  1683. #endif // JASPER
  1684. /*
  1685. * ConductorPleaseRequest ()
  1686. *
  1687. * Public Function Description
  1688. * This function is called by the interface when it gets a conductor
  1689. * please request from the node controller. This function passes the
  1690. * request on to the appropriate conference object as obtained from
  1691. * the list of command targets that the control sap maintains.
  1692. */
  1693. #ifdef JASPER
  1694. GCCError CControlSAP::ConductorPleaseRequest ( GCCConfID conference_id )
  1695. {
  1696. GCCError rc;
  1697. CConf *pConf;
  1698. DebugEntry(CControlSAP::ConductorPleaseRequest);
  1699. ::EnterCriticalSection(&g_csGCCProvider);
  1700. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1701. {
  1702. rc = pConf->ConductorPleaseRequest();
  1703. }
  1704. else
  1705. {
  1706. WARNING_OUT(("CControlSAP::ConductorPleaseRequest: invalid conference ID=%u", (UINT) conference_id));
  1707. rc = GCC_INVALID_CONFERENCE;
  1708. }
  1709. ::LeaveCriticalSection(&g_csGCCProvider);
  1710. DebugExitINT(CControlSAP::ConductorPleaseRequest, rc);
  1711. return rc;
  1712. }
  1713. #endif // JASPER
  1714. /*
  1715. * ConductorGiveRequest ()
  1716. *
  1717. * Public Function Description
  1718. * This function is called by the interface when it gets a conductor
  1719. * give request from the node controller. This function passes the
  1720. * request on to the appropriate conference object as obtained from
  1721. * the list of command targets that the control sap maintains.
  1722. */
  1723. #ifdef JASPER
  1724. GCCError CControlSAP::ConductorGiveRequest
  1725. (
  1726. GCCConfID conference_id,
  1727. UserID recipient_user_id
  1728. )
  1729. {
  1730. GCCError rc;
  1731. CConf *pConf;
  1732. DebugEntry(CControlSAP::ConductorGiveRequest);
  1733. // Make sure the ID of the conductorship recipient is valid.
  1734. if (recipient_user_id < MINIMUM_USER_ID_VALUE)
  1735. return (GCC_INVALID_MCS_USER_ID);
  1736. ::EnterCriticalSection(&g_csGCCProvider);
  1737. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1738. {
  1739. rc = pConf->ConductorGiveRequest (recipient_user_id);
  1740. }
  1741. else
  1742. {
  1743. WARNING_OUT(("CControlSAP::ConductorGiveRequest: invalid conference ID=%u", (UINT) conference_id));
  1744. rc = GCC_INVALID_CONFERENCE;
  1745. }
  1746. ::LeaveCriticalSection(&g_csGCCProvider);
  1747. DebugExitINT(CControlSAP::ConductorGiveRequest, rc);
  1748. return rc;
  1749. }
  1750. #endif // JASPER
  1751. /*
  1752. * ConductorGiveResponse ()
  1753. *
  1754. * Public Function Description
  1755. * This function is called by the interface when it gets a conductor
  1756. * give response from the node controller. This function passes the
  1757. * response on to the appropriate conference object as obtained from
  1758. * the list of command targets that the control sap maintains.
  1759. */
  1760. GCCError CControlSAP::ConductorGiveResponse
  1761. (
  1762. GCCConfID conference_id,
  1763. GCCResult result
  1764. )
  1765. {
  1766. GCCError rc;
  1767. CConf *pConf;
  1768. DebugEntry(CControlSAP::ConductorGiveResponse);
  1769. ::EnterCriticalSection(&g_csGCCProvider);
  1770. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1771. {
  1772. rc = pConf->ConductorGiveResponse (result);
  1773. }
  1774. else
  1775. {
  1776. WARNING_OUT(("CControlSAP::ConductorGiveResponse: invalid conference ID=%u", (UINT) conference_id));
  1777. rc = GCC_INVALID_CONFERENCE;
  1778. }
  1779. ::LeaveCriticalSection(&g_csGCCProvider);
  1780. DebugExitINT(CControlSAP::ConductorGiveResponse, rc);
  1781. return rc;
  1782. }
  1783. /*
  1784. * ConductorPermitGrantRequest ()
  1785. *
  1786. * Public Function Description
  1787. * This function is called by the interface when it gets a conductor
  1788. * permit grant request from the node controller. This function passes the
  1789. * request on to the appropriate conference object as obtained from
  1790. * the list of command targets that the control sap maintains.
  1791. */
  1792. #ifdef JASPER
  1793. GCCError CControlSAP::ConductorPermitGrantRequest
  1794. (
  1795. GCCConfID conference_id,
  1796. UINT number_granted,
  1797. PUserID granted_node_list,
  1798. UINT number_waiting,
  1799. PUserID waiting_node_list
  1800. )
  1801. {
  1802. GCCError rc;
  1803. CConf *pConf;
  1804. UINT i;
  1805. DebugEntry(CControlSAP::ConductorPermitGrantRequest);
  1806. ::EnterCriticalSection(&g_csGCCProvider);
  1807. // Check to make sure the conference exists.
  1808. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1809. {
  1810. /*
  1811. ** Run through both lists to make sure that valid MCS User IDs
  1812. ** are used.
  1813. */
  1814. for (i = 0; i < number_granted; i++)
  1815. {
  1816. if (granted_node_list[i] < MINIMUM_USER_ID_VALUE)
  1817. {
  1818. ERROR_OUT(("CControlSAP::ConductorPermitGrantRequest: invalid granted user ID"));
  1819. rc = GCC_INVALID_MCS_USER_ID;
  1820. goto MyExit;
  1821. }
  1822. }
  1823. for (i = 0; i < number_waiting; i++)
  1824. {
  1825. if (waiting_node_list[i] < MINIMUM_USER_ID_VALUE)
  1826. {
  1827. ERROR_OUT(("CControlSAP::ConductorPermitGrantRequest: invalid waiting user ID"));
  1828. rc = GCC_INVALID_MCS_USER_ID;
  1829. goto MyExit;
  1830. }
  1831. }
  1832. rc = pConf->ConductorPermitGrantRequest(number_granted,
  1833. granted_node_list,
  1834. number_waiting,
  1835. waiting_node_list);
  1836. }
  1837. else
  1838. {
  1839. rc = GCC_INVALID_CONFERENCE;
  1840. }
  1841. MyExit:
  1842. ::LeaveCriticalSection(&g_csGCCProvider);
  1843. DebugExitINT(CControlSAP::ConductorPermitGrantRequest, rc);
  1844. return rc;
  1845. }
  1846. #endif // JASPER
  1847. /*
  1848. * ConductorPermitAskRequest()
  1849. *
  1850. * Public Function Description
  1851. * This routine is called in order to ask for certain permissions to be
  1852. * granted (or not granted) by the conductor.
  1853. */
  1854. #ifdef JASPER
  1855. GCCError CControlSAP::ConductorPermitAskRequest
  1856. (
  1857. GCCConfID nConfID,
  1858. BOOL fGrantPermission
  1859. )
  1860. {
  1861. GCCError rc;
  1862. CConf *pConf;
  1863. DebugEntry(CControlSAP::ConductorPermitAskRequest);
  1864. ::EnterCriticalSection(&g_csGCCProvider);
  1865. if (NULL != (pConf = g_pGCCController->GetConfObject(nConfID)))
  1866. {
  1867. rc = pConf->ConductorPermitAskRequest(fGrantPermission);
  1868. }
  1869. else
  1870. {
  1871. WARNING_OUT(("CControlSAP::ConductorPermitAskRequest: invalid conference ID=%u", (UINT) nConfID));
  1872. rc = GCC_INVALID_CONFERENCE;
  1873. }
  1874. ::LeaveCriticalSection(&g_csGCCProvider);
  1875. DebugExitINT(CControlSAP::ConductorPermitAskRequest, rc);
  1876. return rc;
  1877. }
  1878. #endif // JASPER
  1879. /*
  1880. * ConfTimeRemainingRequest ()
  1881. *
  1882. * Public Function Description
  1883. * This function is called by the interface when it gets a conference time
  1884. * remaining request from the node controller. This function passes the
  1885. * request on to the appropriate conference object as obtained from
  1886. * the list of command targets that the control sap maintains.
  1887. */
  1888. GCCError CControlSAP::ConfTimeRemainingRequest
  1889. (
  1890. GCCConfID conference_id,
  1891. UINT time_remaining,
  1892. UserID node_id
  1893. )
  1894. {
  1895. GCCError rc;
  1896. CConf *pConf;
  1897. DebugEntry(CControlSAP::ConfTimeRemainingRequest);
  1898. ::EnterCriticalSection(&g_csGCCProvider);
  1899. // Check to make sure the node ID is valid and the conference exists.
  1900. if ((node_id < MINIMUM_USER_ID_VALUE) && (node_id != 0))
  1901. {
  1902. ERROR_OUT(("CControlSAP::ConfTimeRemainingRequest: invalid node ID"));
  1903. rc = GCC_INVALID_MCS_USER_ID;
  1904. }
  1905. else
  1906. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1907. {
  1908. rc = pConf->ConferenceTimeRemainingRequest(time_remaining, node_id);
  1909. }
  1910. else
  1911. {
  1912. WARNING_OUT(("CControlSAP::ConfTimeRemainingRequest: invalid conference ID=%u", (UINT) conference_id));
  1913. rc = GCC_INVALID_CONFERENCE;
  1914. }
  1915. ::LeaveCriticalSection(&g_csGCCProvider);
  1916. DebugExitINT(CControlSAP::ConfTimeRemainingRequest, rc);
  1917. return rc;
  1918. }
  1919. /*
  1920. * ConfTimeInquireRequest ()
  1921. *
  1922. * Public Function Description
  1923. * This function is called by the interface when it gets a conference time
  1924. * inquire request from the node controller. This function passes the
  1925. * request on to the appropriate conference object as obtained from
  1926. * the list of command targets that the control sap maintains.
  1927. */
  1928. #ifdef JASPER
  1929. GCCError CControlSAP::ConfTimeInquireRequest
  1930. (
  1931. GCCConfID conference_id,
  1932. BOOL time_is_conference_wide
  1933. )
  1934. {
  1935. GCCError rc;
  1936. CConf *pConf;
  1937. DebugEntry(CControlSAP::ConfTimeInquireRequest);
  1938. ::EnterCriticalSection(&g_csGCCProvider);
  1939. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1940. {
  1941. rc = pConf->ConfTimeInquireRequest(time_is_conference_wide);
  1942. }
  1943. else
  1944. {
  1945. WARNING_OUT(("CControlSAP::ConfTimeInquireRequest: invalid conference ID=%u", (UINT) conference_id));
  1946. rc = GCC_INVALID_CONFERENCE;
  1947. }
  1948. ::LeaveCriticalSection(&g_csGCCProvider);
  1949. DebugExitINT(CControlSAP::ConfTimeInquireRequest, rc);
  1950. return rc;
  1951. }
  1952. #endif // JASPER
  1953. /*
  1954. * ConfExtendRequest ()
  1955. *
  1956. * Public Function Description
  1957. * This function is called by the interface when it gets a conference
  1958. * extend request from the node controller. This function passes the
  1959. * request on to the appropriate conference object as obtained from
  1960. * the list of command targets that the control sap maintains.
  1961. */
  1962. #ifdef JASPER
  1963. GCCError CControlSAP::ConfExtendRequest
  1964. (
  1965. GCCConfID conference_id,
  1966. UINT extension_time,
  1967. BOOL time_is_conference_wide
  1968. )
  1969. {
  1970. GCCError rc;
  1971. CConf *pConf;
  1972. DebugEntry(CControlSAP::ConfExtendRequest);
  1973. ::EnterCriticalSection(&g_csGCCProvider);
  1974. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  1975. {
  1976. rc = pConf->ConfExtendRequest(extension_time, time_is_conference_wide);
  1977. }
  1978. else
  1979. {
  1980. WARNING_OUT(("CControlSAP::ConfExtendRequest: invalid conference ID=%u", (UINT) conference_id));
  1981. rc = GCC_INVALID_CONFERENCE;
  1982. }
  1983. ::LeaveCriticalSection(&g_csGCCProvider);
  1984. DebugExitINT(CControlSAP::ConfExtendRequest, rc);
  1985. return rc;
  1986. }
  1987. #endif // JASPER
  1988. /*
  1989. * ConfAssistanceRequest ()
  1990. *
  1991. * Public Function Description
  1992. * This function is called by the interface when it gets a conference
  1993. * assistance request from the node controller. This function passes the
  1994. * request on to the appropriate conference object as obtained from
  1995. * the list of command targets that the control sap maintains.
  1996. */
  1997. #ifdef JASPER
  1998. GCCError CControlSAP::ConfAssistanceRequest
  1999. (
  2000. GCCConfID conference_id,
  2001. UINT number_of_user_data_members,
  2002. PGCCUserData * user_data_list
  2003. )
  2004. {
  2005. GCCError rc;
  2006. CConf *pConf;
  2007. DebugEntry(CControlSAP::ConfAssistanceRequest);
  2008. ::EnterCriticalSection(&g_csGCCProvider);
  2009. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  2010. {
  2011. rc = pConf->ConfAssistanceRequest(number_of_user_data_members, user_data_list);
  2012. }
  2013. else
  2014. {
  2015. WARNING_OUT(("CControlSAP::ConfAssistanceRequest: invalid conference ID=%u", (UINT) conference_id));
  2016. rc = GCC_INVALID_CONFERENCE;
  2017. }
  2018. ::LeaveCriticalSection(&g_csGCCProvider);
  2019. DebugExitINT(CControlSAP::ConfAssistanceRequest, rc);
  2020. return rc;
  2021. }
  2022. #endif // JASPER
  2023. /*
  2024. * TextMessageRequest ()
  2025. *
  2026. * Public Function Description
  2027. * This function is called by the interface when it gets a text message
  2028. * request from the node controller. This function passes the
  2029. * request on to the appropriate conference object as obtained from
  2030. * the list of command targets that the control sap maintains.
  2031. */
  2032. #ifdef JASPER
  2033. GCCError CControlSAP::TextMessageRequest
  2034. (
  2035. GCCConfID conference_id,
  2036. LPWSTR pwszTextMsg,
  2037. UserID destination_node
  2038. )
  2039. {
  2040. GCCError rc;
  2041. CConf *pConf;
  2042. DebugEntry(CControlSAP::TextMessageRequest);
  2043. ::EnterCriticalSection(&g_csGCCProvider);
  2044. // Check to make sure the node ID is valid and the conference exists.
  2045. if ((destination_node < MINIMUM_USER_ID_VALUE) &&
  2046. (destination_node != 0))
  2047. {
  2048. ERROR_OUT(("CControlSAP::TextMessageRequest: invalid user ID"));
  2049. rc = GCC_INVALID_MCS_USER_ID;
  2050. }
  2051. else
  2052. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  2053. {
  2054. rc = pConf->TextMessageRequest(pwszTextMsg, destination_node);
  2055. }
  2056. else
  2057. {
  2058. WARNING_OUT(("CControlSAP::TextMessageRequest: invalid conference ID=%u", (UINT) conference_id));
  2059. rc = GCC_INVALID_CONFERENCE;
  2060. }
  2061. ::LeaveCriticalSection(&g_csGCCProvider);
  2062. DebugExitINT(CControlSAP::TextMessageRequest, rc);
  2063. return rc;
  2064. }
  2065. #endif // JASPER
  2066. /*
  2067. * ConfTransferRequest ()
  2068. *
  2069. * Public Function Description
  2070. * This function is called by the interface when it gets a conference
  2071. * transfer request from the node controller. This function passes the
  2072. * request on to the appropriate conference object as obtained from
  2073. * the list of command targets that the control sap maintains.
  2074. */
  2075. #ifdef JASPER
  2076. GCCError CControlSAP::ConfTransferRequest
  2077. (
  2078. GCCConfID conference_id,
  2079. PGCCConferenceName destination_conference_name,
  2080. GCCNumericString destination_conference_modifier,
  2081. UINT number_of_destination_addresses,
  2082. PGCCNetworkAddress *destination_address_list,
  2083. UINT number_of_destination_nodes,
  2084. PUserID destination_node_list,
  2085. PGCCPassword password
  2086. )
  2087. {
  2088. GCCError rc = GCC_NO_ERROR;
  2089. CPassword *password_data = NULL;
  2090. CNetAddrListContainer *network_address_list = NULL;
  2091. UINT i = 0;
  2092. DebugEntry(CControlSAP::ConfTransferRequest);
  2093. // Check for invalid conference name
  2094. if (destination_conference_name != NULL)
  2095. {
  2096. /*
  2097. ** Do not allow non-numeric or zero length strings to get
  2098. ** past this point.
  2099. */
  2100. if (destination_conference_name->numeric_string != NULL)
  2101. {
  2102. if (IsNumericNameValid (
  2103. destination_conference_name->numeric_string) == FALSE)
  2104. {
  2105. ERROR_OUT(("CControlSAP::ConfTransferRequest: invalid numeric conference name"));
  2106. rc = GCC_INVALID_CONFERENCE_NAME;
  2107. }
  2108. }
  2109. else if (destination_conference_name->text_string != NULL)
  2110. {
  2111. if (IsTextNameValid (
  2112. destination_conference_name->text_string) == FALSE)
  2113. {
  2114. ERROR_OUT(("CControlSAP::ConfTransferRequest: invalid text conference name"));
  2115. rc = GCC_INVALID_CONFERENCE_NAME;
  2116. }
  2117. }
  2118. else
  2119. {
  2120. ERROR_OUT(("CControlSAP::ConfTransferRequest: null numeric/text conference name"));
  2121. rc = GCC_INVALID_CONFERENCE_NAME;
  2122. }
  2123. if ((rc == GCC_NO_ERROR) &&
  2124. (destination_conference_name->text_string != NULL))
  2125. {
  2126. if (IsTextNameValid (
  2127. destination_conference_name->text_string) == FALSE)
  2128. {
  2129. ERROR_OUT(("CControlSAP::ConfTransferRequest: invalid text conference name"));
  2130. rc = GCC_INVALID_CONFERENCE_NAME;
  2131. }
  2132. }
  2133. }
  2134. else
  2135. {
  2136. ERROR_OUT(("CControlSAP::ConfTransferRequest: null conference name"));
  2137. rc = GCC_INVALID_CONFERENCE_NAME;
  2138. }
  2139. // Check for valid conference modifier
  2140. if ((destination_conference_modifier != NULL) &&
  2141. (rc == GCC_NO_ERROR))
  2142. {
  2143. if (IsNumericNameValid(destination_conference_modifier) == FALSE)
  2144. {
  2145. ERROR_OUT(("CControlSAP::ConfTransferRequest: invalid conference modifier"));
  2146. rc = GCC_INVALID_CONFERENCE_MODIFIER;
  2147. }
  2148. }
  2149. // Check for valid password
  2150. if ((password != NULL) &&
  2151. (rc == GCC_NO_ERROR))
  2152. {
  2153. if (password->numeric_string != NULL)
  2154. {
  2155. if (IsNumericNameValid(password->numeric_string) == FALSE)
  2156. {
  2157. ERROR_OUT(("CControlSAP::ConfTransferRequest: invalid password"));
  2158. rc = GCC_INVALID_PASSWORD;
  2159. }
  2160. }
  2161. else
  2162. {
  2163. ERROR_OUT(("CControlSAP::ConfTransferRequest: null password"));
  2164. rc = GCC_INVALID_PASSWORD;
  2165. }
  2166. }
  2167. // Check for invalid user IDs
  2168. if (rc == GCC_NO_ERROR)
  2169. {
  2170. while (i != number_of_destination_nodes)
  2171. {
  2172. if (destination_node_list[i] < MINIMUM_USER_ID_VALUE)
  2173. {
  2174. rc = GCC_INVALID_MCS_USER_ID;
  2175. break;
  2176. }
  2177. i++;
  2178. }
  2179. }
  2180. if (rc == GCC_NO_ERROR)
  2181. {
  2182. CConf *pConf;
  2183. ::EnterCriticalSection(&g_csGCCProvider);
  2184. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  2185. {
  2186. // Construct the password container
  2187. if (password != NULL)
  2188. {
  2189. DBG_SAVE_FILE_LINE
  2190. password_data = new CPassword(password, &rc);
  2191. if (password_data == NULL)
  2192. {
  2193. ERROR_OUT(("CControlSAP::ConfTransferRequest: can't create CPassword"));
  2194. rc = GCC_ALLOCATION_FAILURE;
  2195. }
  2196. }
  2197. // Construct the network address(es) container
  2198. if ((number_of_destination_addresses != 0) &&
  2199. (rc == GCC_NO_ERROR))
  2200. {
  2201. DBG_SAVE_FILE_LINE
  2202. network_address_list = new CNetAddrListContainer(
  2203. number_of_destination_addresses,
  2204. destination_address_list,
  2205. &rc);
  2206. if (network_address_list == NULL)
  2207. {
  2208. ERROR_OUT(("CControlSAP::CNetAddrListContainer: can't create CPassword"));
  2209. rc = GCC_ALLOCATION_FAILURE;
  2210. }
  2211. }
  2212. if (rc == GCC_NO_ERROR)
  2213. {
  2214. rc = pConf->ConfTransferRequest(destination_conference_name,
  2215. destination_conference_modifier,
  2216. network_address_list,
  2217. number_of_destination_nodes,
  2218. destination_node_list,
  2219. password_data);
  2220. }
  2221. // Free the data associated with the containers.
  2222. if (password_data != NULL)
  2223. {
  2224. password_data->Release();
  2225. }
  2226. if (network_address_list != NULL)
  2227. {
  2228. network_address_list->Release();
  2229. }
  2230. }
  2231. else
  2232. {
  2233. rc = GCC_INVALID_CONFERENCE;
  2234. }
  2235. ::LeaveCriticalSection(&g_csGCCProvider);
  2236. }
  2237. DebugExitINT(CControlSAP::ConfTransferRequest, rc);
  2238. return rc;
  2239. }
  2240. #endif // JASPER
  2241. /*
  2242. * ConfAddRequest ()
  2243. *
  2244. * Public Function Description
  2245. * This function is called by the interface when it gets a conference
  2246. * add request from the node controller. This function passes the
  2247. * request on to the appropriate conference object as obtained from
  2248. * the list of command targets that the control sap maintains.
  2249. */
  2250. #ifdef JASPER
  2251. GCCError CControlSAP::ConfAddRequest
  2252. (
  2253. GCCConfID conference_id,
  2254. UINT number_of_network_addresses,
  2255. PGCCNetworkAddress * network_address_list,
  2256. UserID adding_node,
  2257. UINT number_of_user_data_members,
  2258. PGCCUserData * user_data_list
  2259. )
  2260. {
  2261. GCCError rc = GCC_NO_ERROR;
  2262. CNetAddrListContainer *network_address_container = NULL;
  2263. CUserDataListContainer *user_data_container = NULL;
  2264. CConf *pConf;
  2265. DebugEntry(CControlSAP::ConfAddRequest);
  2266. if ((adding_node < MINIMUM_USER_ID_VALUE) &&
  2267. (adding_node != 0))
  2268. {
  2269. ERROR_OUT(("CControlSAP::ConfAddRequest: invalid adding node ID"));
  2270. return GCC_INVALID_MCS_USER_ID;
  2271. }
  2272. if (number_of_network_addresses == 0)
  2273. {
  2274. ERROR_OUT(("CControlSAP::ConfAddRequest: no network address"));
  2275. return GCC_BAD_NETWORK_ADDRESS;
  2276. }
  2277. ::EnterCriticalSection(&g_csGCCProvider);
  2278. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  2279. {
  2280. // Construct the network address(es) container
  2281. if (number_of_network_addresses != 0)
  2282. {
  2283. DBG_SAVE_FILE_LINE
  2284. network_address_container = new CNetAddrListContainer(
  2285. number_of_network_addresses,
  2286. network_address_list,
  2287. &rc);
  2288. if (network_address_container == NULL)
  2289. {
  2290. ERROR_OUT(("CControlSAP::ConfAddRequest: can't create CNetAddrListContainer"));
  2291. rc = GCC_ALLOCATION_FAILURE;
  2292. }
  2293. }
  2294. // Construct the user data list container
  2295. if ((number_of_user_data_members != 0) &&
  2296. (rc == GCC_NO_ERROR))
  2297. {
  2298. DBG_SAVE_FILE_LINE
  2299. user_data_container = new CUserDataListContainer(number_of_user_data_members, user_data_list, &rc);
  2300. if (user_data_container == NULL)
  2301. {
  2302. ERROR_OUT(("CControlSAP::ConfAddRequest: can't create CUserDataListContainer"));
  2303. rc = GCC_ALLOCATION_FAILURE;
  2304. }
  2305. }
  2306. else
  2307. {
  2308. user_data_container = NULL;
  2309. }
  2310. if (rc == GCC_NO_ERROR)
  2311. {
  2312. rc = pConf->ConfAddRequest(network_address_container,
  2313. adding_node,
  2314. user_data_container);
  2315. }
  2316. // Free the data associated with the containers.
  2317. if (network_address_container != NULL)
  2318. {
  2319. network_address_container->Release();
  2320. }
  2321. if (user_data_container != NULL)
  2322. {
  2323. user_data_container->Release();
  2324. }
  2325. }
  2326. else
  2327. {
  2328. rc = GCC_INVALID_CONFERENCE;
  2329. }
  2330. ::LeaveCriticalSection(&g_csGCCProvider);
  2331. DebugExitINT(CControlSAP::ConfAddRequest, rc);
  2332. return rc;
  2333. }
  2334. #endif // JASPER
  2335. /*
  2336. * ConfAddResponse ()
  2337. *
  2338. * Public Function Description
  2339. * This function is called by the interface when it gets a conference
  2340. * add response from the node controller. This function passes the
  2341. * response on to the appropriate conference object as obtained from
  2342. * the list of command targets that the control sap maintains.
  2343. */
  2344. GCCError CControlSAP::ConfAddResponse
  2345. (
  2346. GCCResponseTag add_response_tag,
  2347. GCCConfID conference_id,
  2348. UserID requesting_node,
  2349. UINT number_of_user_data_members,
  2350. PGCCUserData * user_data_list,
  2351. GCCResult result
  2352. )
  2353. {
  2354. GCCError rc = GCC_NO_ERROR;
  2355. CUserDataListContainer *user_data_container = NULL;
  2356. CConf *pConf;
  2357. DebugEntry(CControlSAP::ConfAddResponse);
  2358. if (requesting_node < MINIMUM_USER_ID_VALUE)
  2359. {
  2360. ERROR_OUT(("CControlSAP::ConfAddResponse: invalid user ID"));
  2361. return GCC_INVALID_MCS_USER_ID;
  2362. }
  2363. ::EnterCriticalSection(&g_csGCCProvider);
  2364. // Check to make sure the conference exists.
  2365. if (NULL != (pConf = g_pGCCController->GetConfObject(conference_id)))
  2366. {
  2367. // Construct the user data list container
  2368. if ((number_of_user_data_members != 0) &&
  2369. (rc == GCC_NO_ERROR))
  2370. {
  2371. DBG_SAVE_FILE_LINE
  2372. user_data_container = new CUserDataListContainer(number_of_user_data_members, user_data_list, &rc);
  2373. if (user_data_container == NULL)
  2374. {
  2375. ERROR_OUT(("CControlSAP::ConfAddResponse: can't create CUserDataListContainer"));
  2376. rc = GCC_ALLOCATION_FAILURE;
  2377. }
  2378. }
  2379. else
  2380. {
  2381. user_data_container = NULL;
  2382. }
  2383. if (rc == GCC_NO_ERROR)
  2384. {
  2385. rc = pConf->ConfAddResponse(add_response_tag,
  2386. requesting_node,
  2387. user_data_container,
  2388. result);
  2389. }
  2390. // Free the data associated with the user data container.
  2391. if (user_data_container != NULL)
  2392. {
  2393. user_data_container->Release();
  2394. }
  2395. }
  2396. else
  2397. {
  2398. WARNING_OUT(("CControlSAP::ConfAddResponse: invalid conference ID=%u", (UINT) conference_id));
  2399. rc = GCC_INVALID_CONFERENCE;
  2400. }
  2401. ::LeaveCriticalSection(&g_csGCCProvider);
  2402. DebugExitINT(CControlSAP::ConfAddResponse, rc);
  2403. return rc;
  2404. }
  2405. #ifdef NM_RESET_DEVICE
  2406. /*
  2407. * ResetDevice ()
  2408. *
  2409. * Public Function Description
  2410. * This routine is called in order to explicitly reset a particular
  2411. * transport stack. The call is routed to the controller in order to take
  2412. * the appropriate action.
  2413. */
  2414. GCCError CControlSAP::ResetDevice ( LPSTR device_identifier )
  2415. {
  2416. GCCError rc;
  2417. MCSError mcs_error;
  2418. DebugEntry(CControlSAP::ResetDevice);
  2419. ::EnterCriticalSection(&g_csGCCProvider);
  2420. // Call back the controller to reset the device.
  2421. mcs_error = g_pMCSIntf->ResetDevice(device_identifier);
  2422. rc = g_pMCSIntf->TranslateMCSIFErrorToGCCError(mcs_error);
  2423. //
  2424. // If the the node controller was in a query, this will tell the node controller
  2425. // to remove the query.
  2426. //
  2427. ConfQueryConfirm(GCC_TERMINAL, NULL, NULL, NULL,
  2428. GCC_RESULT_CONNECT_PROVIDER_FAILED, NULL);
  2429. ::LeaveCriticalSection(&g_csGCCProvider);
  2430. DebugExitINT(CControlSAP::ResetDevice, rc);
  2431. return rc;
  2432. }
  2433. #endif // NM_RESET_DEVICE
  2434. /*
  2435. * ConfCreateIndication ()
  2436. *
  2437. * Public Function Description
  2438. * This function is called by the GCC Controller when it gets a connect
  2439. * provider indication from MCS, carrying a conference create request PDU.
  2440. * This function fills in all the parameters in the CreateIndicationInfo
  2441. * structure. It then adds it to a queue of messages supposed to be sent to
  2442. * the node controller in the next heartbeat.
  2443. */
  2444. GCCError CControlSAP::ConfCreateIndication
  2445. (
  2446. PGCCConferenceName conference_name,
  2447. GCCConfID conference_id,
  2448. CPassword *convener_password,
  2449. CPassword *password,
  2450. BOOL conference_is_locked,
  2451. BOOL conference_is_listed,
  2452. BOOL conference_is_conductible,
  2453. GCCTerminationMethod termination_method,
  2454. PPrivilegeListData conductor_privilege_list,
  2455. PPrivilegeListData conducted_mode_privilege_list,
  2456. PPrivilegeListData non_conducted_privilege_list,
  2457. LPWSTR pwszConfDescriptor,
  2458. LPWSTR pwszCallerID,
  2459. TransportAddress calling_address,
  2460. TransportAddress called_address,
  2461. PDomainParameters domain_parameters,
  2462. CUserDataListContainer *user_data_list,
  2463. ConnectionHandle connection_handle
  2464. )
  2465. {
  2466. GCCError rc;
  2467. DebugEntry(CControlSAP::ConfCreateIndication);
  2468. #ifdef GCCNC_DIRECT_INDICATION
  2469. GCCCtrlSapMsg Msg;
  2470. Msg.message_type = GCC_CREATE_INDICATION;
  2471. /*
  2472. ** Copy the information that needs to be sent to the node
  2473. ** controller into local memory that can be deleted once the
  2474. ** information to be sent to the application is flushed. Note that
  2475. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  2476. ** action is taken on subsequent calls to that routine.
  2477. */
  2478. // start with success
  2479. rc = GCC_NO_ERROR;
  2480. // Copy the conference name
  2481. ::CSAP_CopyDataToGCCMessage_ConfName(
  2482. conference_name,
  2483. &(Msg.u.create_indication.conference_name));
  2484. // Copy the Convener Password
  2485. ::CSAP_CopyDataToGCCMessage_Password(
  2486. convener_password,
  2487. &(Msg.u.create_indication.convener_password));
  2488. // Copy the Password
  2489. ::CSAP_CopyDataToGCCMessage_Password(
  2490. password,
  2491. &(Msg.u.create_indication.password));
  2492. // Copy the Conductor Privilege List
  2493. GCCConfPrivileges _ConductorPrivileges;
  2494. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  2495. conductor_privilege_list,
  2496. &(Msg.u.create_indication.conductor_privilege_list),
  2497. &_ConductorPrivileges);
  2498. // Copy the Conducted-mode Conference Privilege List
  2499. GCCConfPrivileges _ConductedModePrivileges;
  2500. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  2501. conducted_mode_privilege_list,
  2502. &(Msg.u.create_indication.conducted_mode_privilege_list),
  2503. &_ConductedModePrivileges);
  2504. // Copy the Non-Conducted-mode Conference Privilege List
  2505. GCCConfPrivileges _NonConductedPrivileges;
  2506. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  2507. non_conducted_privilege_list,
  2508. &(Msg.u.create_indication.non_conducted_privilege_list),
  2509. &_NonConductedPrivileges);
  2510. // Copy the Conference Descriptor
  2511. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  2512. pwszConfDescriptor,
  2513. &(Msg.u.create_indication.conference_descriptor));
  2514. // Copy the Caller Identifier
  2515. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  2516. pwszCallerID,
  2517. &(Msg.u.create_indication.caller_identifier));
  2518. // Copy the Calling Address
  2519. ::CSAP_CopyDataToGCCMessage_Call(
  2520. calling_address,
  2521. &(Msg.u.create_indication.calling_address));
  2522. // Copy the Called Address
  2523. ::CSAP_CopyDataToGCCMessage_Call(
  2524. called_address,
  2525. &(Msg.u.create_indication.called_address));
  2526. // Copy the Domain Parameters
  2527. DomainParameters _DomainParams;
  2528. ::CSAP_CopyDataToGCCMessage_DomainParams(
  2529. domain_parameters,
  2530. &(Msg.u.create_indication.domain_parameters),
  2531. &_DomainParams);
  2532. // Copy the User Data
  2533. LPBYTE pUserDataMemory = NULL;
  2534. if (user_data_list != NULL)
  2535. {
  2536. rc = RetrieveUserDataList(
  2537. user_data_list,
  2538. &(Msg.u.create_indication.number_of_user_data_members),
  2539. &(Msg.u.create_indication.user_data_list),
  2540. &pUserDataMemory);
  2541. }
  2542. else
  2543. {
  2544. Msg.u.create_indication.number_of_user_data_members = 0;
  2545. Msg.u.create_indication.user_data_list = NULL;
  2546. }
  2547. if (GCC_NO_ERROR == rc)
  2548. {
  2549. // Queue up the message for delivery to the Node Controller.
  2550. Msg.nConfID = conference_id;
  2551. Msg.u.create_indication.conference_id = conference_id;
  2552. Msg.u.create_indication.conference_is_locked = conference_is_locked;
  2553. Msg.u.create_indication.conference_is_listed = conference_is_listed;
  2554. Msg.u.create_indication.conference_is_conductible = conference_is_conductible;
  2555. Msg.u.create_indication.termination_method = termination_method;
  2556. Msg.u.create_indication.connection_handle = connection_handle;
  2557. SendCtrlSapMsg(&Msg);
  2558. delete pUserDataMemory;
  2559. }
  2560. #else
  2561. GCCCtrlSapMsgEx *pMsgEx;
  2562. //
  2563. // Allocate control sap message.
  2564. //
  2565. DBG_SAVE_FILE_LINE
  2566. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CREATE_INDICATION, TRUE)))
  2567. {
  2568. ::ZeroMemory(&(pMsgEx->Msg.u.create_indication), sizeof(pMsgEx->Msg.u.create_indication));
  2569. }
  2570. else
  2571. {
  2572. ERROR_OUT(("CControlSAP::ConfCreateIndication: can't create GCCCtrlSapMsgEx"));
  2573. rc = GCC_ALLOCATION_FAILURE;
  2574. goto MyExit;
  2575. }
  2576. /*
  2577. ** Copy the information that needs to be sent to the node
  2578. ** controller into local memory that can be deleted once the
  2579. ** information to be sent to the application is flushed. Note that
  2580. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  2581. ** action is taken on subsequent calls to that routine.
  2582. */
  2583. // start with success
  2584. rc = GCC_NO_ERROR;
  2585. // Copy the conference name
  2586. ::CSAP_CopyDataToGCCMessage_ConfName(
  2587. pMsgEx->pToDelete,
  2588. conference_name,
  2589. &(pMsgEx->Msg.u.create_indication.conference_name),
  2590. &rc);
  2591. // Copy the Convener Password
  2592. ::CSAP_CopyDataToGCCMessage_Password(
  2593. TRUE, // convener password
  2594. pMsgEx->pToDelete,
  2595. convener_password,
  2596. &(pMsgEx->Msg.u.create_indication.convener_password),
  2597. &rc);
  2598. // Copy the Password
  2599. ::CSAP_CopyDataToGCCMessage_Password(
  2600. FALSE, // non-convener password
  2601. pMsgEx->pToDelete,
  2602. password,
  2603. &(pMsgEx->Msg.u.create_indication.password),
  2604. &rc);
  2605. // Copy the Conductor Privilege List
  2606. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  2607. conductor_privilege_list,
  2608. &(pMsgEx->Msg.u.create_indication.conductor_privilege_list),
  2609. &rc);
  2610. pMsgEx->pToDelete->conductor_privilege_list = pMsgEx->Msg.u.create_indication.conductor_privilege_list;
  2611. // Copy the Conducted-mode Conference Privilege List
  2612. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  2613. conducted_mode_privilege_list,
  2614. &(pMsgEx->Msg.u.create_indication.conducted_mode_privilege_list),
  2615. &rc);
  2616. pMsgEx->pToDelete->conducted_mode_privilege_list = pMsgEx->Msg.u.create_indication.conducted_mode_privilege_list;
  2617. // Copy the Non-Conducted-mode Conference Privilege List
  2618. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  2619. non_conducted_privilege_list,
  2620. &(pMsgEx->Msg.u.create_indication.non_conducted_privilege_list),
  2621. &rc);
  2622. pMsgEx->pToDelete->non_conducted_privilege_list = pMsgEx->Msg.u.create_indication.non_conducted_privilege_list;
  2623. // Copy the Conference Descriptor
  2624. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  2625. FALSE, // conference descriptor
  2626. pMsgEx->pToDelete,
  2627. pwszConfDescriptor,
  2628. &(pMsgEx->Msg.u.create_indication.conference_descriptor),
  2629. &rc);
  2630. // Copy the Caller Identifier
  2631. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  2632. TRUE, // caller id
  2633. pMsgEx->pToDelete,
  2634. pwszCallerID,
  2635. &(pMsgEx->Msg.u.create_indication.caller_identifier),
  2636. &rc);
  2637. // Copy the Calling Address
  2638. ::CSAP_CopyDataToGCCMessage_Call(
  2639. TRUE, // calling address
  2640. pMsgEx->pToDelete,
  2641. calling_address,
  2642. &(pMsgEx->Msg.u.create_indication.calling_address),
  2643. &rc);
  2644. // Copy the Called Address
  2645. ::CSAP_CopyDataToGCCMessage_Call(
  2646. FALSE, // called address
  2647. pMsgEx->pToDelete,
  2648. called_address,
  2649. &(pMsgEx->Msg.u.create_indication.called_address),
  2650. &rc);
  2651. // Copy the Domain Parameters
  2652. ::CSAP_CopyDataToGCCMessage_DomainParams(
  2653. pMsgEx->pToDelete,
  2654. domain_parameters,
  2655. &(pMsgEx->Msg.u.create_indication.domain_parameters),
  2656. &rc);
  2657. if (GCC_NO_ERROR != rc)
  2658. {
  2659. ERROR_OUT(("CControlSAP::ConfCreateIndication: can't copy data to gcc message"));
  2660. goto MyExit;
  2661. }
  2662. // Copy the User Data
  2663. if (user_data_list != NULL)
  2664. {
  2665. rc = RetrieveUserDataList(
  2666. user_data_list,
  2667. &(pMsgEx->Msg.u.create_indication.number_of_user_data_members),
  2668. &(pMsgEx->Msg.u.create_indication.user_data_list),
  2669. &(pMsgEx->pToDelete->user_data_list_memory));
  2670. if (GCC_NO_ERROR != rc)
  2671. {
  2672. goto MyExit;
  2673. }
  2674. }
  2675. else
  2676. {
  2677. // pMsgEx->Msg.u.create_indication.number_of_user_data_members = 0;
  2678. // pMsgEx->Msg.u.create_indication.user_data_list = NULL;
  2679. }
  2680. // Queue up the message for delivery to the Node Controller.
  2681. pMsgEx->Msg.nConfID = conference_id;
  2682. pMsgEx->Msg.u.create_indication.conference_id = conference_id;
  2683. pMsgEx->Msg.u.create_indication.conference_is_locked = conference_is_locked;
  2684. pMsgEx->Msg.u.create_indication.conference_is_listed = conference_is_listed;
  2685. pMsgEx->Msg.u.create_indication.conference_is_conductible = conference_is_conductible;
  2686. pMsgEx->Msg.u.create_indication.termination_method = termination_method;
  2687. pMsgEx->Msg.u.create_indication.connection_handle = connection_handle;
  2688. PostIndCtrlSapMsg(pMsgEx);
  2689. MyExit:
  2690. if (GCC_NO_ERROR != rc)
  2691. {
  2692. FreeCtrlSapMsgEx(pMsgEx);
  2693. HandleResourceFailure(rc);
  2694. }
  2695. #endif // GCCNC_DIRECT_INDICATION
  2696. DebugExitINT(CControlSAP::ConfCreateIndication, rc);
  2697. return rc;
  2698. }
  2699. /*
  2700. * ConfQueryIndication ()
  2701. *
  2702. * Public Function Description
  2703. * This function is called by the GCC Controller when it need to send a
  2704. * conference query indication to the node controller. It adds the message
  2705. * to a queue of messages to be sent to the node controller in the next
  2706. * heartbeat.
  2707. */
  2708. GCCError CControlSAP::ConfQueryIndication
  2709. (
  2710. GCCResponseTag query_response_tag,
  2711. GCCNodeType node_type,
  2712. PGCCAsymmetryIndicator asymmetry_indicator,
  2713. TransportAddress calling_address,
  2714. TransportAddress called_address,
  2715. CUserDataListContainer *user_data_list,
  2716. ConnectionHandle connection_handle
  2717. )
  2718. {
  2719. GCCError rc;
  2720. DebugEntry(CControlSAP::ConfQueryIndication);
  2721. #ifdef GCCNC_DIRECT_INDICATION
  2722. GCCCtrlSapMsg Msg;
  2723. Msg.message_type = GCC_QUERY_INDICATION;
  2724. /*
  2725. ** Copy the information that needs to be sent to the node
  2726. ** controller into local memory that can be deleted once the
  2727. ** information to be sent to the application is flushed. Note that
  2728. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  2729. ** action is taken on subsequent calls to that routine.
  2730. */
  2731. // start with success
  2732. rc = GCC_NO_ERROR;
  2733. // Copy the Calling Address
  2734. ::CSAP_CopyDataToGCCMessage_Call(
  2735. calling_address,
  2736. &(Msg.u.query_indication.calling_address));
  2737. // Copy the Calling Address
  2738. ::CSAP_CopyDataToGCCMessage_Call(
  2739. called_address,
  2740. &(Msg.u.query_indication.called_address));
  2741. // Copy the asymmetry indicator if it exists
  2742. GCCAsymmetryIndicator AsymIndicator;
  2743. if (asymmetry_indicator != NULL)
  2744. {
  2745. Msg.u.query_indication.asymmetry_indicator = &AsymIndicator;
  2746. AsymIndicator = *asymmetry_indicator;
  2747. }
  2748. else
  2749. {
  2750. Msg.u.query_indication.asymmetry_indicator = NULL;
  2751. }
  2752. // Lock and Copy the user data if it exists
  2753. LPBYTE pUserDataMemory = NULL;
  2754. if (user_data_list != NULL)
  2755. {
  2756. rc = RetrieveUserDataList(
  2757. user_data_list,
  2758. &(Msg.u.query_indication.number_of_user_data_members),
  2759. &(Msg.u.query_indication.user_data_list),
  2760. &pUserDataMemory);
  2761. }
  2762. else
  2763. {
  2764. Msg.u.query_indication.number_of_user_data_members = 0;
  2765. Msg.u.query_indication.user_data_list = NULL;
  2766. }
  2767. if (GCC_NO_ERROR == rc)
  2768. {
  2769. // If everything is OK add the message to the message queue
  2770. Msg.u.query_indication.query_response_tag = query_response_tag;
  2771. Msg.u.query_indication.node_type = node_type;
  2772. Msg.u.query_indication.connection_handle = connection_handle;
  2773. SendCtrlSapMsg(&Msg);
  2774. delete pUserDataMemory;
  2775. }
  2776. #else
  2777. GCCCtrlSapMsgEx *pMsgEx;
  2778. //
  2779. // Allocate control sap message.
  2780. //
  2781. DBG_SAVE_FILE_LINE
  2782. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_QUERY_INDICATION, TRUE)))
  2783. {
  2784. ::ZeroMemory(&(pMsgEx->Msg.u.query_indication), sizeof(pMsgEx->Msg.u.query_indication));
  2785. }
  2786. else
  2787. {
  2788. ERROR_OUT(("CControlSAP::ConfCreateIndication: can't create GCCCtrlSapMsgEx"));
  2789. rc = GCC_ALLOCATION_FAILURE;
  2790. goto MyExit;
  2791. }
  2792. /*
  2793. ** Copy the information that needs to be sent to the node
  2794. ** controller into local memory that can be deleted once the
  2795. ** information to be sent to the application is flushed. Note that
  2796. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  2797. ** action is taken on subsequent calls to that routine.
  2798. */
  2799. // start with success
  2800. rc = GCC_NO_ERROR;
  2801. // Copy the Calling Address
  2802. ::CSAP_CopyDataToGCCMessage_Call(
  2803. TRUE, // calling address
  2804. pMsgEx->pToDelete,
  2805. calling_address,
  2806. &(pMsgEx->Msg.u.query_indication.calling_address),
  2807. &rc);
  2808. // Copy the Calling Address
  2809. ::CSAP_CopyDataToGCCMessage_Call(
  2810. FALSE, // called address
  2811. pMsgEx->pToDelete,
  2812. called_address,
  2813. &(pMsgEx->Msg.u.query_indication.called_address),
  2814. &rc);
  2815. if (GCC_NO_ERROR != rc)
  2816. {
  2817. ERROR_OUT(("CControlSAP::ConfQueryIndication: can't copy data to gcc message"));
  2818. goto MyExit;
  2819. }
  2820. // Copy the asymmetry indicator if it exists
  2821. if (asymmetry_indicator != NULL)
  2822. {
  2823. DBG_SAVE_FILE_LINE
  2824. pMsgEx->Msg.u.query_indication.asymmetry_indicator = new GCCAsymmetryIndicator;
  2825. if (pMsgEx->Msg.u.query_indication.asymmetry_indicator != NULL)
  2826. {
  2827. *(pMsgEx->Msg.u.query_indication.asymmetry_indicator) = *asymmetry_indicator;
  2828. }
  2829. else
  2830. {
  2831. rc = GCC_ALLOCATION_FAILURE;
  2832. goto MyExit;
  2833. }
  2834. }
  2835. else
  2836. {
  2837. // pMsgEx->Msg.u.query_indication.asymmetry_indicator = NULL;
  2838. }
  2839. // Lock and Copy the user data if it exists
  2840. if (user_data_list != NULL)
  2841. {
  2842. rc = RetrieveUserDataList(
  2843. user_data_list,
  2844. &(pMsgEx->Msg.u.query_indication.number_of_user_data_members),
  2845. &(pMsgEx->Msg.u.query_indication.user_data_list),
  2846. &(pMsgEx->pToDelete->user_data_list_memory));
  2847. if (GCC_NO_ERROR != rc)
  2848. {
  2849. goto MyExit;
  2850. }
  2851. }
  2852. else
  2853. {
  2854. // pMsgEx->Msg.u.query_indication.number_of_user_data_members = 0;
  2855. // pMsgEx->Msg.u.query_indication.user_data_list = NULL;
  2856. }
  2857. // If everything is OK add the message to the message queue
  2858. pMsgEx->Msg.u.query_indication.query_response_tag = query_response_tag;
  2859. pMsgEx->Msg.u.query_indication.node_type = node_type;
  2860. pMsgEx->Msg.u.query_indication.connection_handle = connection_handle;
  2861. PostIndCtrlSapMsg(pMsgEx);
  2862. MyExit:
  2863. if (GCC_NO_ERROR != rc)
  2864. {
  2865. FreeCtrlSapMsgEx(pMsgEx);
  2866. HandleResourceFailure(rc);
  2867. }
  2868. #endif // GCCNC_DIRECT_INDICATION
  2869. DebugExitINT(CControlSAP::ConfQueryIndication, rc);
  2870. return rc;
  2871. }
  2872. /*
  2873. * ConfQueryConfirm ()
  2874. *
  2875. * Public Function Description
  2876. * This function is called by the GCC Controller when it need to send a
  2877. * conference query confirm to the node controller. It adds the message
  2878. * to a queue of messages to be sent to the node controller in the next
  2879. * heartbeat.
  2880. */
  2881. GCCError CControlSAP::ConfQueryConfirm
  2882. (
  2883. GCCNodeType node_type,
  2884. PGCCAsymmetryIndicator asymmetry_indicator,
  2885. CConfDescriptorListContainer *conference_list,
  2886. CUserDataListContainer *user_data_list,
  2887. GCCResult result,
  2888. ConnectionHandle connection_handle
  2889. )
  2890. {
  2891. GCCError rc = GCC_NO_ERROR;
  2892. DebugEntry(CControlSAP::ConfQueryConfirm);
  2893. #ifdef GCCNC_DIRECT_CONFIRM
  2894. GCCCtrlSapMsg Msg;
  2895. Msg.message_type = GCC_QUERY_CONFIRM;
  2896. GCCAsymmetryIndicator _AsymIndicator;
  2897. if (asymmetry_indicator != NULL)
  2898. {
  2899. Msg.u.query_confirm.asymmetry_indicator = &_AsymIndicator;
  2900. _AsymIndicator = *asymmetry_indicator;
  2901. }
  2902. else
  2903. {
  2904. Msg.u.query_confirm.asymmetry_indicator = NULL;
  2905. }
  2906. // Get the conference descriptor list if one exists
  2907. if (conference_list != NULL)
  2908. {
  2909. rc = conference_list->LockConferenceDescriptorList();
  2910. if (rc == GCC_NO_ERROR)
  2911. {
  2912. conference_list->GetConferenceDescriptorList(
  2913. &(Msg.u.query_confirm.conference_descriptor_list),
  2914. &(Msg.u.query_confirm.number_of_descriptors));
  2915. }
  2916. }
  2917. else
  2918. {
  2919. Msg.u.query_confirm.conference_descriptor_list = NULL;
  2920. Msg.u.query_confirm.number_of_descriptors = 0;
  2921. }
  2922. // Lock and Copy the user data if it exists
  2923. LPBYTE pUserDataMemory = NULL;
  2924. if (user_data_list != NULL)
  2925. {
  2926. rc = RetrieveUserDataList(
  2927. user_data_list,
  2928. &(Msg.u.query_confirm.number_of_user_data_members),
  2929. &(Msg.u.query_confirm.user_data_list),
  2930. &pUserDataMemory);
  2931. }
  2932. else
  2933. {
  2934. Msg.u.query_confirm.number_of_user_data_members = 0;
  2935. Msg.u.query_confirm.user_data_list = NULL;
  2936. }
  2937. if (rc == GCC_NO_ERROR)
  2938. {
  2939. Msg.u.query_confirm.node_type = node_type;
  2940. Msg.u.query_confirm.result = result;
  2941. Msg.u.query_confirm.connection_handle = connection_handle;
  2942. // Queue up the message for delivery to the Node Controller.
  2943. SendCtrlSapMsg(&Msg);
  2944. // clean up
  2945. delete pUserDataMemory;
  2946. }
  2947. else
  2948. {
  2949. HandleResourceFailure(rc);
  2950. }
  2951. // clean up
  2952. if (NULL != conference_list)
  2953. {
  2954. conference_list->UnLockConferenceDescriptorList();
  2955. }
  2956. #else
  2957. GCCCtrlSapMsgEx *pMsgEx;
  2958. //
  2959. // Allocate control sap message.
  2960. //
  2961. DBG_SAVE_FILE_LINE
  2962. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_QUERY_CONFIRM, TRUE)))
  2963. {
  2964. ::ZeroMemory(&(pMsgEx->Msg.u.query_confirm), sizeof(pMsgEx->Msg.u.query_confirm));
  2965. if (asymmetry_indicator != NULL)
  2966. {
  2967. DBG_SAVE_FILE_LINE
  2968. pMsgEx->Msg.u.query_confirm.asymmetry_indicator = new GCCAsymmetryIndicator;
  2969. if (pMsgEx->Msg.u.query_confirm.asymmetry_indicator != NULL)
  2970. {
  2971. *(pMsgEx->Msg.u.query_confirm.asymmetry_indicator) = *asymmetry_indicator;
  2972. }
  2973. else
  2974. {
  2975. rc = GCC_ALLOCATION_FAILURE;
  2976. ERROR_OUT(("CControlSAP::ConfQueryConfirm: can't create GCCAsymmetryIndicator"));
  2977. }
  2978. }
  2979. else
  2980. {
  2981. // pMsgEx->Msg.u.query_confirm.asymmetry_indicator = NULL;
  2982. }
  2983. // Get the conference descriptor list if one exists
  2984. if (conference_list != NULL)
  2985. {
  2986. pMsgEx->pToDelete->conference_list = conference_list;
  2987. rc = conference_list->LockConferenceDescriptorList();
  2988. if (rc == GCC_NO_ERROR)
  2989. {
  2990. conference_list->GetConferenceDescriptorList (
  2991. &(pMsgEx->Msg.u.query_confirm.conference_descriptor_list),
  2992. &(pMsgEx->Msg.u.query_confirm.number_of_descriptors));
  2993. }
  2994. }
  2995. else
  2996. {
  2997. // pMsgEx->Msg.u.query_confirm.conference_descriptor_list = NULL;
  2998. // pMsgEx->Msg.u.query_confirm.number_of_descriptors = 0;
  2999. }
  3000. // Lock and Copy the user data if it exists
  3001. if (user_data_list != NULL)
  3002. {
  3003. rc = RetrieveUserDataList (
  3004. user_data_list,
  3005. &(pMsgEx->Msg.u.query_confirm.number_of_user_data_members),
  3006. &(pMsgEx->Msg.u.query_confirm.user_data_list),
  3007. &(pMsgEx->pToDelete->user_data_list_memory));
  3008. }
  3009. else
  3010. {
  3011. // pMsgEx->Msg.u.query_confirm.number_of_user_data_members = 0;
  3012. // pMsgEx->Msg.u.query_confirm.user_data_list = NULL;
  3013. }
  3014. if (rc == GCC_NO_ERROR)
  3015. {
  3016. pMsgEx->Msg.u.query_confirm.node_type = node_type;
  3017. pMsgEx->Msg.u.query_confirm.result = result;
  3018. pMsgEx->Msg.u.query_confirm.connection_handle = connection_handle;
  3019. // Queue up the message for delivery to the Node Controller.
  3020. PostConfirmCtrlSapMsg(pMsgEx);
  3021. }
  3022. }
  3023. else
  3024. {
  3025. rc = GCC_ALLOCATION_FAILURE;
  3026. ERROR_OUT(("CControlSAP::ConfQueryConfirm: can't create GCCCtrlSapMsgEx"));
  3027. }
  3028. if (GCC_NO_ERROR != rc)
  3029. {
  3030. FreeCtrlSapMsgEx(pMsgEx);
  3031. HandleResourceFailure(rc);
  3032. }
  3033. #endif // GCCNC_DIRECT_CONFIRM
  3034. DebugExitINT(CControlSAP::ConfQueryConfirm, rc);
  3035. return rc;
  3036. }
  3037. /*
  3038. * ConfJoinIndication ()
  3039. *
  3040. * Public Function Description
  3041. * This join indication is recevied from the owner object. This join
  3042. * indication is designed to make the join response very flexible at the
  3043. * node controller. The node controller can respond to this indication
  3044. * by either creating a new conference and moving the joiner into it,
  3045. * putting the joiner in the conference requested or putting the joiner
  3046. * into a different conference that already exist.
  3047. */
  3048. // LONCHANC: from GCCController, normal code path.
  3049. GCCError CControlSAP::ConfJoinIndication
  3050. (
  3051. GCCConfID conference_id,
  3052. CPassword *convener_password,
  3053. CPassword *password_challenge,
  3054. LPWSTR pwszCallerID,
  3055. TransportAddress calling_address,
  3056. TransportAddress called_address,
  3057. CUserDataListContainer *user_data_list,
  3058. BOOL intermediate_node,
  3059. ConnectionHandle connection_handle
  3060. )
  3061. {
  3062. PJoinResponseStructure join_info;
  3063. GCCError rc;
  3064. DebugEntry(CControlSAP::ConfJoinIndication);
  3065. // First generate a Join Response Handle and add info to response list
  3066. while (1)
  3067. {
  3068. m_nJoinResponseTag++;
  3069. if (NULL == m_JoinResponseTagList2.Find(m_nJoinResponseTag))
  3070. break;
  3071. }
  3072. DBG_SAVE_FILE_LINE
  3073. join_info = new JoinResponseStructure;
  3074. if (join_info != NULL)
  3075. {
  3076. join_info->connection_handle = connection_handle;
  3077. join_info->conference_id = conference_id;
  3078. join_info->user_id = NULL;
  3079. join_info->command_target_call = FALSE;
  3080. m_JoinResponseTagList2.Append(m_nJoinResponseTag, join_info);
  3081. // Queue up the message for delivery to the Node Controller.
  3082. rc = QueueJoinIndication( m_nJoinResponseTag,
  3083. conference_id,
  3084. convener_password,
  3085. password_challenge,
  3086. pwszCallerID,
  3087. calling_address,
  3088. called_address,
  3089. user_data_list,
  3090. intermediate_node,
  3091. connection_handle);
  3092. }
  3093. else
  3094. {
  3095. rc = GCC_ALLOCATION_FAILURE;
  3096. ERROR_OUT(("CControlSAP::ConfJoinIndication: can't create JoinResponseStructure"));
  3097. }
  3098. DebugExitINT(CControlSAP::ConfJoinIndication, rc);
  3099. return rc;
  3100. }
  3101. /*
  3102. * ConfInviteIndication ()
  3103. *
  3104. * Public Function Description
  3105. * This function is called by the GCC Controller when it need to send a
  3106. * conference invite indication to the node controller. It adds the message
  3107. * to a queue of messages to be sent to the node controller in the next
  3108. * heartbeat.
  3109. */
  3110. GCCError CControlSAP::ConfInviteIndication
  3111. (
  3112. GCCConfID conference_id,
  3113. PGCCConferenceName conference_name,
  3114. LPWSTR pwszCallerID,
  3115. TransportAddress calling_address,
  3116. TransportAddress called_address,
  3117. BOOL fSecure,
  3118. PDomainParameters domain_parameters,
  3119. BOOL clear_password_required,
  3120. BOOL conference_is_locked,
  3121. BOOL conference_is_listed,
  3122. BOOL conference_is_conductible,
  3123. GCCTerminationMethod termination_method,
  3124. PPrivilegeListData conductor_privilege_list,
  3125. PPrivilegeListData conducted_mode_privilege_list,
  3126. PPrivilegeListData non_conducted_privilege_list,
  3127. LPWSTR pwszConfDescriptor,
  3128. CUserDataListContainer *user_data_list,
  3129. ConnectionHandle connection_handle
  3130. )
  3131. {
  3132. GCCError rc;
  3133. DebugEntry(CControlSAP::ConfInviteIndication);
  3134. #ifdef GCCNC_DIRECT_INDICATION
  3135. GCCCtrlSapMsg Msg;
  3136. Msg.message_type = GCC_INVITE_INDICATION;
  3137. //
  3138. // Copy the information that needs to be sent to the node
  3139. // controller into local memory that can be deleted once the
  3140. // information to be sent to the application is flushed. Note that
  3141. // if an error occurs in one call to "CopyDataToGCCMessage" then no
  3142. // action is taken on subsequent calls to that routine.
  3143. //
  3144. // start with success
  3145. rc = GCC_NO_ERROR;
  3146. // Copy the conference name
  3147. ::CSAP_CopyDataToGCCMessage_ConfName(
  3148. conference_name,
  3149. &(Msg.u.invite_indication.conference_name));
  3150. // Copy the Conductor Privilege List
  3151. GCCConfPrivileges _ConductorPrivileges;
  3152. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3153. conductor_privilege_list,
  3154. &(Msg.u.invite_indication.conductor_privilege_list),
  3155. &_ConductorPrivileges);
  3156. // Copy the Conducted-mode Conference Privilege List
  3157. GCCConfPrivileges _ConductedModePrivileges;
  3158. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3159. conducted_mode_privilege_list,
  3160. &(Msg.u.invite_indication.conducted_mode_privilege_list),
  3161. &_ConductedModePrivileges);
  3162. // Copy the Non-Conducted-mode Conference Privilege List
  3163. GCCConfPrivileges _NonConductedPrivileges;
  3164. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3165. non_conducted_privilege_list,
  3166. &(Msg.u.invite_indication.non_conducted_privilege_list),
  3167. &_NonConductedPrivileges);
  3168. // Copy the Conference Descriptor
  3169. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  3170. pwszConfDescriptor,
  3171. &(Msg.u.invite_indication.conference_descriptor));
  3172. // Copy the Caller Identifier
  3173. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  3174. pwszCallerID,
  3175. &(Msg.u.invite_indication.caller_identifier));
  3176. // Copy the Calling Address
  3177. ::CSAP_CopyDataToGCCMessage_Call(
  3178. calling_address,
  3179. &(Msg.u.invite_indication.calling_address));
  3180. // Copy the Called Address
  3181. ::CSAP_CopyDataToGCCMessage_Call(
  3182. called_address,
  3183. &(Msg.u.invite_indication.called_address));
  3184. // Copy the Domain Parameters
  3185. DomainParameters _DomainParams;
  3186. ::CSAP_CopyDataToGCCMessage_DomainParams(
  3187. domain_parameters,
  3188. &(Msg.u.invite_indication.domain_parameters),
  3189. &_DomainParams);
  3190. // Copy the User Data
  3191. LPBYTE pUserDataMemory = NULL;
  3192. if (user_data_list != NULL)
  3193. {
  3194. rc = RetrieveUserDataList(
  3195. user_data_list,
  3196. &(Msg.u.invite_indication.number_of_user_data_members),
  3197. &(Msg.u.invite_indication.user_data_list),
  3198. &pUserDataMemory);
  3199. ASSERT(GCC_NO_ERROR == rc);
  3200. }
  3201. else
  3202. {
  3203. Msg.u.invite_indication.number_of_user_data_members = 0;
  3204. Msg.u.invite_indication.user_data_list = NULL;
  3205. }
  3206. if (GCC_NO_ERROR == rc)
  3207. {
  3208. Msg.u.invite_indication.conference_id = conference_id;
  3209. Msg.u.invite_indication.clear_password_required = clear_password_required;
  3210. Msg.u.invite_indication.conference_is_locked = conference_is_locked;
  3211. Msg.u.invite_indication.conference_is_listed = conference_is_listed;
  3212. Msg.u.invite_indication.conference_is_conductible = conference_is_conductible;
  3213. Msg.u.invite_indication.termination_method = termination_method;
  3214. Msg.u.invite_indication.connection_handle = connection_handle;
  3215. Msg.u.invite_indication.fSecure = fSecure;
  3216. SendCtrlSapMsg(&Msg);
  3217. delete pUserDataMemory;
  3218. }
  3219. #else
  3220. GCCCtrlSapMsgEx *pMsgEx;
  3221. //
  3222. // Allocate control sap message.
  3223. //
  3224. DBG_SAVE_FILE_LINE
  3225. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_INVITE_INDICATION, TRUE)))
  3226. {
  3227. ::ZeroMemory(&(pMsgEx->Msg.u.invite_indication), sizeof(pMsgEx->Msg.u.invite_indication));
  3228. }
  3229. else
  3230. {
  3231. ERROR_OUT(("CControlSAP::ConfInviteIndication: can't create GCCCtrlSapMsgEx"));
  3232. rc = GCC_ALLOCATION_FAILURE;
  3233. goto MyExit;
  3234. }
  3235. /*
  3236. ** Copy the information that needs to be sent to the node
  3237. ** controller into local memory that can be deleted once the
  3238. ** information to be sent to the application is flushed. Note that
  3239. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  3240. ** action is taken on subsequent calls to that routine.
  3241. */
  3242. // start with success
  3243. rc = GCC_NO_ERROR;
  3244. // Copy the conference name
  3245. ::CSAP_CopyDataToGCCMessage_ConfName(
  3246. pMsgEx->pToDelete,
  3247. conference_name,
  3248. &(pMsgEx->Msg.u.invite_indication.conference_name),
  3249. &rc);
  3250. // Copy the Conductor Privilege List
  3251. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3252. conductor_privilege_list,
  3253. &(pMsgEx->Msg.u.invite_indication.conductor_privilege_list),
  3254. &rc);
  3255. pMsgEx->pToDelete->conductor_privilege_list = pMsgEx->Msg.u.invite_indication.conductor_privilege_list;
  3256. // Copy the Conducted-mode Conference Privilege List
  3257. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3258. conducted_mode_privilege_list,
  3259. &(pMsgEx->Msg.u.invite_indication.conducted_mode_privilege_list),
  3260. &rc);
  3261. pMsgEx->pToDelete->conducted_mode_privilege_list = pMsgEx->Msg.u.invite_indication.conducted_mode_privilege_list;
  3262. // Copy the Non-Conducted-mode Conference Privilege List
  3263. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3264. non_conducted_privilege_list,
  3265. &(pMsgEx->Msg.u.invite_indication.non_conducted_privilege_list),
  3266. &rc);
  3267. pMsgEx->pToDelete->non_conducted_privilege_list = pMsgEx->Msg.u.invite_indication.non_conducted_privilege_list;
  3268. // Copy the Conference Descriptor
  3269. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  3270. FALSE, // conference descriptor
  3271. pMsgEx->pToDelete,
  3272. pwszConfDescriptor,
  3273. &(pMsgEx->Msg.u.invite_indication.conference_descriptor),
  3274. &rc);
  3275. // Copy the Caller Identifier
  3276. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  3277. TRUE, // caller id
  3278. pMsgEx->pToDelete,
  3279. pwszCallerID,
  3280. &(pMsgEx->Msg.u.invite_indication.caller_identifier),
  3281. &rc);
  3282. // Copy the Calling Address
  3283. ::CSAP_CopyDataToGCCMessage_Call(
  3284. TRUE, /// calling address
  3285. pMsgEx->pToDelete,
  3286. calling_address,
  3287. &(pMsgEx->Msg.u.invite_indication.calling_address),
  3288. &rc);
  3289. // Copy the Called Address
  3290. ::CSAP_CopyDataToGCCMessage_Call(
  3291. FALSE, // called address
  3292. pMsgEx->pToDelete,
  3293. called_address,
  3294. &(pMsgEx->Msg.u.invite_indication.called_address),
  3295. &rc);
  3296. // Copy the Domain Parameters
  3297. ::CSAP_CopyDataToGCCMessage_DomainParams(
  3298. pMsgEx->pToDelete,
  3299. domain_parameters,
  3300. &(pMsgEx->Msg.u.invite_indication.domain_parameters),
  3301. &rc);
  3302. if (GCC_NO_ERROR != rc)
  3303. {
  3304. ERROR_OUT(("CControlSAP::ConfInviteIndication: can't copy data to gcc message"));
  3305. goto MyExit;
  3306. }
  3307. // Copy the User Data
  3308. if (user_data_list != NULL)
  3309. {
  3310. rc = RetrieveUserDataList(
  3311. user_data_list,
  3312. &(pMsgEx->Msg.u.invite_indication.number_of_user_data_members),
  3313. &(pMsgEx->Msg.u.invite_indication.user_data_list),
  3314. &(pMsgEx->pToDelete->user_data_list_memory));
  3315. if (GCC_NO_ERROR != rc)
  3316. {
  3317. goto MyExit;
  3318. }
  3319. }
  3320. else
  3321. {
  3322. // pMsgEx->Msg.u.invite_indication.number_of_user_data_members = 0;
  3323. // pMsgEx->Msg.u.invite_indication.user_data_list = NULL;
  3324. }
  3325. pMsgEx->Msg.u.invite_indication.conference_id = conference_id;
  3326. pMsgEx->Msg.u.invite_indication.clear_password_required = clear_password_required;
  3327. pMsgEx->Msg.u.invite_indication.conference_is_locked = conference_is_locked;
  3328. pMsgEx->Msg.u.invite_indication.conference_is_listed = conference_is_listed;
  3329. pMsgEx->Msg.u.invite_indication.conference_is_conductible = conference_is_conductible;
  3330. pMsgEx->Msg.u.invite_indication.termination_method = termination_method;
  3331. pMsgEx->Msg.u.invite_indication.connection_handle = connection_handle;
  3332. // Queue up the message for delivery to the Node Controller.
  3333. PostIndCtrlSapMsg(pMsgEx);
  3334. MyExit:
  3335. if (GCC_NO_ERROR != rc)
  3336. {
  3337. FreeCtrlSapMsgEx(pMsgEx);
  3338. HandleResourceFailure(rc);
  3339. }
  3340. #endif // GCCNC_DIRECT_INDICATION
  3341. DebugExitINT(CControlSAP::ConfInviteIndication, rc);
  3342. return rc;
  3343. }
  3344. #ifdef TSTATUS_INDICATION
  3345. /*
  3346. * GCCError TransportStatusIndication()
  3347. *
  3348. * Public Function Description
  3349. * This function is called by the GCC Controller when it need to send a
  3350. * transport status indication to the node controller. It adds the
  3351. * message to a queue of messages to be sent to the node controller in
  3352. * the next heartbeat. This callback message uses Rogue Wave strings to
  3353. * store the message information. These strings are held in a
  3354. * TransportStatusInfo structure which is stored in a DataToBeDeleted
  3355. * structure which is freed up after the callback is issued.
  3356. */
  3357. GCCError CControlSAP::TransportStatusIndication ( PTransportStatus transport_status )
  3358. {
  3359. GCCError rc;
  3360. DebugEntry(CControlSAP::TransportStatusIndication);
  3361. #ifdef GCCNC_DIRECT_INDICATION
  3362. GCCCtrlSapMsg Msg;
  3363. Msg.message_type = GCC_TRANSPORT_STATUS_INDICATION;
  3364. Msg.u.transport_status.device_identifier = transport_status->device_identifier;
  3365. Msg.u.transport_status.remote_address = transport_status->remote_address;
  3366. Msg.u.transport_status.message = transport_status->message;
  3367. Msg.u.transport_status.state = transport_status->state;
  3368. SendCtrlSapMsg(&Msg);
  3369. rc = GCC_NO_ERROR;
  3370. #else
  3371. GCCCtrlSapMsgEx *pMsgEx;
  3372. //
  3373. // Allocate control sap message.
  3374. //
  3375. DBG_SAVE_FILE_LINE
  3376. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TRANSPORT_STATUS_INDICATION, TRUE)))
  3377. {
  3378. // ::ZeroMemory(&(pMsgEx->Msg.u.transport_status), sizeof(pMsgEx->Msg.u.transport_status));
  3379. pMsgEx->Msg.u.transport_status.device_identifier = ::My_strdupA(transport_status->device_identifier);
  3380. pMsgEx->Msg.u.transport_status.remote_address = ::My_strdupA(transport_status->remote_address);
  3381. pMsgEx->Msg.u.transport_status.message = ::My_strdupA(transport_status->message);
  3382. pMsgEx->Msg.u.transport_status.state = transport_status->state;
  3383. PostIndCtrlSapMsg(pMsgEx);
  3384. rc = GCC_NO_ERROR;
  3385. }
  3386. else
  3387. {
  3388. ERROR_OUT(("CControlSAP::TransportStatusIndication: can't create GCCCtrlSapMsgEx"));
  3389. rc = GCC_ALLOCATION_FAILURE;
  3390. HandleResourceFailure();
  3391. }
  3392. #endif // GCCNC_DIRECT_INDICATION
  3393. DebugExitINT(CControlSAP::TransportStatusIndication, rc);
  3394. return rc;
  3395. }
  3396. /*
  3397. * StatusIndication()
  3398. *
  3399. * Public Function Description
  3400. * This function is called by the GCC Controller when it need to send a
  3401. * status indication to the node controller. It adds the message to a
  3402. * queue of messages to be sent to the node controller in the next
  3403. * heartbeat.
  3404. *
  3405. * Caveats
  3406. * Note that we do not handle a resource error here to avoid an
  3407. * endless loop that could occur when this routine is called from the
  3408. * HandleResourceError() routine.
  3409. */
  3410. GCCError CControlSAP::StatusIndication
  3411. (
  3412. GCCStatusMessageType status_message_type,
  3413. UINT parameter
  3414. )
  3415. {
  3416. GCCError rc;
  3417. DebugEntry(CControlSAP::StatusIndication);
  3418. #ifdef GCCNC_DIRECT_INDICATION
  3419. GCCCtrlSapMsg Msg;
  3420. Msg.message_type = GCC_STATUS_INDICATION;
  3421. Msg.u.status_indication.status_message_type = status_message_type;
  3422. Msg.u.status_indication.parameter = parameter;
  3423. SendCtrlSapMsg(&Msg);
  3424. rc = GCC_NO_ERROR;
  3425. #else
  3426. GCCCtrlSapMsgEx *pMsgEx;
  3427. //
  3428. // Allocate control sap message.
  3429. //
  3430. DBG_SAVE_FILE_LINE
  3431. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_STATUS_INDICATION)))
  3432. {
  3433. // ::ZeroMemory(&(pMsgEx->Msg.u.status_indication), sizeof(pMsgEx->Msg.u.status_indication));
  3434. pMsgEx->Msg.u.status_indication.status_message_type = status_message_type;
  3435. pMsgEx->Msg.u.status_indication.parameter = parameter;
  3436. // Queue up the message for delivery to the Node Controller.
  3437. PostIndCtrlSapMsg(pMsgEx);
  3438. rc = GCC_NO_ERROR;
  3439. }
  3440. else
  3441. {
  3442. rc = GCC_ALLOCATION_FAILURE;
  3443. HandleResourceFailure();
  3444. }
  3445. #endif // GCCNC_DIRECT_INDICATION
  3446. DebugExitINT(CControlSAP::StatusIndication, rc);
  3447. return rc;
  3448. }
  3449. #endif // TSTATUS_INDICATION
  3450. /*
  3451. * GCCError ConnectionBrokenIndication ()
  3452. *
  3453. * Public Function Description
  3454. * This function is called by the GCC Controller when it need to send a
  3455. * connection broken indication to the node controller. It adds the
  3456. * message to a queue of messages to be sent to the node controller in
  3457. * the next heartbeat.
  3458. */
  3459. GCCError CControlSAP::ConnectionBrokenIndication ( ConnectionHandle connection_handle )
  3460. {
  3461. GCCError rc;
  3462. DebugEntry(CControlSAP::ConnectionBrokenIndication);
  3463. #ifdef GCCNC_DIRECT_INDICATION
  3464. GCCCtrlSapMsg Msg;
  3465. Msg.message_type = GCC_CONNECTION_BROKEN_INDICATION;
  3466. Msg.u.connection_broken_indication.connection_handle = connection_handle;
  3467. SendCtrlSapMsg(&Msg);
  3468. rc = GCC_NO_ERROR;
  3469. #else
  3470. GCCCtrlSapMsgEx *pMsgEx;
  3471. //
  3472. // Allocate control sap message.
  3473. //
  3474. DBG_SAVE_FILE_LINE
  3475. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONNECTION_BROKEN_INDICATION)))
  3476. {
  3477. // ::ZeroMemory(&(pMsgEx->Msg.u.connection_broken_indication), sizeof(pMsgEx->Msg.u.connection_broken_indication));
  3478. pMsgEx->Msg.u.connection_broken_indication.connection_handle = connection_handle;
  3479. // Queue up the message for delivery to the Node Controller.
  3480. PostIndCtrlSapMsg(pMsgEx);
  3481. rc = GCC_NO_ERROR;
  3482. }
  3483. else
  3484. {
  3485. rc = GCC_ALLOCATION_FAILURE;
  3486. HandleResourceFailure();
  3487. }
  3488. #endif // GCCNC_DIRECT_INDICATION
  3489. DebugExitINT(CControlSAP::ConnectionBrokenIndication, rc);
  3490. return rc;
  3491. }
  3492. /*
  3493. * The following routines are virtual command target calls.
  3494. */
  3495. /*
  3496. * ConfCreateConfirm()
  3497. *
  3498. * Public Function Description
  3499. * This function is called by the CConf when it need to send a
  3500. * conference create confirm to the node controller. It adds the
  3501. * message to a queue of messages to be sent to the node controller in
  3502. * the next heartbeat.
  3503. */
  3504. GCCError CControlSAP::ConfCreateConfirm
  3505. (
  3506. PGCCConferenceName conference_name,
  3507. GCCNumericString conference_modifier,
  3508. GCCConfID conference_id,
  3509. PDomainParameters domain_parameters,
  3510. CUserDataListContainer *user_data_list,
  3511. GCCResult result,
  3512. ConnectionHandle connection_handle
  3513. )
  3514. {
  3515. GCCError rc;
  3516. DebugEntry(CControlSAP::ConfCreateConfirm);
  3517. #ifdef GCCNC_DIRECT_CONFIRM
  3518. GCCCtrlSapMsg Msg;
  3519. Msg.message_type = GCC_CREATE_CONFIRM;
  3520. /*
  3521. ** Copy the information that needs to be sent to the node
  3522. ** controller into local memory that can be deleted once the
  3523. ** information to be sent to the application is flushed. Note that
  3524. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  3525. ** action is taken on subsequent calls to that routine.
  3526. */
  3527. // start with success
  3528. rc = GCC_NO_ERROR;
  3529. // Copy the conference name
  3530. ::CSAP_CopyDataToGCCMessage_ConfName(
  3531. conference_name,
  3532. &(Msg.u.create_confirm.conference_name));
  3533. // Copy the conference name modifier
  3534. ::CSAP_CopyDataToGCCMessage_Modifier(
  3535. conference_modifier,
  3536. &(Msg.u.create_confirm.conference_modifier));
  3537. // Copy the Domain Parameters
  3538. DomainParameters _DomainParams;
  3539. ::CSAP_CopyDataToGCCMessage_DomainParams(
  3540. domain_parameters,
  3541. &(Msg.u.create_confirm.domain_parameters),
  3542. &_DomainParams);
  3543. // Copy the User Data
  3544. LPBYTE pUserDataMemory = NULL;
  3545. if (user_data_list != NULL)
  3546. {
  3547. rc = RetrieveUserDataList(
  3548. user_data_list,
  3549. &(Msg.u.create_confirm.number_of_user_data_members),
  3550. &(Msg.u.create_confirm.user_data_list),
  3551. &pUserDataMemory);
  3552. }
  3553. else
  3554. {
  3555. TRACE_OUT(("CControlSAP:ConfCreateConfirm: User Data List is NOT present"));
  3556. Msg.u.create_confirm.number_of_user_data_members = 0;
  3557. Msg.u.create_confirm.user_data_list = NULL;
  3558. }
  3559. if (GCC_NO_ERROR == rc)
  3560. {
  3561. Msg.nConfID = conference_id;
  3562. Msg.u.create_confirm.conference_id = conference_id;
  3563. Msg.u.create_confirm.result= result;
  3564. Msg.u.create_confirm.connection_handle= connection_handle;
  3565. SendCtrlSapMsg(&Msg);
  3566. // clean up
  3567. delete pUserDataMemory;
  3568. }
  3569. else
  3570. {
  3571. HandleResourceFailure(rc);
  3572. }
  3573. #else
  3574. GCCCtrlSapMsgEx *pMsgEx;
  3575. //
  3576. // Allocate control sap message.
  3577. //
  3578. DBG_SAVE_FILE_LINE
  3579. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CREATE_CONFIRM, TRUE)))
  3580. {
  3581. ::ZeroMemory(&(pMsgEx->Msg.u.create_confirm), sizeof(pMsgEx->Msg.u.create_confirm));
  3582. }
  3583. else
  3584. {
  3585. ERROR_OUT(("CControlSAP::ConfCreateConfirm: can't create GCCCtrlSapMsgEx"));
  3586. rc = GCC_ALLOCATION_FAILURE;
  3587. goto MyExit;
  3588. }
  3589. /*
  3590. ** Copy the information that needs to be sent to the node
  3591. ** controller into local memory that can be deleted once the
  3592. ** information to be sent to the application is flushed. Note that
  3593. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  3594. ** action is taken on subsequent calls to that routine.
  3595. */
  3596. // start with success
  3597. rc = GCC_NO_ERROR;
  3598. // Copy the conference name
  3599. ::CSAP_CopyDataToGCCMessage_ConfName(
  3600. pMsgEx->pToDelete,
  3601. conference_name,
  3602. &(pMsgEx->Msg.u.create_confirm.conference_name),
  3603. &rc);
  3604. // Copy the conference name modifier
  3605. ::CSAP_CopyDataToGCCMessage_Modifier(
  3606. FALSE, // conference modifier
  3607. pMsgEx->pToDelete,
  3608. conference_modifier,
  3609. &(pMsgEx->Msg.u.create_confirm.conference_modifier),
  3610. &rc);
  3611. // Copy the Domain Parameters
  3612. ::CSAP_CopyDataToGCCMessage_DomainParams(
  3613. pMsgEx->pToDelete,
  3614. domain_parameters,
  3615. &(pMsgEx->Msg.u.create_confirm.domain_parameters),
  3616. &rc);
  3617. if (GCC_NO_ERROR != rc)
  3618. {
  3619. ERROR_OUT(("CControlSAP::ConfCreateConfirm: can't copy data to gcc message"));
  3620. goto MyExit;
  3621. }
  3622. // Copy the User Data
  3623. if (user_data_list != NULL)
  3624. {
  3625. rc = RetrieveUserDataList(
  3626. user_data_list,
  3627. &(pMsgEx->Msg.u.create_confirm.number_of_user_data_members),
  3628. &(pMsgEx->Msg.u.create_confirm.user_data_list),
  3629. &(pMsgEx->pToDelete->user_data_list_memory));
  3630. if (GCC_NO_ERROR != rc)
  3631. {
  3632. goto MyExit;
  3633. }
  3634. }
  3635. else
  3636. {
  3637. TRACE_OUT(("CControlSAP:ConfCreateConfirm: User Data List is NOT present"));
  3638. // pMsgEx->Msg.u.create_confirm.number_of_user_data_members = 0;
  3639. // pMsgEx->Msg.u.create_confirm.user_data_list = NULL;
  3640. }
  3641. // Queue up the message for delivery to the Node Controller.
  3642. pMsgEx->Msg.nConfID = conference_id;
  3643. pMsgEx->Msg.u.create_confirm.conference_id = conference_id;
  3644. pMsgEx->Msg.u.create_confirm.result= result;
  3645. pMsgEx->Msg.u.create_confirm.connection_handle= connection_handle;
  3646. PostConfirmCtrlSapMsg(pMsgEx);
  3647. MyExit:
  3648. /*
  3649. ** Clean up after any resource allocation error which may have occurred.
  3650. */
  3651. if (GCC_NO_ERROR != rc)
  3652. {
  3653. FreeCtrlSapMsgEx(pMsgEx);
  3654. HandleResourceFailure(rc);
  3655. }
  3656. #endif // GCCNC_DIRECT_CONFIRM
  3657. DebugExitINT(CControlSAP::ConfCreateConfirm, rc);
  3658. return rc;
  3659. }
  3660. /*
  3661. * ConfDisconnectIndication()
  3662. *
  3663. * Public Function Description
  3664. * This function is called by the CConf when it need to send a
  3665. * conference disconnect indication to the node controller. It adds the
  3666. * message to a queue of messages to be sent to the node controller in
  3667. * the next heartbeat.
  3668. */
  3669. GCCError CControlSAP::ConfDisconnectIndication
  3670. (
  3671. GCCConfID conference_id,
  3672. GCCReason reason,
  3673. UserID disconnected_node_id
  3674. )
  3675. {
  3676. GCCError rc;
  3677. DebugEntry(CControlSAP::ConfDisconnectIndication);
  3678. #ifdef GCCNC_DIRECT_INDICATION
  3679. GCCCtrlSapMsg Msg;
  3680. Msg.message_type = GCC_DISCONNECT_INDICATION;
  3681. Msg.nConfID = conference_id;
  3682. Msg.u.disconnect_indication.conference_id = conference_id;
  3683. Msg.u.disconnect_indication.reason = reason;
  3684. Msg.u.disconnect_indication.disconnected_node_id = disconnected_node_id;
  3685. SendCtrlSapMsg(&Msg);
  3686. rc = GCC_NO_ERROR;
  3687. #else
  3688. GCCCtrlSapMsgEx *pMsgEx;
  3689. //
  3690. // Allocate control sap message.
  3691. //
  3692. DBG_SAVE_FILE_LINE
  3693. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_DISCONNECT_INDICATION)))
  3694. {
  3695. // ::ZeroMemory(&(pMsgEx->Msg.u.disconnect_indication), sizeof(pMsgEx->Msg.u.disconnect_indication));
  3696. pMsgEx->Msg.nConfID = conference_id;
  3697. pMsgEx->Msg.u.disconnect_indication.conference_id = conference_id;
  3698. pMsgEx->Msg.u.disconnect_indication.reason = reason;
  3699. pMsgEx->Msg.u.disconnect_indication.disconnected_node_id = disconnected_node_id;
  3700. // Queue up the message for delivery to the Node Controller.
  3701. PostIndCtrlSapMsg(pMsgEx);
  3702. rc = GCC_NO_ERROR;
  3703. }
  3704. else
  3705. {
  3706. rc = GCC_ALLOCATION_FAILURE;
  3707. HandleResourceFailure();
  3708. }
  3709. #endif // GCCNC_DIRECT_INDICATION
  3710. DebugExitINT(CControlSAP::ConfDisconnectIndication, rc);
  3711. return rc;
  3712. }
  3713. /*
  3714. * ConfDisconnectConfirm ()
  3715. *
  3716. * Public Function Description
  3717. * This function is called by the CConf when it need to send a
  3718. * conference disconnect confirm to the node controller. It adds the
  3719. * message to a queue of messages to be sent to the node controller in
  3720. * the next heartbeat.
  3721. */
  3722. GCCError CControlSAP::ConfDisconnectConfirm
  3723. (
  3724. GCCConfID conference_id,
  3725. GCCResult result
  3726. )
  3727. {
  3728. GCCError rc;
  3729. DebugEntry(CControlSAP::ConfDisconnectConfirm);
  3730. #ifdef GCCNC_DIRECT_CONFIRM
  3731. //
  3732. // WPARAM: result.
  3733. // LPARAM: conf ID
  3734. //
  3735. PostAsynDirectConfirmMsg(GCC_DISCONNECT_CONFIRM, result, conference_id);
  3736. rc = GCC_NO_ERROR;
  3737. #else
  3738. GCCCtrlSapMsgEx *pMsgEx;
  3739. //
  3740. // Allocate control sap message.
  3741. //
  3742. DBG_SAVE_FILE_LINE
  3743. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_DISCONNECT_CONFIRM)))
  3744. {
  3745. // ::ZeroMemory(&(pMsgEx->Msg.u.disconnect_confirm), sizeof(pMsgEx->Msg.u.disconnect_confirm));
  3746. pMsgEx->Msg.nConfID = conference_id;
  3747. pMsgEx->Msg.u.disconnect_confirm.conference_id = conference_id;
  3748. pMsgEx->Msg.u.disconnect_confirm.result = result;
  3749. // Queue up the message for delivery to the Node Controller.
  3750. PostConfirmCtrlSapMsg(pMsgEx);
  3751. rc = GCC_NO_ERROR;
  3752. }
  3753. else
  3754. {
  3755. rc = GCC_ALLOCATION_FAILURE;
  3756. HandleResourceFailure();
  3757. }
  3758. #endif // GCCNC_DIRECT_CONFIRM
  3759. DebugExitINT(CControlSAP::ConfDisconnectConfirm, rc);
  3760. return rc;
  3761. }
  3762. /*
  3763. * GCCError ConfJoinIndication()
  3764. *
  3765. * Public Function Description
  3766. * This function is called by the CConf when it need to send a
  3767. * conference join indication to the node controller. It adds the
  3768. * message to a queue of messages to be sent to the node controller in
  3769. * the next heartbeat.
  3770. *
  3771. * Since this is received by the command target call we know that the
  3772. * response must be routed back to the same conference. We must also
  3773. * pass back the user_id when the response is made.
  3774. */
  3775. // LONCHANC: from Conf2/MCSUser/ProcessJoinRequestPDU.
  3776. // forwarded from an existing child node.
  3777. GCCError CControlSAP::ForwardedConfJoinIndication
  3778. (
  3779. UserID sender_id,
  3780. GCCConfID conference_id,
  3781. CPassword *convener_password,
  3782. CPassword *password_challenge,
  3783. LPWSTR pwszCallerID,
  3784. CUserDataListContainer *user_data_list
  3785. )
  3786. {
  3787. GCCError rc = GCC_NO_ERROR;
  3788. PJoinResponseStructure join_info;
  3789. LPWSTR caller_id_ptr;
  3790. DebugEntry(CControlSAP::ForwardedConfJoinIndication);
  3791. // First generate a Join Response Handle and add info to response list
  3792. while (1)
  3793. {
  3794. m_nJoinResponseTag++;
  3795. if (NULL == m_JoinResponseTagList2.Find(m_nJoinResponseTag))
  3796. break;
  3797. }
  3798. // Create a new "info" structure to hold the join information.
  3799. DBG_SAVE_FILE_LINE
  3800. join_info = new JoinResponseStructure;
  3801. if (join_info != NULL)
  3802. {
  3803. caller_id_ptr = pwszCallerID;
  3804. join_info->connection_handle = NULL;
  3805. join_info->conference_id = conference_id;
  3806. join_info->user_id = sender_id;
  3807. join_info->command_target_call = TRUE;
  3808. m_JoinResponseTagList2.Append(m_nJoinResponseTag, join_info);
  3809. // Queue up the message for delivery to the Node Controller.
  3810. rc = QueueJoinIndication(
  3811. m_nJoinResponseTag,
  3812. conference_id,
  3813. convener_password,
  3814. password_challenge,
  3815. caller_id_ptr,
  3816. NULL, // Transport address not supported here
  3817. NULL, // Transport address not supported here
  3818. user_data_list,
  3819. FALSE, // Not an intermediate node
  3820. 0);
  3821. }
  3822. else
  3823. {
  3824. rc = GCC_ALLOCATION_FAILURE;
  3825. HandleResourceFailure();
  3826. }
  3827. DebugExitINT(CControlSAP::ForwardedConfJoinIndication, rc);
  3828. return rc;
  3829. }
  3830. /*
  3831. * GCCError ConfJoinConfirm()
  3832. *
  3833. * Public Function Description
  3834. * This function is called by the CConf when it need to send a
  3835. * conference join confirm to the node controller. It adds the
  3836. * message to a queue of messages to be sent to the node controller in
  3837. * the next heartbeat.
  3838. */
  3839. GCCError CControlSAP::ConfJoinConfirm
  3840. (
  3841. PGCCConferenceName conference_name,
  3842. GCCNumericString remote_modifier,
  3843. GCCNumericString local_modifier,
  3844. GCCConfID conference_id,
  3845. CPassword *password_challenge,
  3846. PDomainParameters domain_parameters,
  3847. BOOL password_in_the_clear,
  3848. BOOL conference_is_locked,
  3849. BOOL conference_is_listed,
  3850. BOOL conference_is_conductible,
  3851. GCCTerminationMethod termination_method,
  3852. PPrivilegeListData conductor_privilege_list,
  3853. PPrivilegeListData conduct_mode_privilege_list,
  3854. PPrivilegeListData non_conduct_privilege_list,
  3855. LPWSTR pwszConfDescription,
  3856. CUserDataListContainer *user_data_list,
  3857. GCCResult result,
  3858. ConnectionHandle connection_handle,
  3859. PBYTE pbRemoteCred,
  3860. DWORD cbRemoteCred
  3861. )
  3862. {
  3863. GCCError rc;
  3864. DebugEntry(CControlSAP::ConfJoinConfirm);
  3865. #ifdef GCCNC_DIRECT_CONFIRM
  3866. GCCCtrlSapMsg Msg;
  3867. Msg.message_type = GCC_JOIN_CONFIRM;
  3868. /*
  3869. ** Copy the information that needs to be sent to the node
  3870. ** controller into local memory that can be deleted once the
  3871. ** information to be sent to the application is flushed. Note that
  3872. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  3873. ** action is taken on subsequent calls to that routine.
  3874. */
  3875. // start with success
  3876. rc = GCC_NO_ERROR;
  3877. // Copy the conference name
  3878. ::CSAP_CopyDataToGCCMessage_ConfName(
  3879. conference_name,
  3880. &(Msg.u.join_confirm.conference_name));
  3881. // Copy the remote modifier
  3882. ::CSAP_CopyDataToGCCMessage_Modifier(
  3883. remote_modifier,
  3884. &(Msg.u.join_confirm.called_node_modifier));
  3885. // Copy the local conference name modifier
  3886. ::CSAP_CopyDataToGCCMessage_Modifier(
  3887. local_modifier,
  3888. &(Msg.u.join_confirm.calling_node_modifier));
  3889. // Copy the Password challange
  3890. ::CSAP_CopyDataToGCCMessage_Challenge(
  3891. password_challenge,
  3892. &(Msg.u.join_confirm.password_challenge));
  3893. // Copy the Domain Parameters
  3894. DomainParameters _DomainParams;
  3895. ::CSAP_CopyDataToGCCMessage_DomainParams(
  3896. domain_parameters,
  3897. &(Msg.u.join_confirm.domain_parameters),
  3898. &_DomainParams);
  3899. // Copy the Conductor Privilege List
  3900. GCCConfPrivileges _ConductorPrivilegeList;
  3901. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3902. conductor_privilege_list,
  3903. &(Msg.u.join_confirm.conductor_privilege_list),
  3904. &_ConductorPrivilegeList);
  3905. // Copy the Conducted-mode Conference Privilege List
  3906. GCCConfPrivileges _ConductedModePrivilegeList;
  3907. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3908. conduct_mode_privilege_list,
  3909. &(Msg.u.join_confirm.conducted_mode_privilege_list),
  3910. &_ConductedModePrivilegeList);
  3911. // Copy the Non-Conducted-mode Conference Privilege List
  3912. GCCConfPrivileges _NonConductedModePrivilegeList;
  3913. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  3914. non_conduct_privilege_list,
  3915. &(Msg.u.join_confirm.non_conducted_privilege_list),
  3916. &_NonConductedModePrivilegeList);
  3917. // Copy the Conference Descriptor
  3918. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  3919. pwszConfDescription,
  3920. &(Msg.u.join_confirm.conference_descriptor));
  3921. // Copy the User Data
  3922. LPBYTE pUserDataMemory = NULL;
  3923. if (user_data_list != NULL)
  3924. {
  3925. rc = RetrieveUserDataList(
  3926. user_data_list,
  3927. &(Msg.u.join_confirm.number_of_user_data_members),
  3928. &(Msg.u.join_confirm.user_data_list),
  3929. &pUserDataMemory);
  3930. }
  3931. else
  3932. {
  3933. Msg.u.join_confirm.number_of_user_data_members = 0;
  3934. Msg.u.join_confirm.user_data_list = NULL;
  3935. }
  3936. if (GCC_NO_ERROR == rc)
  3937. {
  3938. Msg.nConfID = conference_id;
  3939. Msg.u.join_confirm.conference_id = conference_id;
  3940. Msg.u.join_confirm.clear_password_required = password_in_the_clear;
  3941. Msg.u.join_confirm.conference_is_locked = conference_is_locked;
  3942. Msg.u.join_confirm.conference_is_listed = conference_is_listed;
  3943. Msg.u.join_confirm.conference_is_conductible = conference_is_conductible;
  3944. Msg.u.join_confirm.termination_method = termination_method;
  3945. Msg.u.join_confirm.result = result;
  3946. Msg.u.join_confirm.connection_handle = connection_handle;
  3947. Msg.u.join_confirm.pb_remote_cred = pbRemoteCred;
  3948. Msg.u.join_confirm.cb_remote_cred = cbRemoteCred;
  3949. SendCtrlSapMsg(&Msg);
  3950. // clean up
  3951. delete pUserDataMemory;
  3952. }
  3953. else
  3954. {
  3955. HandleResourceFailure(rc);
  3956. }
  3957. #else
  3958. GCCCtrlSapMsgEx *pMsgEx;
  3959. //
  3960. // Allocate control sap message.
  3961. //
  3962. DBG_SAVE_FILE_LINE
  3963. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_JOIN_CONFIRM, TRUE)))
  3964. {
  3965. ::ZeroMemory(&(pMsgEx->Msg.u.join_confirm), sizeof(pMsgEx->Msg.u.join_confirm));
  3966. }
  3967. else
  3968. {
  3969. ERROR_OUT(("CControlSAP::ConfJoinConfirm: can't create GCCCtrlSapMsgEx"));
  3970. rc = GCC_ALLOCATION_FAILURE;
  3971. goto MyExit;
  3972. }
  3973. /*
  3974. ** Copy the information that needs to be sent to the node
  3975. ** controller into local memory that can be deleted once the
  3976. ** information to be sent to the application is flushed. Note that
  3977. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  3978. ** action is taken on subsequent calls to that routine.
  3979. */
  3980. // start with success
  3981. rc = GCC_NO_ERROR;
  3982. // Copy the conference name
  3983. ::CSAP_CopyDataToGCCMessage_ConfName(
  3984. pMsgEx->pToDelete,
  3985. conference_name,
  3986. &(pMsgEx->Msg.u.join_confirm.conference_name),
  3987. &rc);
  3988. // Copy the remote modifier
  3989. ::CSAP_CopyDataToGCCMessage_Modifier(
  3990. TRUE, // remote modifier
  3991. pMsgEx->pToDelete,
  3992. remote_modifier,
  3993. &(pMsgEx->Msg.u.join_confirm.called_node_modifier),
  3994. &rc);
  3995. // Copy the local conference name modifier
  3996. ::CSAP_CopyDataToGCCMessage_Modifier(
  3997. FALSE, // conference modifier
  3998. pMsgEx->pToDelete,
  3999. local_modifier,
  4000. &(pMsgEx->Msg.u.join_confirm.calling_node_modifier),
  4001. &rc);
  4002. // Copy the Password challange
  4003. ::CSAP_CopyDataToGCCMessage_Challenge(
  4004. pMsgEx->pToDelete,
  4005. password_challenge,
  4006. &(pMsgEx->Msg.u.join_confirm.password_challenge),
  4007. &rc);
  4008. // Copy the Domain Parameters
  4009. ::CSAP_CopyDataToGCCMessage_DomainParams(
  4010. pMsgEx->pToDelete,
  4011. domain_parameters,
  4012. &(pMsgEx->Msg.u.join_confirm.domain_parameters),
  4013. &rc);
  4014. // Copy the Conductor Privilege List
  4015. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  4016. conductor_privilege_list,
  4017. &(pMsgEx->Msg.u.join_confirm.conductor_privilege_list),
  4018. &rc);
  4019. pMsgEx->pToDelete->conductor_privilege_list = pMsgEx->Msg.u.join_confirm.conductor_privilege_list;
  4020. // Copy the Conducted-mode Conference Privilege List
  4021. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  4022. conduct_mode_privilege_list,
  4023. &(pMsgEx->Msg.u.join_confirm.conducted_mode_privilege_list),
  4024. &rc);
  4025. pMsgEx->pToDelete->conducted_mode_privilege_list = pMsgEx->Msg.u.join_confirm.conducted_mode_privilege_list;
  4026. // Copy the Non-Conducted-mode Conference Privilege List
  4027. ::CSAP_CopyDataToGCCMessage_PrivilegeList(
  4028. non_conduct_privilege_list,
  4029. &(pMsgEx->Msg.u.join_confirm.non_conducted_privilege_list),
  4030. &rc);
  4031. pMsgEx->pToDelete->non_conducted_privilege_list = pMsgEx->Msg.u.join_confirm.non_conducted_privilege_list;
  4032. // Copy the Conference Descriptor
  4033. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  4034. FALSE, // conference descriptor
  4035. pMsgEx->pToDelete,
  4036. pwszConfDescription,
  4037. &(pMsgEx->Msg.u.join_confirm.conference_descriptor),
  4038. &rc);
  4039. if (GCC_NO_ERROR != rc)
  4040. {
  4041. goto MyExit;
  4042. }
  4043. // Copy the User Data
  4044. if (user_data_list != NULL)
  4045. {
  4046. rc = RetrieveUserDataList(
  4047. user_data_list,
  4048. &(pMsgEx->Msg.u.join_confirm.number_of_user_data_members),
  4049. &(pMsgEx->Msg.u.join_confirm.user_data_list),
  4050. &(pMsgEx->pToDelete->user_data_list_memory));
  4051. if (GCC_NO_ERROR != rc)
  4052. {
  4053. goto MyExit;
  4054. }
  4055. }
  4056. else
  4057. {
  4058. // pMsgEx->Msg.u.join_confirm.number_of_user_data_members = 0;
  4059. // pMsgEx->Msg.u.join_confirm.user_data_list = NULL;
  4060. }
  4061. // Queue up the message for delivery to the Node Controller.
  4062. pMsgEx->Msg.nConfID = conference_id;
  4063. pMsgEx->Msg.u.join_confirm.conference_id = conference_id;
  4064. pMsgEx->Msg.u.join_confirm.clear_password_required = password_in_the_clear;
  4065. pMsgEx->Msg.u.join_confirm.conference_is_locked = conference_is_locked;
  4066. pMsgEx->Msg.u.join_confirm.conference_is_listed = conference_is_listed;
  4067. pMsgEx->Msg.u.join_confirm.conference_is_conductible = conference_is_conductible;
  4068. pMsgEx->Msg.u.join_confirm.termination_method = termination_method;
  4069. pMsgEx->Msg.u.join_confirm.result = result;
  4070. pMsgEx->Msg.u.join_confirm.connection_handle = connection_handle;
  4071. PostConfirmCtrlSapMsg(pMsgEx);
  4072. MyExit:
  4073. if (GCC_NO_ERROR != rc)
  4074. {
  4075. FreeCtrlSapMsgEx(pMsgEx);
  4076. HandleResourceFailure(rc);
  4077. }
  4078. #endif // GCCNC_DIRECT_CONFIRM
  4079. DebugExitINT(CControlSAP::ConfJoinConfirm, rc);
  4080. return rc;
  4081. }
  4082. /*
  4083. * GCCError ConfInviteConfirm ()
  4084. *
  4085. * Public Function Description
  4086. * This function is called by the CConf when it need to send a
  4087. * conference invite confirm to the node controller. It adds the
  4088. * message to a queue of messages to be sent to the node controller in
  4089. * the next heartbeat.
  4090. */
  4091. GCCError CControlSAP::ConfInviteConfirm
  4092. (
  4093. GCCConfID conference_id,
  4094. CUserDataListContainer *user_data_list,
  4095. GCCResult result,
  4096. ConnectionHandle connection_handle
  4097. )
  4098. {
  4099. GCCError rc = GCC_NO_ERROR;
  4100. DebugEntry(CControlSAP::ConfInviteConfirm);
  4101. #ifdef GCCNC_DIRECT_CONFIRM
  4102. GCCCtrlSapMsg Msg;
  4103. Msg.message_type = GCC_INVITE_CONFIRM;
  4104. // Copy the User Data
  4105. LPBYTE pUserDataMemory = NULL;
  4106. if (user_data_list != NULL)
  4107. {
  4108. rc = RetrieveUserDataList(
  4109. user_data_list,
  4110. &(Msg.u.invite_confirm.number_of_user_data_members),
  4111. &(Msg.u.invite_confirm.user_data_list),
  4112. &pUserDataMemory);
  4113. }
  4114. else
  4115. {
  4116. Msg.u.invite_confirm.number_of_user_data_members = 0;
  4117. Msg.u.invite_confirm.user_data_list = NULL;
  4118. }
  4119. if (GCC_NO_ERROR == rc)
  4120. {
  4121. Msg.nConfID = conference_id;
  4122. Msg.u.invite_confirm.conference_id = conference_id;
  4123. Msg.u.invite_confirm.result = result;
  4124. Msg.u.invite_confirm.connection_handle = connection_handle;
  4125. SendCtrlSapMsg(&Msg);
  4126. // clean up
  4127. delete pUserDataMemory;
  4128. }
  4129. else
  4130. {
  4131. HandleResourceFailure(rc);
  4132. }
  4133. #else
  4134. GCCCtrlSapMsgEx *pMsgEx;
  4135. //
  4136. // Allocate control sap message.
  4137. //
  4138. DBG_SAVE_FILE_LINE
  4139. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_INVITE_CONFIRM, TRUE)))
  4140. {
  4141. ::ZeroMemory(&(pMsgEx->Msg.u.invite_confirm), sizeof(pMsgEx->Msg.u.invite_confirm));
  4142. }
  4143. else
  4144. {
  4145. ERROR_OUT(("CControlSAP::ConfInviteConfirm: can't create GCCCtrlSapMsgEx"));
  4146. rc = GCC_ALLOCATION_FAILURE;
  4147. goto MyExit;
  4148. }
  4149. // Copy the User Data
  4150. if (user_data_list != NULL)
  4151. {
  4152. rc = RetrieveUserDataList(
  4153. user_data_list,
  4154. &(pMsgEx->Msg.u.invite_confirm.number_of_user_data_members),
  4155. &(pMsgEx->Msg.u.invite_confirm.user_data_list),
  4156. &(pMsgEx->pToDelete->user_data_list_memory));
  4157. if (GCC_NO_ERROR != rc)
  4158. {
  4159. goto MyExit;
  4160. }
  4161. }
  4162. else
  4163. {
  4164. // pMsgEx->Msg.u.invite_confirm.number_of_user_data_members = 0;
  4165. // pMsgEx->Msg.u.invite_confirm.user_data_list = NULL;
  4166. }
  4167. pMsgEx->Msg.nConfID = conference_id;
  4168. pMsgEx->Msg.u.invite_confirm.conference_id = conference_id;
  4169. pMsgEx->Msg.u.invite_confirm.result = result;
  4170. pMsgEx->Msg.u.invite_confirm.connection_handle = connection_handle;
  4171. // Queue up the message for delivery to the Node Controller.
  4172. PostConfirmCtrlSapMsg(pMsgEx);
  4173. MyExit:
  4174. if (GCC_NO_ERROR != rc)
  4175. {
  4176. FreeCtrlSapMsgEx(pMsgEx);
  4177. HandleResourceFailure(rc);
  4178. }
  4179. #endif // GCCNC_DIRECT_CONFIRM
  4180. DebugExitINT(CControlSAP::ConfInviteConfirm, rc);
  4181. return rc;
  4182. }
  4183. /*
  4184. * GCCError ConfTerminateIndication ()
  4185. *
  4186. * Public Function Description
  4187. * This function is called by the GCC Controller when it need to send a
  4188. * conference terminate indication to the node controller. It adds the
  4189. * message to a queue of messages to be sent to the node controller in
  4190. * the next heartbeat.
  4191. */
  4192. GCCError CControlSAP::
  4193. ConfTerminateIndication
  4194. (
  4195. GCCConfID conference_id,
  4196. UserID requesting_node_id,
  4197. GCCReason reason
  4198. )
  4199. {
  4200. GCCError rc;
  4201. DebugEntry(CControlSAP::ConfTerminateIndication);
  4202. #ifdef GCCNC_DIRECT_INDICATION
  4203. GCCCtrlSapMsg Msg;
  4204. Msg.message_type = GCC_TERMINATE_INDICATION;
  4205. Msg.nConfID = conference_id;
  4206. Msg.u.terminate_indication.conference_id = conference_id;
  4207. Msg.u.terminate_indication.requesting_node_id = requesting_node_id;
  4208. Msg.u.terminate_indication.reason = reason;
  4209. SendCtrlSapMsg(&Msg);
  4210. rc = GCC_NO_ERROR;
  4211. #else
  4212. GCCCtrlSapMsgEx *pMsgEx;
  4213. //
  4214. // Allocate control sap message.
  4215. //
  4216. DBG_SAVE_FILE_LINE
  4217. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TERMINATE_INDICATION)))
  4218. {
  4219. // ::ZeroMemory(&(pMsgEx->Msg.u.terminate_indication), sizeof(pMsgEx->Msg.u.terminate_indication));
  4220. pMsgEx->Msg.nConfID = conference_id;
  4221. pMsgEx->Msg.u.terminate_indication.conference_id = conference_id;
  4222. pMsgEx->Msg.u.terminate_indication.requesting_node_id = requesting_node_id;
  4223. pMsgEx->Msg.u.terminate_indication.reason = reason;
  4224. // Queue up the message for delivery to the Node Controller.
  4225. PostIndCtrlSapMsg(pMsgEx);
  4226. rc = GCC_NO_ERROR;
  4227. }
  4228. else
  4229. {
  4230. rc = GCC_ALLOCATION_FAILURE;
  4231. HandleResourceFailure();
  4232. }
  4233. #endif // GCCNC_DIRECT_INDICATION
  4234. DebugExitINT(CControlSAP::ConfTerminateIndication, rc);
  4235. return rc;
  4236. }
  4237. /*
  4238. * ConfLockReport()
  4239. *
  4240. * Public Function Descrpition
  4241. * This function is called by the CConf when it need to send a
  4242. * conference lock report to the node controller. It adds the
  4243. * message to a queue of messages to be sent to the node controller in
  4244. * the next heartbeat.
  4245. */
  4246. #ifdef JASPER
  4247. GCCError CControlSAP::ConfLockReport
  4248. (
  4249. GCCConfID conference_id,
  4250. BOOL conference_is_locked
  4251. )
  4252. {
  4253. GCCError rc;
  4254. GCCCtrlSapMsgEx *pMsgEx;
  4255. DebugEntry(CControlSAP::ConfLockReport);
  4256. //
  4257. // Allocate control sap message.
  4258. //
  4259. DBG_SAVE_FILE_LINE
  4260. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_LOCK_REPORT_INDICATION)))
  4261. {
  4262. // ::ZeroMemory(&(pMsgEx->Msg.u.lock_report_indication), sizeof(pMsgEx->Msg.u.lock_report_indication));
  4263. pMsgEx->Msg.u.lock_report_indication.conference_id = conference_id;
  4264. pMsgEx->Msg.u.lock_report_indication.conference_is_locked = conference_is_locked;
  4265. // Queue up the message for delivery to the Node Controller.
  4266. PostIndCtrlSapMsg(pMsgEx);
  4267. rc = GCC_NO_ERROR;
  4268. }
  4269. else
  4270. {
  4271. rc = GCC_ALLOCATION_FAILURE;
  4272. HandleResourceFailure();
  4273. }
  4274. DebugExitINT(CControlSAP::ConfLockReport, rc);
  4275. return rc;
  4276. }
  4277. #endif // JASPER
  4278. /*
  4279. * ConfLockIndication()
  4280. *
  4281. * Public Function Descrpition:
  4282. * This function is called by the CConf when it need to send a
  4283. * conference lock indication to the node controller. It adds the
  4284. * message to a queue of messages to be sent to the node controller in
  4285. * the next heartbeat.
  4286. */
  4287. GCCError CControlSAP::ConfLockIndication
  4288. (
  4289. GCCConfID conference_id,
  4290. UserID source_node_id
  4291. )
  4292. {
  4293. GCCError rc;
  4294. DebugEntry(CControlSAP::ConfLockIndication);
  4295. #ifdef GCCNC_DIRECT_INDICATION
  4296. GCCCtrlSapMsg Msg;
  4297. Msg.message_type = GCC_LOCK_INDICATION;
  4298. Msg.u.lock_indication.conference_id = conference_id;
  4299. Msg.u.lock_indication.requesting_node_id = source_node_id;
  4300. SendCtrlSapMsg(&Msg);
  4301. rc = GCC_NO_ERROR;
  4302. #else
  4303. GCCCtrlSapMsgEx *pMsgEx;
  4304. //
  4305. // Allocate control sap message.
  4306. //
  4307. DBG_SAVE_FILE_LINE
  4308. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_LOCK_INDICATION)))
  4309. {
  4310. // ::ZeroMemory(&(pMsgEx->Msg.u.lock_indication), sizeof(pMsgEx->Msg.u.lock_indication));
  4311. pMsgEx->Msg.u.lock_indication.conference_id = conference_id;
  4312. pMsgEx->Msg.u.lock_indication.requesting_node_id = source_node_id;
  4313. // Queue up the message for delivery to the Node Controller.
  4314. PostIndCtrlSapMsg(pMsgEx);
  4315. rc = GCC_NO_ERROR;
  4316. }
  4317. else
  4318. {
  4319. rc = GCC_ALLOCATION_FAILURE;
  4320. HandleResourceFailure();
  4321. }
  4322. #endif // GCCNC_DIRECT_INDICATION
  4323. DebugExitINT(CControlSAP::ConfLockIndication, rc);
  4324. return rc;
  4325. }
  4326. /*
  4327. * ConfLockConfirm()
  4328. *
  4329. * Public Function Descrpition
  4330. * This function is called by the CConf when it need to send a
  4331. * conference lock confirm to the node controller. It adds the
  4332. * message to a queue of messages to be sent to the node controller in
  4333. * the next heartbeat.
  4334. */
  4335. #ifdef JASPER
  4336. GCCError CControlSAP::ConfLockConfirm
  4337. (
  4338. GCCResult result,
  4339. GCCConfID conference_id
  4340. )
  4341. {
  4342. GCCError rc;
  4343. DebugEntry(CControlSAP::ConfLockConfirm);
  4344. #ifdef GCCNC_DIRECT_CONFIRM
  4345. //
  4346. // WPARAM: result.
  4347. // LPARAM: conf ID
  4348. //
  4349. PostAsynDirectConfirmMsg(GCC_LOCK_CONFIRM, result, conference_id);
  4350. rc = GCC_NO_ERROR;
  4351. #else
  4352. GCCCtrlSapMsgEx *pMsgEx;
  4353. //
  4354. // Allocate control sap message.
  4355. //
  4356. DBG_SAVE_FILE_LINE
  4357. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_LOCK_CONFIRM)))
  4358. {
  4359. // ::ZeroMemory(&(pMsgEx->Msg.u.lock_confirm), sizeof(pMsgEx->Msg.u.lock_confirm));
  4360. pMsgEx->Msg.u.lock_confirm.conference_id = conference_id;
  4361. pMsgEx->Msg.u.lock_confirm.result = result;
  4362. // Queue up the message for delivery to the Node Controller.
  4363. PostConfirmCtrlSapMsg(pMsgEx);
  4364. rc = GCC_NO_ERROR;
  4365. }
  4366. else
  4367. {
  4368. rc = GCC_ALLOCATION_FAILURE;
  4369. HandleResourceFailure();
  4370. }
  4371. #endif // GCCNC_DIRECT_CONFIRM
  4372. DebugExitINT(CControlSAP::ConfLockConfirm, rc);
  4373. return rc;
  4374. }
  4375. #endif // JASPER
  4376. /*
  4377. * ConfUnlockIndication()
  4378. *
  4379. * Public Function Description
  4380. * This function is called by the CConf when it need to send a
  4381. * conference unlock indication to the node controller. It adds the
  4382. * message to a queue of messages to be sent to the node controller in
  4383. * the next heartbeat.
  4384. */
  4385. #ifdef JASPER
  4386. GCCError CControlSAP::ConfUnlockIndication
  4387. (
  4388. GCCConfID conference_id,
  4389. UserID source_node_id
  4390. )
  4391. {
  4392. GCCError rc;
  4393. DebugEntry(CControlSAP::ConfUnlockIndication);
  4394. #ifdef GCCNC_DIRECT_INDICATION
  4395. GCCCtrlSapMsg Msg;
  4396. Msg.message_type = GCC_UNLOCK_INDICATION;
  4397. Msg.u.unlock_indication.conference_id = conference_id;
  4398. Msg.u.unlock_indication.requesting_node_id = source_node_id;
  4399. SendCtrlSapMsg(&Msg);
  4400. rc = GCC_NO_ERROR;
  4401. #else
  4402. GCCCtrlSapMsgEx *pMsgEx;
  4403. //
  4404. // Allocate control sap message.
  4405. //
  4406. DBG_SAVE_FILE_LINE
  4407. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_UNLOCK_INDICATION)))
  4408. {
  4409. // ::ZeroMemory(&(pMsgEx->Msg.u.unlock_indication), sizeof(pMsgEx->Msg.u.unlock_indication));
  4410. pMsgEx->Msg.u.unlock_indication.conference_id = conference_id;
  4411. pMsgEx->Msg.u.unlock_indication.requesting_node_id = source_node_id;
  4412. // Queue up the message for delivery to the Node Controller.
  4413. PostIndCtrlSapMsg(pMsgEx);
  4414. rc = GCC_NO_ERROR;
  4415. }
  4416. else
  4417. {
  4418. rc = GCC_ALLOCATION_FAILURE;
  4419. HandleResourceFailure();
  4420. }
  4421. #endif // GCCNC_DIRECT_INDICATION
  4422. DebugExitINT(CControlSAP::ConfUnlockIndication, rc);
  4423. return rc;
  4424. }
  4425. #endif // JASPER
  4426. /*
  4427. * ConfUnlockConfirm()
  4428. *
  4429. * Public Function Descrpition
  4430. * This function is called by the CConf when it need to send a
  4431. * conference unlock confirm to the node controller. It adds the
  4432. * message to a queue of messages to be sent to the node controller in
  4433. * the next heartbeat.
  4434. */
  4435. #ifdef JASPER
  4436. GCCError CControlSAP::ConfUnlockConfirm
  4437. (
  4438. GCCResult result,
  4439. GCCConfID conference_id
  4440. )
  4441. {
  4442. GCCError rc;
  4443. DebugEntry(CControlSAP::ConfUnlockConfirm);
  4444. #ifdef GCCNC_DIRECT_CONFIRM
  4445. //
  4446. // WPARAM: result.
  4447. // LPARAM: conf ID
  4448. //
  4449. PostAsynDirectConfirmMsg(GCC_UNLOCK_CONFIRM, result, conference_id);
  4450. rc = GCC_NO_ERROR;
  4451. #else
  4452. GCCCtrlSapMsgEx *pMsgEx;
  4453. //
  4454. // Allocate control sap message.
  4455. //
  4456. DBG_SAVE_FILE_LINE
  4457. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_UNLOCK_CONFIRM)))
  4458. {
  4459. // ::ZeroMemory(&(pMsgEx->Msg.u.unlock_confirm), sizeof(pMsgEx->Msg.u.unlock_confirm));
  4460. pMsgEx->Msg.u.unlock_confirm.conference_id = conference_id;
  4461. pMsgEx->Msg.u.unlock_confirm.result = result;
  4462. // Queue up the message for delivery to the Node Controller.
  4463. PostConfirmCtrlSapMsg(pMsgEx);
  4464. rc = GCC_NO_ERROR;
  4465. }
  4466. else
  4467. {
  4468. rc = GCC_ALLOCATION_FAILURE;
  4469. HandleResourceFailure();
  4470. }
  4471. #endif // GCCNC_DIRECT_CONFIRM
  4472. DebugExitINT(CControlSAP::ConfUnlockConfirm, rc);
  4473. return rc;
  4474. }
  4475. #endif // JASPER
  4476. /*
  4477. * ConfPermissionToAnnounce ()
  4478. *
  4479. * Public Function Description
  4480. * This function is called by the CConf when it need to send a
  4481. * conference permission to announce to the node controller. It adds the
  4482. * message to a queue of messages to be sent to the node controller in
  4483. * the next heartbeat.
  4484. */
  4485. GCCError CControlSAP::ConfPermissionToAnnounce
  4486. (
  4487. GCCConfID conference_id,
  4488. UserID node_id
  4489. )
  4490. {
  4491. GCCError rc;
  4492. GCCCtrlSapMsgEx *pMsgEx;
  4493. DebugEntry(CControlSAP::ConfPermissionToAnnounce);
  4494. //
  4495. // Allocate control sap message.
  4496. //
  4497. DBG_SAVE_FILE_LINE
  4498. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_PERMIT_TO_ANNOUNCE_PRESENCE)))
  4499. {
  4500. // ::ZeroMemory(&(pMsgEx->Msg.u.permit_to_announce_presence), sizeof(pMsgEx->Msg.u.permit_to_announce_presence));
  4501. pMsgEx->Msg.nConfID = conference_id;
  4502. pMsgEx->Msg.u.permit_to_announce_presence.conference_id= conference_id;
  4503. pMsgEx->Msg.u.permit_to_announce_presence.node_id = node_id;
  4504. //
  4505. // LONCHANC: We should treat it as a confirm, even though it is
  4506. // an indication. When this node is a top provider, we may send this
  4507. // message in the middle of doing something. In essence, it behaves
  4508. // like a confirm.
  4509. //
  4510. // Queue up the message for delivery to the Node Controller.
  4511. PostConfirmCtrlSapMsg(pMsgEx);
  4512. rc = GCC_NO_ERROR;
  4513. }
  4514. else
  4515. {
  4516. rc = GCC_ALLOCATION_FAILURE;
  4517. HandleResourceFailure();
  4518. }
  4519. DebugExitINT(CControlSAP::ConfPermissionToAnnounce, rc);
  4520. return rc;
  4521. }
  4522. /*
  4523. * ConfAnnouncePresenceConfirm ()
  4524. *
  4525. * Public Function Description
  4526. * This function is called by the CConf when it need to send a
  4527. * conference announce presence confirm to the node controller. It adds the
  4528. * message to a queue of messages to be sent to the node controller in
  4529. * the next heartbeat.
  4530. */
  4531. GCCError CControlSAP::ConfAnnouncePresenceConfirm
  4532. (
  4533. GCCConfID conference_id,
  4534. GCCResult result
  4535. )
  4536. {
  4537. GCCError rc;
  4538. DebugEntry(CControlSAP::ConfAnnouncePresenceConfirm);
  4539. #ifdef GCCNC_DIRECT_CONFIRM
  4540. //
  4541. // WPARAM: result.
  4542. // LPARAM: conf ID
  4543. //
  4544. PostAsynDirectConfirmMsg(GCC_ANNOUNCE_PRESENCE_CONFIRM, result, conference_id);
  4545. rc = GCC_NO_ERROR;
  4546. #else
  4547. GCCCtrlSapMsgEx *pMsgEx;
  4548. //
  4549. // Allocate control sap message.
  4550. //
  4551. DBG_SAVE_FILE_LINE
  4552. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_ANNOUNCE_PRESENCE_CONFIRM)))
  4553. {
  4554. // ::ZeroMemory(&(pMsgEx->Msg.u.announce_presence_confirm), sizeof(pMsgEx->Msg.u.announce_presence_confirm));
  4555. pMsgEx->Msg.nConfID = conference_id;
  4556. pMsgEx->Msg.u.announce_presence_confirm.conference_id = conference_id;
  4557. pMsgEx->Msg.u.announce_presence_confirm.result = result;
  4558. // Queue up the message for delivery to the Node Controller.
  4559. PostConfirmCtrlSapMsg(pMsgEx);
  4560. rc = GCC_NO_ERROR;
  4561. }
  4562. else
  4563. {
  4564. rc = GCC_ALLOCATION_FAILURE;
  4565. HandleResourceFailure();
  4566. }
  4567. #endif // GCCNC_DIRECT_CONFIRM
  4568. DebugExitINT(CControlSAP::ConfAnnouncePresenceConfirm, rc);
  4569. return rc;
  4570. }
  4571. /*
  4572. * ConfTerminateConfirm ()
  4573. *
  4574. * Public Function Description
  4575. * This function is called by the CConf when it need to send a
  4576. * conference terminate confirm to the node controller. It adds the
  4577. * message to a queue of messages to be sent to the node controller in
  4578. * the next heartbeat.
  4579. */
  4580. GCCError CControlSAP::ConfTerminateConfirm
  4581. (
  4582. GCCConfID conference_id,
  4583. GCCResult result
  4584. )
  4585. {
  4586. GCCError rc;
  4587. DebugEntry(CControlSAP::ConfTerminateConfirm);
  4588. #ifdef GCCNC_DIRECT_CONFIRM
  4589. //
  4590. // WPARAM: result.
  4591. // LPARAM: conf ID
  4592. //
  4593. PostAsynDirectConfirmMsg(GCC_TERMINATE_CONFIRM, result, conference_id);
  4594. rc = GCC_NO_ERROR;
  4595. #else
  4596. GCCCtrlSapMsgEx *pMsgEx;
  4597. //
  4598. // Allocate control sap message.
  4599. //
  4600. DBG_SAVE_FILE_LINE
  4601. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TERMINATE_CONFIRM)))
  4602. {
  4603. // ::ZeroMemory(&(pMsgEx->Msg.u.terminate_confirm), sizeof(pMsgEx->Msg.u.terminate_confirm));
  4604. pMsgEx->Msg.nConfID = conference_id;
  4605. pMsgEx->Msg.u.terminate_confirm.conference_id = conference_id;
  4606. pMsgEx->Msg.u.terminate_confirm.result = result;
  4607. // Queue up the message for delivery to the Node Controller.
  4608. PostConfirmCtrlSapMsg(pMsgEx);
  4609. rc = GCC_NO_ERROR;
  4610. }
  4611. else
  4612. {
  4613. rc = GCC_ALLOCATION_FAILURE;
  4614. HandleResourceFailure();
  4615. }
  4616. #endif // GCCNC_DIRECT_CONFIRM
  4617. DebugExitINT(CControlSAP::ConfTerminateConfirm, rc);
  4618. return rc;
  4619. }
  4620. /*
  4621. * ConfEjectUserIndication ()
  4622. *
  4623. * Public Function Description
  4624. * This function is called by the CConf when it need to send a
  4625. * conference eject user indication to the node controller. It adds the
  4626. * message to a queue of messages to be sent to the node controller in
  4627. * the next heartbeat.
  4628. */
  4629. GCCError CControlSAP::ConfEjectUserIndication
  4630. (
  4631. GCCConfID conference_id,
  4632. GCCReason reason,
  4633. UserID gcc_node_id
  4634. )
  4635. {
  4636. GCCError rc;
  4637. DebugEntry(CControlSAP::ConfEjectUserIndication);
  4638. #ifdef GCCNC_DIRECT_INDICATION
  4639. //
  4640. // WPARAM: reason, ejected node ID.
  4641. // LPARAM: conf ID
  4642. //
  4643. PostAsynDirectConfirmMsg(GCC_EJECT_USER_INDICATION, reason, gcc_node_id, conference_id);
  4644. rc = GCC_NO_ERROR;
  4645. #else
  4646. GCCCtrlSapMsgEx *pMsgEx;
  4647. //
  4648. // Allocate control sap message.
  4649. //
  4650. DBG_SAVE_FILE_LINE
  4651. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_EJECT_USER_INDICATION)))
  4652. {
  4653. // ::ZeroMemory(&(pMsgEx->Msg.u.eject_user_indication), sizeof(pMsgEx->Msg.u.eject_user_indication));
  4654. pMsgEx->Msg.nConfID = conference_id;
  4655. pMsgEx->Msg.u.eject_user_indication.conference_id = conference_id;
  4656. pMsgEx->Msg.u.eject_user_indication.ejected_node_id = gcc_node_id;
  4657. pMsgEx->Msg.u.eject_user_indication.reason = reason;
  4658. // Queue up the message for delivery to the Node Controller.
  4659. PostIndCtrlSapMsg(pMsgEx);
  4660. rc = GCC_NO_ERROR;
  4661. }
  4662. else
  4663. {
  4664. rc = GCC_ALLOCATION_FAILURE;
  4665. HandleResourceFailure();
  4666. }
  4667. #endif // GCCNC_DIRECT_INDICATION
  4668. DebugExitINT(CControlSAP::ConfEjectUserIndication, rc);
  4669. return rc;
  4670. }
  4671. /*
  4672. * ConfEjectUserConfirm ()
  4673. *
  4674. * Public Function Description
  4675. * This function is called by the CConf when it need to send a
  4676. * conference eject user confirm to the node controller. It adds the
  4677. * message to a queue of messages to be sent to the node controller in
  4678. * the next heartbeat.
  4679. */
  4680. #ifdef JASPER
  4681. GCCError CControlSAP::ConfEjectUserConfirm
  4682. (
  4683. GCCConfID conference_id,
  4684. UserID ejected_node_id,
  4685. GCCResult result
  4686. )
  4687. {
  4688. GCCError rc;
  4689. DebugEntry(CControlSAP::ConfEjectUserConfirm);
  4690. #ifdef GCCNC_DIRECT_CONFIRM
  4691. //
  4692. // WPARAM: LOWORD=result. HIWORD=nid.
  4693. // LPARAM: conf ID
  4694. //
  4695. PostAsynDirectConfirmMsg(GCC_EJECT_USER_CONFIRM, result, ejected_node_id, conference_id);
  4696. rc = GCC_NO_ERROR;
  4697. #else
  4698. GCCCtrlSapMsgEx *pMsgEx;
  4699. //
  4700. // Allocate control sap message.
  4701. //
  4702. DBG_SAVE_FILE_LINE
  4703. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_EJECT_USER_CONFIRM)))
  4704. {
  4705. // ::ZeroMemory(&(pMsgEx->Msg.u.eject_user_confirm), sizeof(pMsgEx->Msg.u.eject_user_confirm));
  4706. pMsgEx->Msg.u.eject_user_confirm.conference_id = conference_id;
  4707. pMsgEx->Msg.u.eject_user_confirm.ejected_node_id = ejected_node_id;
  4708. pMsgEx->Msg.u.eject_user_confirm.result = result;
  4709. // Queue up the message for delivery to the Node Controller.
  4710. PostConfirmCtrlSapMsg(pMsgEx);
  4711. rc = GCC_NO_ERROR;
  4712. }
  4713. else
  4714. {
  4715. rc = GCC_ALLOCATION_FAILURE;
  4716. HandleResourceFailure();
  4717. }
  4718. #endif // GCCNC_DIRECT_CONFIRM
  4719. DebugExitINT(CControlSAP::ConfEjectUserConfirm, rc);
  4720. return rc;
  4721. }
  4722. #endif // JASPER
  4723. /*
  4724. * ConductorAssignConfirm ()
  4725. *
  4726. * Public Function Description
  4727. * This function is called by the CConf when it need to send a
  4728. * conductor assign confirm to the node controller. It adds the
  4729. * message to a queue of messages to be sent to the node controller in
  4730. * the next heartbeat.
  4731. */
  4732. #ifdef JASPER
  4733. GCCError CControlSAP::ConductorAssignConfirm
  4734. (
  4735. GCCResult result,
  4736. GCCConfID conference_id
  4737. )
  4738. {
  4739. GCCError rc;
  4740. DebugEntry(CControlSAP::ConductorAssignConfirm);
  4741. #ifdef GCCNC_DIRECT_CONFIRM
  4742. //
  4743. // WPARAM: result.
  4744. // LPARAM: conf ID
  4745. //
  4746. PostAsynDirectConfirmMsg(GCC_CONDUCT_ASSIGN_CONFIRM, result, conference_id);
  4747. rc = GCC_NO_ERROR;
  4748. #else
  4749. GCCCtrlSapMsgEx *pMsgEx;
  4750. //
  4751. // Allocate control sap message.
  4752. //
  4753. DBG_SAVE_FILE_LINE
  4754. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_ASSIGN_CONFIRM)))
  4755. {
  4756. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_assign_confirm), sizeof(pMsgEx->Msg.u.conduct_assign_confirm));
  4757. pMsgEx->Msg.u.conduct_assign_confirm.conference_id = conference_id;
  4758. pMsgEx->Msg.u.conduct_assign_confirm.result = result;
  4759. // Queue up the message for delivery to the Node Controller.
  4760. PostConfirmCtrlSapMsg(pMsgEx);
  4761. rc = GCC_NO_ERROR;
  4762. }
  4763. else
  4764. {
  4765. rc = GCC_ALLOCATION_FAILURE;
  4766. HandleResourceFailure();
  4767. }
  4768. #endif // GCCNC_DIRECT_CONFIRM
  4769. DebugExitINT(CControlSAP::ConductorAssignConfirm, rc);
  4770. return rc;
  4771. }
  4772. #endif // JASPER
  4773. /*
  4774. * ConductorReleaseConfirm ()
  4775. *
  4776. * Public Function Description
  4777. * This function is called by the CConf when it need to send a
  4778. * conductor release confirm to the node controller. It adds the
  4779. * message to a queue of messages to be sent to the node controller in
  4780. * the next heartbeat.
  4781. */
  4782. #ifdef JASPER
  4783. GCCError CControlSAP::ConductorReleaseConfirm
  4784. (
  4785. GCCResult result,
  4786. GCCConfID conference_id
  4787. )
  4788. {
  4789. GCCError rc;
  4790. DebugEntry(CControlSAP::ConductorReleaseConfirm);
  4791. #ifdef GCCNC_DIRECT_CONFIRM
  4792. //
  4793. // WPARAM: result.
  4794. // LPARAM: conf ID
  4795. //
  4796. PostAsynDirectConfirmMsg(GCC_CONDUCT_RELEASE_CONFIRM, result, conference_id);
  4797. rc = GCC_NO_ERROR;
  4798. #else
  4799. GCCCtrlSapMsgEx *pMsgEx;
  4800. //
  4801. // Allocate control sap message.
  4802. //
  4803. DBG_SAVE_FILE_LINE
  4804. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_RELEASE_CONFIRM)))
  4805. {
  4806. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_release_confirm), sizeof(pMsgEx->Msg.u.conduct_release_confirm));
  4807. pMsgEx->Msg.u.conduct_release_confirm.conference_id = conference_id;
  4808. pMsgEx->Msg.u.conduct_release_confirm.result = result;
  4809. // Queue up the message for delivery to the Node Controller.
  4810. PostConfirmCtrlSapMsg(pMsgEx);
  4811. rc = GCC_NO_ERROR;
  4812. }
  4813. else
  4814. {
  4815. rc = GCC_ALLOCATION_FAILURE;
  4816. HandleResourceFailure();
  4817. }
  4818. #endif // GCCNC_DIRECT_CONFIRM
  4819. DebugExitINT(CControlSAP::ConductorReleaseConfirm, rc);
  4820. return rc;
  4821. }
  4822. #endif // JASPER
  4823. /*
  4824. * ConductorPleaseIndication ()
  4825. *
  4826. * Public Function Description
  4827. * This function is called by the CConf when it need to send a
  4828. * conductor please indication to the node controller. It adds the
  4829. * message to a queue of messages to be sent to the node controller in
  4830. * the next heartbeat.
  4831. */
  4832. #ifdef JASPER
  4833. GCCError CControlSAP::ConductorPleaseIndication
  4834. (
  4835. GCCConfID conference_id,
  4836. UserID requester_node_id
  4837. )
  4838. {
  4839. GCCError rc;
  4840. DebugEntry(CControlSAP::ConductorPleaseIndication);
  4841. #ifdef GCCNC_DIRECT_INDICATION
  4842. GCCCtrlSapMsg Msg;
  4843. Msg.message_type = GCC_CONDUCT_PLEASE_INDICATION;
  4844. Msg.u.conduct_please_indication.conference_id = conference_id;
  4845. Msg.u.conduct_please_indication.requester_node_id = requester_node_id;
  4846. SendCtrlSapMsg(&Msg);
  4847. rc = GCC_NO_ERROR;
  4848. #else
  4849. GCCCtrlSapMsgEx *pMsgEx;
  4850. //
  4851. // Allocate control sap message.
  4852. //
  4853. DBG_SAVE_FILE_LINE
  4854. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_PLEASE_INDICATION)))
  4855. {
  4856. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_please_indication), sizeof(pMsgEx->Msg.u.conduct_please_indication));
  4857. pMsgEx->Msg.u.conduct_please_indication.conference_id = conference_id;
  4858. pMsgEx->Msg.u.conduct_please_indication.requester_node_id = requester_node_id;
  4859. // Queue up the message for delivery to the Node Controller.
  4860. PostCtrlSapMsg(pMsgEx);
  4861. rc = GCC_NO_ERROR;
  4862. }
  4863. else
  4864. {
  4865. rc = GCC_ALLOCATION_FAILURE;
  4866. HandleResourceFailure();
  4867. }
  4868. #endif // GCCNC_DIRECT_INDICATION
  4869. DebugExitINT(CControlSAP::ConductorPleaseIndication, rc);
  4870. return rc;
  4871. }
  4872. #endif // JASPER
  4873. /*
  4874. * ConductorPleaseConfirm ()
  4875. *
  4876. * Public Function Description
  4877. * This function is called by the CConf when it need to send a
  4878. * conductor please confirm to the node controller. It adds the
  4879. * message to a queue of messages to be sent to the node controller in
  4880. * the next heartbeat.
  4881. */
  4882. #ifdef JASPER
  4883. GCCError CControlSAP::ConductorPleaseConfirm
  4884. (
  4885. GCCResult result,
  4886. GCCConfID conference_id
  4887. )
  4888. {
  4889. GCCError rc;
  4890. DebugEntry(CControlSAP::ConductorPleaseConfirm);
  4891. #ifdef GCCNC_DIRECT_CONFIRM
  4892. //
  4893. // WPARAM: result.
  4894. // LPARAM: conf ID
  4895. //
  4896. PostAsynDirectConfirmMsg(GCC_CONDUCT_PLEASE_CONFIRM, result, conference_id);
  4897. rc = GCC_NO_ERROR;
  4898. #else
  4899. GCCCtrlSapMsgEx *pMsgEx;
  4900. //
  4901. // Allocate control sap message.
  4902. //
  4903. DBG_SAVE_FILE_LINE
  4904. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_PLEASE_CONFIRM)))
  4905. {
  4906. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_please_confirm), sizeof(pMsgEx->Msg.u.conduct_please_confirm));
  4907. pMsgEx->Msg.u.conduct_please_confirm.conference_id = conference_id;
  4908. pMsgEx->Msg.u.conduct_please_confirm.result = result;
  4909. // Queue up the message for delivery to the Node Controller.
  4910. PostConfirmCtrlSapMsg(pMsgEx);
  4911. rc = GCC_NO_ERROR;
  4912. }
  4913. else
  4914. {
  4915. rc = GCC_ALLOCATION_FAILURE;
  4916. HandleResourceFailure();
  4917. }
  4918. #endif // GCCNC_DIRECT_CONFIRM
  4919. DebugExitINT(CControlSAP::ConductorPleaseConfirm, rc);
  4920. return rc;
  4921. }
  4922. #endif // JASPER
  4923. /*
  4924. * ConductorGiveIndication ()
  4925. *
  4926. * Public Function Description
  4927. * This function is called by the CConf when it need to send a
  4928. * conductor give indication to the node controller. It adds the
  4929. * message to a queue of messages to be sent to the node controller in
  4930. * the next heartbeat.
  4931. */
  4932. GCCError CControlSAP::ConductorGiveIndication ( GCCConfID conference_id )
  4933. {
  4934. GCCError rc;
  4935. DebugEntry(CControlSAP::ConductorGiveIndication);
  4936. #ifdef GCCNC_DIRECT_INDICATION
  4937. GCCCtrlSapMsg Msg;
  4938. Msg.message_type = GCC_CONDUCT_GIVE_INDICATION;
  4939. Msg.u.conduct_give_indication.conference_id = conference_id;
  4940. SendCtrlSapMsg(&Msg);
  4941. rc = GCC_NO_ERROR;
  4942. #else
  4943. GCCCtrlSapMsgEx *pMsgEx;
  4944. //
  4945. // Allocate control sap message.
  4946. //
  4947. DBG_SAVE_FILE_LINE
  4948. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_GIVE_INDICATION)))
  4949. {
  4950. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_give_indication), sizeof(pMsgEx->Msg.u.conduct_give_indication));
  4951. pMsgEx->Msg.u.conduct_give_indication.conference_id = conference_id;
  4952. // Queue up the message for delivery to the Node Controller.
  4953. PostIndCtrlSapMsg(pMsgEx);
  4954. rc = GCC_NO_ERROR;
  4955. }
  4956. else
  4957. {
  4958. rc = GCC_ALLOCATION_FAILURE;
  4959. HandleResourceFailure();
  4960. }
  4961. #endif // GCCNC_DIRECT_INDICATION
  4962. DebugExitINT(CControlSAP::ConductorGiveIndication, rc);
  4963. return rc;
  4964. }
  4965. /*
  4966. * ConductorGiveConfirm ()
  4967. *
  4968. * Public Function Description
  4969. * This function is called by the CConf when it need to send a
  4970. * conductor give confirm to the node controller. It adds the
  4971. * message to a queue of messages to be sent to the node controller in
  4972. * the next heartbeat.
  4973. */
  4974. #ifdef JASPER
  4975. GCCError CControlSAP::ConductorGiveConfirm
  4976. (
  4977. GCCResult result,
  4978. GCCConfID conference_id,
  4979. UserID recipient_node
  4980. )
  4981. {
  4982. GCCError rc;
  4983. DebugEntry(CControlSAP::ConductorGiveConfirm);
  4984. #ifdef GCCNC_DIRECT_CONFIRM
  4985. //
  4986. // WPARAM: LOWORD=result. HIWORD=nid.
  4987. // LPARAM: conf ID
  4988. //
  4989. PostAsynDirectConfirmMsg(GCC_CONDUCT_GIVE_CONFIRM, result, recipient_node, conference_id);
  4990. rc = GCC_NO_ERROR;
  4991. #else
  4992. GCCCtrlSapMsgEx *pMsgEx;
  4993. //
  4994. // Allocate control sap message.
  4995. //
  4996. DBG_SAVE_FILE_LINE
  4997. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_GIVE_CONFIRM)))
  4998. {
  4999. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_give_confirm), sizeof(pMsgEx->Msg.u.conduct_give_confirm));
  5000. pMsgEx->Msg.u.conduct_give_confirm.conference_id = conference_id;
  5001. pMsgEx->Msg.u.conduct_give_confirm.result = result;
  5002. pMsgEx->Msg.u.conduct_give_confirm.recipient_node_id = recipient_node;
  5003. // Queue up the message for delivery to the Node Controller.
  5004. PostConfirmCtrlSapMsg(pMsgEx);
  5005. rc = GCC_NO_ERROR;
  5006. }
  5007. else
  5008. {
  5009. rc = GCC_ALLOCATION_FAILURE;
  5010. HandleResourceFailure();
  5011. }
  5012. #endif // GCCNC_DIRECT_CONFIRM
  5013. DebugExitINT(CControlSAP::ConductorGiveConfirm, rc);
  5014. return rc;
  5015. }
  5016. #endif // JASPER
  5017. /*
  5018. * ConductorPermitAskIndication ()
  5019. *
  5020. * Public Function Description
  5021. * This function is called by the CConf when it need to send a
  5022. * conductor permit ask indication to the node controller. It adds the
  5023. * message to a queue of messages to be sent to the node controller in
  5024. * the next heartbeat.
  5025. */
  5026. #ifdef JASPER
  5027. GCCError CControlSAP::ConductorPermitAskIndication
  5028. (
  5029. GCCConfID conference_id,
  5030. BOOL grant_flag,
  5031. UserID requester_id
  5032. )
  5033. {
  5034. GCCError rc;
  5035. DebugEntry(CControlSAP::ConductorPermitAskIndication);
  5036. #ifdef GCCNC_DIRECT_INDICATION
  5037. GCCCtrlSapMsg Msg;
  5038. Msg.message_type = GCC_CONDUCT_ASK_INDICATION;
  5039. Msg.u.conduct_permit_ask_indication.conference_id = conference_id;
  5040. Msg.u.conduct_permit_ask_indication.permission_is_granted = grant_flag;
  5041. Msg.u.conduct_permit_ask_indication.requester_node_id = requester_id;
  5042. SendCtrlSapMsg(&Msg);
  5043. rc = GCC_NO_ERROR;
  5044. #else
  5045. GCCCtrlSapMsgEx *pMsgEx;
  5046. //
  5047. // Allocate control sap message.
  5048. //
  5049. DBG_SAVE_FILE_LINE
  5050. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_ASK_INDICATION)))
  5051. {
  5052. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_permit_ask_indication), sizeof(pMsgEx->Msg.u.conduct_permit_ask_indication));
  5053. pMsgEx->Msg.u.conduct_permit_ask_indication.conference_id = conference_id;
  5054. pMsgEx->Msg.u.conduct_permit_ask_indication.permission_is_granted = grant_flag;
  5055. pMsgEx->Msg.u.conduct_permit_ask_indication.requester_node_id = requester_id;
  5056. // Queue up the message for delivery to the Node Controller.
  5057. PostIndCtrlSapMsg(pMsgEx);
  5058. rc = GCC_NO_ERROR;
  5059. }
  5060. else
  5061. {
  5062. rc = GCC_ALLOCATION_FAILURE;
  5063. HandleResourceFailure();
  5064. }
  5065. #endif // GCCNC_DIRECT_INDICATION
  5066. DebugExitINT(CControlSAP::ConductorPermitAskIndication, rc);
  5067. return rc;
  5068. }
  5069. #endif // JASPER
  5070. /*
  5071. * ConductorPermitAskConfirm ()
  5072. *
  5073. * Public Function Description
  5074. * This function is called by the CConf when it need to send a
  5075. * conductor permit ask confirm to the node controller. It adds the
  5076. * message to a queue of messages to be sent to the node controller in
  5077. * the next heartbeat.
  5078. */
  5079. #ifdef JASPER
  5080. GCCError CControlSAP::ConductorPermitAskConfirm
  5081. (
  5082. GCCResult result,
  5083. BOOL grant_permission,
  5084. GCCConfID conference_id
  5085. )
  5086. {
  5087. GCCError rc;
  5088. GCCCtrlSapMsgEx *pMsgEx;
  5089. DebugEntry(CControlSAP::ConductorPermitAskConfirm);
  5090. #ifdef GCCNC_DIRECT_CONFIRM
  5091. //
  5092. // WPARAM: LOWORD=result. HIWORD=permission.
  5093. // LPARAM: conf ID
  5094. //
  5095. PostAsynDirectConfirmMsg(GCC_CONDUCT_ASK_CONFIRM, result, grant_permission, conference_id);
  5096. rc = GCC_NO_ERROR;
  5097. #else
  5098. GCCCtrlSapMsgEx *pMsgEx;
  5099. //
  5100. // Allocate control sap message.
  5101. //
  5102. DBG_SAVE_FILE_LINE
  5103. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_ASK_CONFIRM)))
  5104. {
  5105. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_permit_ask_confirm), sizeof(pMsgEx->Msg.u.conduct_permit_ask_confirm));
  5106. pMsgEx->Msg.u.conduct_permit_ask_confirm.conference_id = conference_id;
  5107. pMsgEx->Msg.u.conduct_permit_ask_confirm.result = result;
  5108. pMsgEx->Msg.u.conduct_permit_ask_confirm.permission_is_granted = grant_permission;
  5109. // Queue up the message for delivery to the Node Controller.
  5110. PostConfirmCtrlSapMsg(pMsgEx);
  5111. rc = GCC_NO_ERROR;
  5112. }
  5113. else
  5114. {
  5115. rc = GCC_ALLOCATION_FAILURE;
  5116. HandleResourceFailure();
  5117. }
  5118. #endif // GCCNC_DIRECT_CONFIRM
  5119. DebugExitINT(CControlSAP::ConductorPermitAskConfirm, rc);
  5120. return rc;
  5121. }
  5122. #endif // JASPER
  5123. /*
  5124. * ConductorPermitGrantConfirm ()
  5125. *
  5126. * Public Function Description
  5127. * This function is called by the CConf when it need to send a
  5128. * conductor permit grant confirm to the node controller. It adds the
  5129. * message to a queue of messages to be sent to the node controller in
  5130. * the next heartbeat.
  5131. */
  5132. #ifdef JASPER
  5133. GCCError CControlSAP::ConductorPermitGrantConfirm
  5134. (
  5135. GCCResult result,
  5136. GCCConfID conference_id
  5137. )
  5138. {
  5139. GCCError rc;
  5140. DebugEntry(CControlSAP::ConductorPermitGrantConfirm);
  5141. #ifdef GCCNC_DIRECT_CONFIRM
  5142. //
  5143. // WPARAM: result.
  5144. // LPARAM: conf ID
  5145. //
  5146. PostAsynDirectConfirmMsg(GCC_CONDUCT_GRANT_CONFIRM, result, conference_id);
  5147. rc = GCC_NO_ERROR;
  5148. #else
  5149. GCCCtrlSapMsgEx *pMsgEx;
  5150. //
  5151. // Allocate control sap message.
  5152. //
  5153. DBG_SAVE_FILE_LINE
  5154. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_GRANT_CONFIRM)))
  5155. {
  5156. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_permit_grant_confirm), sizeof(pMsgEx->Msg.u.conduct_permit_grant_confirm));
  5157. pMsgEx->Msg.u.conduct_permit_grant_confirm.conference_id = conference_id;
  5158. pMsgEx->Msg.u.conduct_permit_grant_confirm.result = result;
  5159. // Queue up the message for delivery to the Node Controller.
  5160. PostConfirmCtrlSapMsg(pMsgEx);
  5161. rc = GCC_NO_ERROR;
  5162. }
  5163. else
  5164. {
  5165. rc = GCC_ALLOCATION_FAILURE;
  5166. HandleResourceFailure();
  5167. }
  5168. #endif // GCCNC_DIRECT_CONFIRM
  5169. DebugExitINT(CControlSAP::ConductorPermitGrantConfirm, rc);
  5170. return rc;
  5171. }
  5172. #endif // JASPER
  5173. /*
  5174. * ConfTimeRemainingIndication ()
  5175. *
  5176. * Public Function Description
  5177. * This function is called by the CConf when it need to send a
  5178. * conference time remaining indication to the node controller. It adds the
  5179. * message to a queue of messages to be sent to the node controller in
  5180. * the next heartbeat.
  5181. */
  5182. #ifdef JASPER
  5183. GCCError CControlSAP::ConfTimeRemainingIndication
  5184. (
  5185. GCCConfID conference_id,
  5186. UserID source_node_id,
  5187. UserID node_id,
  5188. UINT time_remaining
  5189. )
  5190. {
  5191. GCCError rc;
  5192. DebugEntry(CControlSAP::ConfTimeRemainingIndication);
  5193. #ifdef GCCNC_DIRECT_INDICATION
  5194. GCCCtrlSapMsg Msg;
  5195. Msg.message_type = GCC_TIME_REMAINING_INDICATION;
  5196. Msg.u.time_remaining_indication.conference_id = conference_id;
  5197. Msg.u.time_remaining_indication.source_node_id= source_node_id;
  5198. Msg.u.time_remaining_indication.node_id = node_id;
  5199. Msg.u.time_remaining_indication.time_remaining= time_remaining;
  5200. SendCtrlSapMsg(&Msg);
  5201. rc = GCC_NO_ERROR;
  5202. #else
  5203. //GCCCtrlSapMsgEx *pMsgEx;
  5204. //
  5205. // Allocate control sap message.
  5206. //
  5207. DBG_SAVE_FILE_LINE
  5208. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TIME_REMAINING_INDICATION)))
  5209. {
  5210. // ::ZeroMemory(&(pMsgEx->Msg.u.time_remaining_indication), sizeof(pMsgEx->Msg.u.time_remaining_indication));
  5211. pMsgEx->Msg.u.time_remaining_indication.conference_id = conference_id;
  5212. pMsgEx->Msg.u.time_remaining_indication.source_node_id= source_node_id;
  5213. pMsgEx->Msg.u.time_remaining_indication.node_id = node_id;
  5214. pMsgEx->Msg.u.time_remaining_indication.time_remaining= time_remaining;
  5215. // Queue up the message for delivery to the Node Controller.
  5216. PostIndCtrlSapMsg(pMsgEx);
  5217. rc = GCC_NO_ERROR;
  5218. }
  5219. else
  5220. {
  5221. rc = GCC_ALLOCATION_FAILURE;
  5222. HandleResourceFailure();
  5223. }
  5224. #endif // GCCNC_DIRECT_INDICATION
  5225. DebugExitINT(CControlSAP::ConfTimeRemainingIndication, rc);
  5226. return rc;
  5227. }
  5228. #endif // JASPER
  5229. /*
  5230. * ConfTimeRemainingConfirm ()
  5231. *
  5232. * Public Function Description
  5233. * This function is called by the CConf when it need to send a
  5234. * conference time remaining confirm to the node controller. It adds the
  5235. * message to a queue of messages to be sent to the node controller in
  5236. * the next heartbeat.
  5237. */
  5238. #ifdef JASPER
  5239. GCCError CControlSAP::ConfTimeRemainingConfirm
  5240. (
  5241. GCCConfID conference_id,
  5242. GCCResult result
  5243. )
  5244. {
  5245. GCCError rc;
  5246. DebugEntry(CControlSAP::ConfTimeRemainingConfirm);
  5247. #ifdef GCCNC_DIRECT_CONFIRM
  5248. //
  5249. // WPARAM: result.
  5250. // LPARAM: conf ID
  5251. //
  5252. PostAsynDirectConfirmMsg(GCC_TIME_REMAINING_CONFIRM, result, conference_id);
  5253. rc = GCC_NO_ERROR;
  5254. #else
  5255. GCCCtrlSapMsgEx *pMsgEx;
  5256. //
  5257. // Allocate control sap message.
  5258. //
  5259. DBG_SAVE_FILE_LINE
  5260. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TIME_REMAINING_CONFIRM)))
  5261. {
  5262. // ::ZeroMemory(&(pMsgEx->Msg.u.time_remaining_confirm), sizeof(pMsgEx->Msg.u.time_remaining_confirm));
  5263. pMsgEx->Msg.u.time_remaining_confirm.conference_id = conference_id;
  5264. pMsgEx->Msg.u.time_remaining_confirm.result= result;
  5265. // Queue up the message for delivery to the Node Controller.
  5266. PostConfirmCtrlSapMsg(pMsgEx);
  5267. rc = GCC_NO_ERROR;
  5268. }
  5269. else
  5270. {
  5271. rc = GCC_ALLOCATION_FAILURE;
  5272. HandleResourceFailure();
  5273. }
  5274. #endif // GCCNC_DIRECT_CONFIRM
  5275. DebugExitINT(CControlSAP::ConfTimeRemainingConfirm, rc);
  5276. return rc;
  5277. }
  5278. #endif // JASPER
  5279. /*
  5280. * ConfTimeInquireIndication()
  5281. *
  5282. * Public Function Description
  5283. * This function is called by the CConf when it need to send a
  5284. * conference time inquire indication to the node controller. It adds the
  5285. * message to a queue of messages to be sent to the node controller in
  5286. * the next heartbeat.
  5287. */
  5288. GCCError CControlSAP::ConfTimeInquireIndication
  5289. (
  5290. GCCConfID conference_id,
  5291. BOOL time_is_conference_wide,
  5292. UserID requesting_node_id
  5293. )
  5294. {
  5295. GCCError rc;
  5296. DebugEntry(CControlSAP::ConfTimeInquireIndication);
  5297. #ifdef GCCNC_DIRECT_INDICATION
  5298. GCCCtrlSapMsg Msg;
  5299. Msg.message_type = GCC_TIME_INQUIRE_INDICATION;
  5300. Msg.u.time_inquire_indication.conference_id = conference_id;
  5301. Msg.u.time_inquire_indication.time_is_conference_wide = time_is_conference_wide;
  5302. Msg.u.time_inquire_indication.requesting_node_id = requesting_node_id;
  5303. SendCtrlSapMsg(&Msg);
  5304. rc = GCC_NO_ERROR;
  5305. #else
  5306. GCCCtrlSapMsgEx *pMsgEx;
  5307. //
  5308. // Allocate control sap message.
  5309. //
  5310. DBG_SAVE_FILE_LINE
  5311. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TIME_INQUIRE_INDICATION)))
  5312. {
  5313. // ::ZeroMemory(&(pMsgEx->Msg.u.time_inquire_indication), sizeof(pMsgEx->Msg.u.time_inquire_indication));
  5314. pMsgEx->Msg.u.time_inquire_indication.conference_id = conference_id;
  5315. pMsgEx->Msg.u.time_inquire_indication.time_is_conference_wide = time_is_conference_wide;
  5316. pMsgEx->Msg.u.time_inquire_indication.requesting_node_id = requesting_node_id;
  5317. // Queue up the message for delivery to the Node Controller.
  5318. PostIndCtrlSapMsg(pMsgEx);
  5319. rc = GCC_NO_ERROR;
  5320. }
  5321. else
  5322. {
  5323. rc = GCC_ALLOCATION_FAILURE;
  5324. HandleResourceFailure();
  5325. }
  5326. #endif // GCCNC_DIRECT_INDICATION
  5327. DebugExitINT(CControlSAP::ConfTimeInquireIndication, rc);
  5328. return rc;
  5329. }
  5330. /*
  5331. * ConfTimeInquireConfirm ()
  5332. *
  5333. * Public Function Description
  5334. * This function is called by the CConf when it need to send a
  5335. * conference time inquire confirm to the node controller. It adds the
  5336. * message to a queue of messages to be sent to the node controller in
  5337. * the next heartbeat.
  5338. */
  5339. #ifdef JASPER
  5340. GCCError CControlSAP::ConfTimeInquireConfirm
  5341. (
  5342. GCCConfID conference_id,
  5343. GCCResult result
  5344. )
  5345. {
  5346. GCCError rc;
  5347. DebugEntry(CControlSAP::ConfTimeInquireConfirm);
  5348. #ifdef GCCNC_DIRECT_CONFIRM
  5349. //
  5350. // WPARAM: result.
  5351. // LPARAM: conf ID
  5352. //
  5353. PostAsynDirectConfirmMsg(GCC_TIME_INQUIRE_CONFIRM, result, conference_id);
  5354. rc = GCC_NO_ERROR;
  5355. #else
  5356. GCCCtrlSapMsgEx *pMsgEx;
  5357. //
  5358. // Allocate control sap message.
  5359. //
  5360. DBG_SAVE_FILE_LINE
  5361. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TIME_INQUIRE_CONFIRM)))
  5362. {
  5363. // ::ZeroMemory(&(pMsgEx->Msg.u.time_inquire_confirm), sizeof(pMsgEx->Msg.u.time_inquire_confirm));
  5364. pMsgEx->Msg.u.time_inquire_confirm.conference_id = conference_id;
  5365. pMsgEx->Msg.u.time_inquire_confirm.result = result;
  5366. // Queue up the message for delivery to the Node Controller.
  5367. PostConfirmCtrlSapMsg(pMsgEx);
  5368. rc = GCC_NO_ERROR;
  5369. }
  5370. else
  5371. {
  5372. rc = GCC_ALLOCATION_FAILURE;
  5373. HandleResourceFailure();
  5374. }
  5375. #endif // GCCNC_DIRECT_CONFIRM
  5376. DebugExitINT(CControlSAP::ConfTimeInquireConfirm, rc);
  5377. return rc;
  5378. }
  5379. #endif // JASPER
  5380. /*
  5381. * ConfExtendIndication ()
  5382. *
  5383. * Public Function Description
  5384. * This function is called by the CConf when it need to send a
  5385. * conference extend indication to the node controller. It adds the
  5386. * message to a queue of messages to be sent to the node controller in
  5387. * the next heartbeat.
  5388. */
  5389. #ifdef JASPER
  5390. GCCError CControlSAP::ConfExtendIndication
  5391. (
  5392. GCCConfID conference_id,
  5393. UINT extension_time,
  5394. BOOL time_is_conference_wide,
  5395. UserID requesting_node_id
  5396. )
  5397. {
  5398. GCCError rc;
  5399. DebugEntry(CControlSAP::ConfExtendIndication);
  5400. #ifdef GCCNC_DIRECT_INDICATION
  5401. GCCCtrlSapMsg Msg;
  5402. Msg.message_type = GCC_CONFERENCE_EXTEND_INDICATION;
  5403. Msg.u.conference_extend_indication.conference_id = conference_id;
  5404. Msg.u.conference_extend_indication.extension_time = extension_time;
  5405. Msg.u.conference_extend_indication.time_is_conference_wide = time_is_conference_wide;
  5406. Msg.u.conference_extend_indication.requesting_node_id = requesting_node_id;
  5407. SendCtrlSapMsg(&Msg);
  5408. rc = GCC_NO_ERROR;
  5409. #else
  5410. GCCCtrlSapMsgEx *pMsgEx;
  5411. //
  5412. // Allocate control sap message.
  5413. //
  5414. DBG_SAVE_FILE_LINE
  5415. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONFERENCE_EXTEND_INDICATION)))
  5416. {
  5417. // ::ZeroMemory(&(pMsgEx->Msg.u.conference_extend_indication), sizeof(pMsgEx->Msg.u.conference_extend_indication));
  5418. pMsgEx->Msg.u.conference_extend_indication.conference_id = conference_id;
  5419. pMsgEx->Msg.u.conference_extend_indication.extension_time = extension_time;
  5420. pMsgEx->Msg.u.conference_extend_indication.time_is_conference_wide = time_is_conference_wide;
  5421. pMsgEx->Msg.u.conference_extend_indication.requesting_node_id = requesting_node_id;
  5422. // Queue up the message for delivery to the Node Controller.
  5423. PostIndCtrlSapMsg(pMsgEx);
  5424. rc = GCC_NO_ERROR;
  5425. }
  5426. else
  5427. {
  5428. rc = GCC_ALLOCATION_FAILURE;
  5429. HandleResourceFailure();
  5430. }
  5431. #endif // GCCNC_DIRECT_INDICATION
  5432. DebugExitINT(CControlSAP::ConfExtendIndication, rc);
  5433. return rc;
  5434. }
  5435. #endif // JASPER
  5436. /*
  5437. * ConfExtendConfirm ()
  5438. *
  5439. * Public Function Description
  5440. * This function is called by the CConf when it need to send a
  5441. * conference extend confirm to the node controller. It adds the
  5442. * message to a queue of messages to be sent to the node controller in
  5443. * the next heartbeat.
  5444. */
  5445. #ifdef JASPER
  5446. GCCError CControlSAP::ConfExtendConfirm
  5447. (
  5448. GCCConfID conference_id,
  5449. UINT extension_time,
  5450. GCCResult result
  5451. )
  5452. {
  5453. GCCError rc;
  5454. GCCCtrlSapMsgEx *pMsgEx;
  5455. DebugEntry(CControlSAP::ConfExtendConfirm);
  5456. //
  5457. // Allocate control sap message.
  5458. //
  5459. DBG_SAVE_FILE_LINE
  5460. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONFERENCE_EXTEND_CONFIRM)))
  5461. {
  5462. // ::ZeroMemory(&(pMsgEx->Msg.u.conference_extend_confirm), sizeof(pMsgEx->Msg.u.conference_extend_confirm));
  5463. pMsgEx->Msg.u.conference_extend_confirm.conference_id = conference_id;
  5464. pMsgEx->Msg.u.conference_extend_confirm.extension_time = extension_time;
  5465. pMsgEx->Msg.u.conference_extend_confirm.result = result;
  5466. // Queue up the message for delivery to the Node Controller.
  5467. PostConfirmCtrlSapMsg(pMsgEx);
  5468. rc = GCC_NO_ERROR;
  5469. }
  5470. else
  5471. {
  5472. rc = GCC_ALLOCATION_FAILURE;
  5473. HandleResourceFailure();
  5474. }
  5475. DebugExitINT(CControlSAP::ConfExtendConfirm, rc);
  5476. return rc;
  5477. }
  5478. #endif // JASPER
  5479. /*
  5480. * ConfAssistanceIndication ()
  5481. *
  5482. * Public Function Description
  5483. * This function is called by the CConf when it need to send a
  5484. * conference assistance indication to the node controller. It adds the
  5485. * message to a queue of messages to be sent to the node controller in
  5486. * the next heartbeat.
  5487. */
  5488. #ifdef JASPER
  5489. GCCError CControlSAP::ConfAssistanceIndication
  5490. (
  5491. GCCConfID conference_id,
  5492. CUserDataListContainer *user_data_list,
  5493. UserID source_node_id
  5494. )
  5495. {
  5496. GCCError rc;
  5497. DebugEntry(CControlSAP::ConfAssistanceIndication);
  5498. #ifdef GCCNC_DIRECT_INDICATION
  5499. GCCCtrlSapMsg Msg;
  5500. Msg.message_type = GCC_ASSISTANCE_INDICATION;
  5501. rc = GCC_NO_ERROR;
  5502. // Copy the User Data if it exists.
  5503. LPBYTE pUserDataMemory = NULL;
  5504. if (user_data_list != NULL)
  5505. {
  5506. rc = RetrieveUserDataList(
  5507. user_data_list,
  5508. &(Msg.u.conference_assist_indication.number_of_user_data_members),
  5509. &(Msg.u.conference_assist_indication.user_data_list),
  5510. &pUserDataMemory);
  5511. ASSERT(GCC_NO_ERROR == rc);
  5512. }
  5513. else
  5514. {
  5515. Msg.u.conference_assist_indication.number_of_user_data_members = 0;
  5516. Msg.u.conference_assist_indication.user_data_list = NULL;
  5517. }
  5518. if (GCC_NO_ERROR == rc)
  5519. {
  5520. Msg.u.conference_assist_indication.conference_id = conference_id;
  5521. Msg.u.conference_assist_indication.source_node_id = source_node_id;
  5522. SendCtrlSapMsg(&Msg);
  5523. delete pUserDataMemory;
  5524. }
  5525. #else
  5526. GCCCtrlSapMsgEx *pMsgEx;
  5527. //
  5528. // Allocate control sap message.
  5529. //
  5530. DBG_SAVE_FILE_LINE
  5531. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_ASSISTANCE_INDICATION)))
  5532. {
  5533. ::ZeroMemory(&(pMsgEx->Msg.u.conference_assist_indication), sizeof(pMsgEx->Msg.u.conference_assist_indication));
  5534. rc = GCC_NO_ERROR;
  5535. // Copy the User Data if it exists.
  5536. if (user_data_list != NULL)
  5537. {
  5538. rc = RetrieveUserDataList(
  5539. user_data_list,
  5540. &(pMsgEx->Msg.u.conference_assist_indication.number_of_user_data_members),
  5541. &(pMsgEx->Msg.u.conference_assist_indication.user_data_list),
  5542. &(pMsgEx->pToDelete->user_data_list_memory));
  5543. ASSERT(GCC_NO_ERROR == rc);
  5544. }
  5545. else
  5546. {
  5547. // pMsgEx->Msg.u.conference_assist_indication.number_of_user_data_members = 0;
  5548. // pMsgEx->Msg.u.conference_assist_indication.user_data_list = NULL;
  5549. }
  5550. if (GCC_NO_ERROR == rc)
  5551. {
  5552. pMsgEx->Msg.u.conference_assist_indication.conference_id = conference_id;
  5553. pMsgEx->Msg.u.conference_assist_indication.source_node_id = source_node_id;
  5554. // Queue up the message for delivery to the Node Controller.
  5555. PostIndCtrlSapMsg(pMsgEx);
  5556. }
  5557. }
  5558. else
  5559. {
  5560. ERROR_OUT(("CControlSAP::ConfAssistanceIndication: can't create CreateCtrlSapMsgEx"));
  5561. rc = GCC_ALLOCATION_FAILURE;
  5562. }
  5563. /*
  5564. ** Clean up after any resource allocation error which may have occurred.
  5565. */
  5566. if (GCC_NO_ERROR != rc)
  5567. {
  5568. FreeCtrlSapMsgEx(pMsgEx);
  5569. HandleResourceFailure(rc);
  5570. }
  5571. #endif // GCCNC_DIRECT_INDICATION
  5572. DebugExitINT(CControlSAP::ConfAssistanceIndication, rc);
  5573. return rc;
  5574. }
  5575. #endif // JASPER
  5576. /*
  5577. * ConfAssistanceConfirm ()
  5578. *
  5579. * Public Function Description
  5580. * This function is called by the CConf when it need to send a
  5581. * conference assistance confirm to the node controller. It adds the
  5582. * message to a queue of messages to be sent to the node controller in
  5583. * the next heartbeat.
  5584. */
  5585. #ifdef JASPER
  5586. GCCError CControlSAP::ConfAssistanceConfirm
  5587. (
  5588. GCCConfID conference_id,
  5589. GCCResult result
  5590. )
  5591. {
  5592. GCCError rc;
  5593. DebugEntry(CControlSAP::ConfAssistanceConfirm);
  5594. #ifdef GCCNC_DIRECT_CONFIRM
  5595. //
  5596. // WPARAM: result.
  5597. // LPARAM: conf ID
  5598. //
  5599. PostAsynDirectConfirmMsg(GCC_ASSISTANCE_CONFIRM, result, conference_id);
  5600. rc = GCC_NO_ERROR;
  5601. #else
  5602. GCCCtrlSapMsgEx *pMsgEx;
  5603. //
  5604. // Allocate control sap message.
  5605. //
  5606. DBG_SAVE_FILE_LINE
  5607. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_ASSISTANCE_CONFIRM)))
  5608. {
  5609. // ::ZeroMemory(&(pMsgEx->Msg.u.conference_assist_confirm), sizeof(pMsgEx->Msg.u.conference_assist_confirm));
  5610. pMsgEx->Msg.u.conference_assist_confirm.conference_id = conference_id;
  5611. pMsgEx->Msg.u.conference_assist_confirm.result = result;
  5612. // Queue up the message for delivery to the Node Controller.
  5613. PostConfirmCtrlSapMsg(pMsgEx);
  5614. rc = GCC_NO_ERROR;
  5615. }
  5616. else
  5617. {
  5618. rc = GCC_ALLOCATION_FAILURE;
  5619. HandleResourceFailure();
  5620. }
  5621. #endif // GCCNC_DIRECT_CONFIRM
  5622. DebugExitINT(CControlSAP::ConfAssistanceConfirm, rc);
  5623. return rc;
  5624. }
  5625. #endif // JASPER
  5626. /*
  5627. * TextMessageIndication ()
  5628. *
  5629. * Public Function Description
  5630. * This function is called by the CConf when it need to send a
  5631. * text message indication to the node controller. It adds the
  5632. * message to a queue of messages to be sent to the node controller in
  5633. * the next heartbeat.
  5634. */
  5635. #ifdef JASPER
  5636. GCCError CControlSAP::TextMessageIndication
  5637. (
  5638. GCCConfID conference_id,
  5639. LPWSTR pwszTextMsg,
  5640. UserID source_node_id
  5641. )
  5642. {
  5643. GCCError rc;
  5644. DebugEntry(CControlSAP::TextMessageIndication);
  5645. #ifdef GCCNC_DIRECT_INDICATION
  5646. GCCCtrlSapMsg Msg;
  5647. Msg.message_type = GCC_TEXT_MESSAGE_INDICATION;
  5648. Msg.u.text_message_indication.text_message = pwszTextMsg;
  5649. Msg.u.text_message_indication.conference_id = conference_id;
  5650. Msg.u.text_message_indication.source_node_id = source_node_id;
  5651. SendCtrlSapMsg(&Msg);
  5652. rc = GCC_NO_ERROR;
  5653. #else
  5654. GCCCtrlSapMsgEx *pMsgEx;
  5655. //
  5656. // Allocate control sap message.
  5657. //
  5658. DBG_SAVE_FILE_LINE
  5659. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TEXT_MESSAGE_INDICATION)))
  5660. {
  5661. // ::ZeroMemory(&(pMsgEx->Msg.u.text_message_indication), sizeof(pMsgEx->Msg.u.text_message_indication));
  5662. if (NULL != (pMsgEx->Msg.u.text_message_indication.text_message = ::My_strdupW(pwszTextMsg)))
  5663. {
  5664. pMsgEx->Msg.u.text_message_indication.conference_id = conference_id;
  5665. pMsgEx->Msg.u.text_message_indication.source_node_id = source_node_id;
  5666. // Queue up the message for delivery to the Node Controller.
  5667. PostIndCtrlSapMsg(pMsgEx);
  5668. rc = GCC_NO_ERROR;
  5669. }
  5670. }
  5671. else
  5672. {
  5673. rc = GCC_ALLOCATION_FAILURE;
  5674. HandleResourceFailure();
  5675. }
  5676. #endif // GCCNC_DIRECT_INDICATION
  5677. DebugExitINT(CControlSAP::TextMessageIndication, rc);
  5678. return rc;
  5679. }
  5680. #endif // JASPER
  5681. /*
  5682. * TextMessageConfirm ()
  5683. *
  5684. * Public Function Description
  5685. * This function is called by the CConf when it need to send a
  5686. * text message confirm to the node controller. It adds the message
  5687. * to a queue of messages to be sent to the node controller in the
  5688. * next heartbeat.
  5689. */
  5690. #ifdef JASPER
  5691. GCCError CControlSAP::TextMessageConfirm
  5692. (
  5693. GCCConfID conference_id,
  5694. GCCResult result
  5695. )
  5696. {
  5697. GCCError rc;
  5698. DebugEntry(CControlSAP::TextMessageConfirm);
  5699. #ifdef GCCNC_DIRECT_CONFIRM
  5700. //
  5701. // WPARAM: result.
  5702. // LPARAM: conf ID
  5703. //
  5704. PostAsynDirectConfirmMsg(GCC_TEXT_MESSAGE_CONFIRM, result, conference_id);
  5705. rc = GCC_NO_ERROR;
  5706. #else
  5707. GCCCtrlSapMsgEx *pMsgEx;
  5708. //
  5709. // Allocate control sap message.
  5710. //
  5711. DBG_SAVE_FILE_LINE
  5712. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TEXT_MESSAGE_CONFIRM)))
  5713. {
  5714. // ::ZeroMemory(&(pMsgEx->Msg.u.text_message_confirm), sizeof(pMsgEx->Msg.u.text_message_confirm));
  5715. pMsgEx->Msg.u.text_message_confirm.conference_id = conference_id;
  5716. pMsgEx->Msg.u.text_message_confirm.result = result;
  5717. // Queue up the message for delivery to the Node Controller.
  5718. PostConfirmCtrlSapMsg(pMsgEx);
  5719. rc = GCC_NO_ERROR;
  5720. }
  5721. else
  5722. {
  5723. rc = GCC_ALLOCATION_FAILURE;
  5724. HandleResourceFailure();
  5725. }
  5726. #endif // GCCNC_DIRECT_CONFIRM
  5727. DebugExitINT(CControlSAP::TextMessageConfirm, rc);
  5728. return rc;
  5729. }
  5730. #endif // JASPER
  5731. /*
  5732. * ConfTransferIndication ()
  5733. *
  5734. * Public Function Description
  5735. * This function is called by the CConf when it need to send a
  5736. * conference transfer indication to the node controller. It adds the
  5737. * message to a queue of messages to be sent to the node controller in
  5738. * the next heartbeat.
  5739. */
  5740. #ifdef JASPER
  5741. GCCError CControlSAP::ConfTransferIndication
  5742. (
  5743. GCCConfID conference_id,
  5744. PGCCConferenceName destination_conference_name,
  5745. GCCNumericString destination_conference_modifier,
  5746. CNetAddrListContainer *destination_address_list,
  5747. CPassword *password
  5748. )
  5749. {
  5750. GCCError rc = GCC_NO_ERROR;
  5751. DebugEntry(CControlSAP::ConfTransferIndication);
  5752. #ifdef GCCNC_DIRECT_INDICATION
  5753. GCCCtrlSapMsg Msg;
  5754. Msg.message_type = GCC_TRANSFER_INDICATION;
  5755. //
  5756. // Copy the information that needs to be sent to the node
  5757. // controller into local memory that can be deleted once the
  5758. // information to be sent to the application is flushed. Note that
  5759. // if an error occurs in one call to "CopyDataToGCCMessage" then no
  5760. // action is taken on subsequent calls to that routine.
  5761. //
  5762. // Copy the conference name
  5763. ::CSAP_CopyDataToGCCMessage_ConfName(
  5764. destination_conference_name,
  5765. &(Msg.u.transfer_indication.destination_conference_name));
  5766. // Copy the conference name modifier
  5767. ::CSAP_CopyDataToGCCMessage_Modifier(
  5768. destination_conference_modifier,
  5769. &(Msg.u.transfer_indication.destination_conference_modifier));
  5770. // Copy the Password
  5771. ::CSAP_CopyDataToGCCMessage_Password(
  5772. password,
  5773. &(Msg.u.transfer_indication.password));
  5774. LPBYTE pDstAddrListData = NULL;
  5775. if (destination_address_list != NULL)
  5776. {
  5777. //
  5778. // First determine the size of the block required to hold all
  5779. // of the network address list data.
  5780. //
  5781. UINT block_size = destination_address_list->LockNetworkAddressList();
  5782. DBG_SAVE_FILE_LINE
  5783. if (NULL != (pDstAddrListData = new BYTE[block_size]))
  5784. {
  5785. destination_address_list->GetNetworkAddressListAPI(
  5786. &(Msg.u.transfer_indication.number_of_destination_addresses),
  5787. &(Msg.u.transfer_indication.destination_address_list),
  5788. pDstAddrListData);
  5789. }
  5790. else
  5791. {
  5792. ERROR_OUT(("CControlSAP::ConfTransferIndication: can't create net addr memory, size=%u", (UINT) block_size));
  5793. rc = GCC_ALLOCATION_FAILURE;
  5794. }
  5795. // Unlock the network address list data.
  5796. destination_address_list->UnLockNetworkAddressList();
  5797. }
  5798. else
  5799. {
  5800. Msg.u.transfer_indication.number_of_destination_addresses = 0;
  5801. Msg.u.transfer_indication.destination_address_list = NULL;
  5802. }
  5803. if (rc == GCC_NO_ERROR)
  5804. {
  5805. Msg.u.transfer_indication.conference_id = conference_id;
  5806. SendCtrlSapMsg(&Msg);
  5807. delete pDstAddrListData;
  5808. }
  5809. #else
  5810. GCCCtrlSapMsgEx *pMsgEx;
  5811. UINT block_size;
  5812. /*
  5813. ** Allocate the GCC callback message and fill it in with the
  5814. ** appropriate values.
  5815. */
  5816. DBG_SAVE_FILE_LINE
  5817. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TRANSFER_INDICATION, TRUE)))
  5818. {
  5819. ::ZeroMemory(&(pMsgEx->Msg.u.transfer_indication), sizeof(pMsgEx->Msg.u.transfer_indication));
  5820. /*
  5821. ** Copy the information that needs to be sent to the node
  5822. ** controller into local memory that can be deleted once the
  5823. ** information to be sent to the application is flushed. Note that
  5824. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  5825. ** action is taken on subsequent calls to that routine.
  5826. */
  5827. // Copy the conference name
  5828. ::CSAP_CopyDataToGCCMessage_ConfName(
  5829. pMsgEx->pToDelete,
  5830. destination_conference_name,
  5831. &(pMsgEx->Msg.u.transfer_indication.destination_conference_name),
  5832. &rc);
  5833. // Copy the conference name modifier
  5834. ::CSAP_CopyDataToGCCMessage_Modifier(
  5835. FALSE, // conference modifier
  5836. pMsgEx->pToDelete,
  5837. destination_conference_modifier,
  5838. &(pMsgEx->Msg.u.transfer_indication.destination_conference_modifier),
  5839. &rc);
  5840. // Copy the Password
  5841. ::CSAP_CopyDataToGCCMessage_Password(
  5842. FALSE, // non-convener password
  5843. pMsgEx->pToDelete,
  5844. password,
  5845. &(pMsgEx->Msg.u.transfer_indication.password),
  5846. &rc);
  5847. if ((rc == GCC_NO_ERROR) &&
  5848. (destination_address_list != NULL))
  5849. {
  5850. /*
  5851. ** First determine the size of the block required to hold all
  5852. ** of the network address list data.
  5853. */
  5854. block_size = destination_address_list->LockNetworkAddressList();
  5855. DBG_SAVE_FILE_LINE
  5856. if (NULL != (pMsgEx->pBuf = new BYTE[block_size]))
  5857. {
  5858. destination_address_list->GetNetworkAddressListAPI(
  5859. &(pMsgEx->Msg.u.transfer_indication.number_of_destination_addresses),
  5860. &(pMsgEx->Msg.u.transfer_indication.destination_address_list),
  5861. pMsgEx->pBuf);
  5862. }
  5863. else
  5864. {
  5865. ERROR_OUT(("CControlSAP::ConfTransferIndication: can't create net addr memory, size=%u", (UINT) block_size));
  5866. rc = GCC_ALLOCATION_FAILURE;
  5867. }
  5868. // Unlock the network address list data.
  5869. destination_address_list->UnLockNetworkAddressList();
  5870. }
  5871. else
  5872. {
  5873. // pMsgEx->Msg.u.transfer_indication.number_of_destination_addresses = 0;
  5874. // pMsgEx->Msg.u.transfer_indication.destination_address_list = NULL;
  5875. }
  5876. if (rc == GCC_NO_ERROR)
  5877. {
  5878. pMsgEx->Msg.u.transfer_indication.conference_id = conference_id;
  5879. // Queue up the message for delivery to the Node Controller.
  5880. PostIndCtrlSapMsg(pMsgEx);
  5881. }
  5882. }
  5883. else
  5884. {
  5885. ERROR_OUT(("CControlSAP::ConfTransferIndication: can't create GCCCtrlSapMsgEx"));
  5886. rc = GCC_ALLOCATION_FAILURE;
  5887. }
  5888. if (GCC_NO_ERROR != rc)
  5889. {
  5890. FreeCtrlSapMsgEx(pMsgEx);
  5891. HandleResourceFailure(rc);
  5892. }
  5893. #endif // GCCNC_DIRECT_INDICATION
  5894. DebugExitINT(CControlSAP::ConfTransferIndication, rc);
  5895. return rc;
  5896. }
  5897. #endif // JASPER
  5898. /*
  5899. * ConfTransferConfirm ()
  5900. *
  5901. * Public Function Description
  5902. * This function is called by the CConf when it need to send a
  5903. * conference transfer confirm to the node controller. It adds the
  5904. * message to a queue of messages to be sent to the node controller in
  5905. * the next heartbeat.
  5906. */
  5907. #ifdef JASPER
  5908. GCCError CControlSAP::ConfTransferConfirm
  5909. (
  5910. GCCConfID conference_id,
  5911. PGCCConferenceName destination_conference_name,
  5912. GCCNumericString destination_conference_modifier,
  5913. UINT number_of_destination_nodes,
  5914. PUserID destination_node_list,
  5915. GCCResult result
  5916. )
  5917. {
  5918. GCCError rc = GCC_NO_ERROR;
  5919. GCCCtrlSapMsgEx *pMsgEx;
  5920. UINT i;
  5921. DebugEntry(CControlSAP::ConfTransferConfirm);
  5922. /*
  5923. ** Allocate the GCC callback message and fill it in with the
  5924. ** appropriate values.
  5925. */
  5926. DBG_SAVE_FILE_LINE
  5927. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_TRANSFER_CONFIRM, TRUE)))
  5928. {
  5929. ::ZeroMemory(&(pMsgEx->Msg.u.transfer_confirm), sizeof(pMsgEx->Msg.u.transfer_confirm));
  5930. /*
  5931. ** Copy the information that needs to be sent to the node
  5932. ** controller into local memory that can be deleted once the
  5933. ** information to be sent to the application is flushed. Note that
  5934. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  5935. ** action is taken on subsequent calls to that routine.
  5936. */
  5937. // Copy the conference name
  5938. ::CSAP_CopyDataToGCCMessage_ConfName(
  5939. pMsgEx->pToDelete,
  5940. destination_conference_name,
  5941. &(pMsgEx->Msg.u.transfer_confirm.destination_conference_name),
  5942. &rc);
  5943. // Copy the conference name modifier
  5944. ::CSAP_CopyDataToGCCMessage_Modifier(
  5945. FALSE, // conference modifier
  5946. pMsgEx->pToDelete,
  5947. destination_conference_modifier,
  5948. &(pMsgEx->Msg.u.transfer_confirm.destination_conference_modifier),
  5949. &rc);
  5950. if ((rc == GCC_NO_ERROR) &&
  5951. (number_of_destination_nodes != 0))
  5952. {
  5953. // Allocate memory to hold the list of nodes.
  5954. DBG_SAVE_FILE_LINE
  5955. if (NULL != (pMsgEx->pBuf = new BYTE[number_of_destination_nodes * sizeof (UserID)]))
  5956. {
  5957. /*
  5958. * Retrieve the actual pointer to memory from the Memory
  5959. * object.
  5960. */
  5961. pMsgEx->Msg.u.transfer_confirm.destination_node_list = (UserID *) pMsgEx->pBuf;
  5962. for (i = 0; i < number_of_destination_nodes; i++)
  5963. {
  5964. pMsgEx->Msg.u.transfer_confirm.destination_node_list[i] = destination_node_list[i];
  5965. }
  5966. }
  5967. else
  5968. {
  5969. ERROR_OUT(("CControlSAP::ConfTransferConfirm: Error allocating memory"));
  5970. rc = GCC_ALLOCATION_FAILURE;
  5971. }
  5972. }
  5973. if (rc == GCC_NO_ERROR)
  5974. {
  5975. pMsgEx->Msg.u.transfer_confirm.number_of_destination_nodes = number_of_destination_nodes;
  5976. pMsgEx->Msg.u.transfer_confirm.conference_id = conference_id;
  5977. pMsgEx->Msg.u.transfer_confirm.result = result;
  5978. // Queue up the message for delivery to the Node Controller.
  5979. PostConfirmCtrlSapMsg(pMsgEx);
  5980. }
  5981. }
  5982. else
  5983. {
  5984. ERROR_OUT(("CControlSAP::ConfTransferConfirm: can't create GCCCtrlSapMsgEx"));
  5985. rc = GCC_ALLOCATION_FAILURE;
  5986. }
  5987. if (GCC_NO_ERROR != rc)
  5988. {
  5989. FreeCtrlSapMsgEx(pMsgEx);
  5990. HandleResourceFailure();
  5991. }
  5992. DebugExitINT(CControlSAP::ConfTransferConfirm, rc);
  5993. return rc;
  5994. }
  5995. #endif // JASPER
  5996. /*
  5997. * ConfAddIndication ()
  5998. *
  5999. * Public Function Description
  6000. * This function is called by the CConf when it need to send a
  6001. * conference add indication to the node controller. It adds the
  6002. * message to a queue of messages to be sent to the node controller in
  6003. * the next heartbeat.
  6004. */
  6005. GCCError CControlSAP::ConfAddIndication
  6006. (
  6007. GCCConfID conference_id,
  6008. GCCResponseTag add_response_tag,
  6009. CNetAddrListContainer *network_address_list,
  6010. CUserDataListContainer *user_data_list,
  6011. UserID requesting_node
  6012. )
  6013. {
  6014. GCCError rc = GCC_NO_ERROR;
  6015. DebugEntry(CControlSAP::ConfAddIndication);
  6016. #ifdef GCCNC_DIRECT_INDICATION
  6017. GCCCtrlSapMsg Msg;
  6018. Msg.message_type = GCC_ADD_INDICATION;
  6019. //
  6020. // First determine the size of the block required to hold all
  6021. // of the network address list data.
  6022. //
  6023. UINT block_size = network_address_list->LockNetworkAddressList();
  6024. //
  6025. // Add the size of the user data block if any user data exists
  6026. //
  6027. if (user_data_list != NULL)
  6028. {
  6029. block_size += user_data_list->LockUserDataList();
  6030. }
  6031. //
  6032. // Allocate memory to hold the user data and network addresses.
  6033. //
  6034. LPBYTE pData;
  6035. DBG_SAVE_FILE_LINE
  6036. if (NULL != (pData = new BYTE[block_size]))
  6037. {
  6038. LPBYTE pDataTemp = pData;
  6039. //
  6040. // Retrieve the network address list data from the container
  6041. // and unlock the container data.
  6042. //
  6043. pDataTemp += network_address_list->GetNetworkAddressListAPI(
  6044. &(Msg.u.add_indication.number_of_network_addresses),
  6045. &(Msg.u.add_indication.network_address_list),
  6046. pData);
  6047. network_address_list->UnLockNetworkAddressList();
  6048. //
  6049. // Retrieve the user data from the container if it exists
  6050. // and unlock the container data.
  6051. //
  6052. if (user_data_list != NULL)
  6053. {
  6054. user_data_list->GetUserDataList(
  6055. &(Msg.u.add_indication.number_of_user_data_members),
  6056. &(Msg.u.add_indication.user_data_list),
  6057. pDataTemp);
  6058. user_data_list->UnLockUserDataList();
  6059. }
  6060. else
  6061. {
  6062. Msg.u.add_indication.number_of_user_data_members = 0;
  6063. Msg.u.add_indication.user_data_list = NULL;
  6064. }
  6065. Msg.u.add_indication.conference_id = conference_id;
  6066. Msg.u.add_indication.requesting_node_id = requesting_node;
  6067. Msg.u.add_indication.add_response_tag = add_response_tag;
  6068. SendCtrlSapMsg(&Msg);
  6069. rc = GCC_NO_ERROR;
  6070. delete [] pData;
  6071. }
  6072. else
  6073. {
  6074. ERROR_OUT(("CControlSAP::ConfAddIndication: can't allocate buffer, size=%u", (UINT) block_size));
  6075. rc = GCC_ALLOCATION_FAILURE;
  6076. }
  6077. #else
  6078. GCCCtrlSapMsgEx *pMsgEx;
  6079. UINT block_size;
  6080. LPBYTE memory_ptr;
  6081. /*
  6082. ** Allocate the GCC callback message and fill it in with the
  6083. ** appropriate values.
  6084. */
  6085. DBG_SAVE_FILE_LINE
  6086. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_ADD_INDICATION)))
  6087. {
  6088. ::ZeroMemory(&(pMsgEx->Msg.u.add_indication), sizeof(pMsgEx->Msg.u.add_indication));
  6089. /*
  6090. ** First determine the size of the block required to hold all
  6091. ** of the network address list data.
  6092. */
  6093. block_size = network_address_list->LockNetworkAddressList();
  6094. /*
  6095. ** Add the size of the user data block if any user data exists
  6096. */
  6097. if (user_data_list != NULL)
  6098. {
  6099. block_size += user_data_list->LockUserDataList();
  6100. }
  6101. /*
  6102. ** Allocate memory to hold the user data and network addresses.
  6103. */
  6104. DBG_SAVE_FILE_LINE
  6105. if (NULL != (pMsgEx->pBuf = new BYTE[block_size]))
  6106. {
  6107. memory_ptr = pMsgEx->pBuf;
  6108. /*
  6109. * Retrieve the network address list data from the container
  6110. * and unlock the container data.
  6111. */
  6112. memory_ptr += network_address_list->GetNetworkAddressListAPI(
  6113. &(pMsgEx->Msg.u.add_indication.number_of_network_addresses),
  6114. &(pMsgEx->Msg.u.add_indication.network_address_list),
  6115. memory_ptr);
  6116. network_address_list->UnLockNetworkAddressList();
  6117. /*
  6118. * Retrieve the user data from the container if it exists
  6119. * and unlock the container data.
  6120. */
  6121. if (user_data_list != NULL)
  6122. {
  6123. user_data_list->GetUserDataList(
  6124. &(pMsgEx->Msg.u.add_indication.number_of_user_data_members),
  6125. &(pMsgEx->Msg.u.add_indication.user_data_list),
  6126. memory_ptr);
  6127. user_data_list->UnLockUserDataList();
  6128. }
  6129. else
  6130. {
  6131. // pMsgEx->Msg.u.add_indication.number_of_user_data_members = 0;
  6132. // pMsgEx->Msg.u.add_indication.user_data_list = NULL;
  6133. }
  6134. pMsgEx->Msg.u.add_indication.conference_id = conference_id;
  6135. pMsgEx->Msg.u.add_indication.requesting_node_id = requesting_node;
  6136. pMsgEx->Msg.u.add_indication.add_response_tag = add_response_tag;
  6137. // Queue up the message for delivery to the Node Controller.
  6138. PostIndCtrlSapMsg(pMsgEx);
  6139. rc = GCC_NO_ERROR;
  6140. }
  6141. else
  6142. {
  6143. ERROR_OUT(("CControlSAP::ConfAddIndication: can't allocate buffer, size=%u", (UINT) block_size));
  6144. rc = GCC_ALLOCATION_FAILURE;
  6145. }
  6146. }
  6147. else
  6148. {
  6149. ERROR_OUT(("CControlSAP::ConfAddIndication: can't create GCCCtrlSapMsgEx"));
  6150. rc = GCC_ALLOCATION_FAILURE;
  6151. }
  6152. if (GCC_NO_ERROR != rc)
  6153. {
  6154. FreeCtrlSapMsgEx(pMsgEx);
  6155. HandleResourceFailure(rc);
  6156. }
  6157. #endif // GCCNC_DIRECT_INDICATION
  6158. DebugExitINT(CControlSAP::ConfAddIndication, rc);
  6159. return rc;
  6160. }
  6161. /*
  6162. * ConfAddConfirm
  6163. *
  6164. * Public Function Description
  6165. * This function is called by the CConf when it need to send a
  6166. * conference add confirm to the node controller. It adds the
  6167. * message to a queue of messages to be sent to the node controller in
  6168. * the next heartbeat.
  6169. */
  6170. GCCError CControlSAP::ConfAddConfirm
  6171. (
  6172. GCCConfID conference_id,
  6173. CNetAddrListContainer *network_address_list,
  6174. CUserDataListContainer *user_data_list,
  6175. GCCResult result
  6176. )
  6177. {
  6178. GCCError rc = GCC_NO_ERROR;
  6179. DebugEntry(CControlSAP::ConfAddConfirm);
  6180. #ifdef GCCNC_DIRECT_CONFIRM
  6181. GCCCtrlSapMsg Msg;
  6182. Msg.message_type = GCC_ADD_CONFIRM;
  6183. //
  6184. // First determine the size of the block required to hold all
  6185. // of the network address list data.
  6186. //
  6187. UINT cbDataSize = network_address_list->LockNetworkAddressList();
  6188. //
  6189. // Add the size of the user data block if any user data exists
  6190. //
  6191. if (user_data_list != NULL)
  6192. {
  6193. cbDataSize += user_data_list->LockUserDataList();
  6194. }
  6195. //
  6196. // Allocate memory to hold the user data and network addresses.
  6197. //
  6198. DBG_SAVE_FILE_LINE
  6199. LPBYTE pAllocated = new BYTE[cbDataSize];
  6200. LPBYTE pData;
  6201. if (NULL != (pData = pAllocated))
  6202. {
  6203. //
  6204. // Retrieve the network address list data from the container
  6205. // and unlock the container data.
  6206. //
  6207. pData += network_address_list->GetNetworkAddressListAPI(
  6208. &(Msg.u.add_confirm.number_of_network_addresses),
  6209. &(Msg.u.add_confirm.network_address_list),
  6210. pData);
  6211. network_address_list->UnLockNetworkAddressList();
  6212. //
  6213. // Retrieve the user data from the container if it exists
  6214. // and unlock the container data.
  6215. //
  6216. if (user_data_list != NULL)
  6217. {
  6218. user_data_list->GetUserDataList(
  6219. &(Msg.u.add_confirm.number_of_user_data_members),
  6220. &(Msg.u.add_confirm.user_data_list),
  6221. pData);
  6222. user_data_list->UnLockUserDataList();
  6223. }
  6224. else
  6225. {
  6226. Msg.u.add_confirm.number_of_user_data_members = 0;
  6227. Msg.u.add_confirm.user_data_list = NULL;
  6228. }
  6229. Msg.nConfID = conference_id;
  6230. Msg.u.add_confirm.conference_id = conference_id;
  6231. Msg.u.add_confirm.result = result;
  6232. SendCtrlSapMsg(&Msg);
  6233. rc = GCC_NO_ERROR;
  6234. // clean up
  6235. delete [] pAllocated;
  6236. }
  6237. else
  6238. {
  6239. ERROR_OUT(("CControlSAP::ConfAddConfirm: can't allocate buffer, size=%u", (UINT) cbDataSize));
  6240. rc = GCC_ALLOCATION_FAILURE;
  6241. HandleResourceFailure(rc);
  6242. }
  6243. #else
  6244. GCCCtrlSapMsgEx *pMsgEx;
  6245. UINT block_size;
  6246. LPBYTE memory_ptr;
  6247. /*
  6248. ** Allocate the GCC callback message and fill it in with the
  6249. ** appropriate values.
  6250. */
  6251. DBG_SAVE_FILE_LINE
  6252. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_ADD_CONFIRM)))
  6253. {
  6254. ::ZeroMemory(&(pMsgEx->Msg.u.add_confirm), sizeof(pMsgEx->Msg.u.add_confirm));
  6255. /*
  6256. ** First determine the size of the block required to hold all
  6257. ** of the network address list data.
  6258. */
  6259. block_size = network_address_list->LockNetworkAddressList();
  6260. /*
  6261. ** Add the size of the user data block if any user data exists
  6262. */
  6263. if (user_data_list != NULL)
  6264. block_size += user_data_list->LockUserDataList();
  6265. /*
  6266. ** Allocate memory to hold the user data and network addresses.
  6267. */
  6268. DBG_SAVE_FILE_LINE
  6269. if (NULL != (pMsgEx->pBuf = (LPBYTE) new BYTE[block_size]))
  6270. {
  6271. memory_ptr = pMsgEx->pBuf;
  6272. /*
  6273. * Retrieve the network address list data from the container
  6274. * and unlock the container data.
  6275. */
  6276. memory_ptr += network_address_list->GetNetworkAddressListAPI(
  6277. &(pMsgEx->Msg.u.add_confirm.number_of_network_addresses),
  6278. &(pMsgEx->Msg.u.add_confirm.network_address_list),
  6279. memory_ptr);
  6280. network_address_list->UnLockNetworkAddressList();
  6281. /*
  6282. * Retrieve the user data from the container if it exists
  6283. * and unlock the container data.
  6284. */
  6285. if (user_data_list != NULL)
  6286. {
  6287. user_data_list->GetUserDataList(
  6288. &(pMsgEx->Msg.u.add_confirm.number_of_user_data_members),
  6289. &(pMsgEx->Msg.u.add_confirm.user_data_list),
  6290. memory_ptr);
  6291. user_data_list->UnLockUserDataList();
  6292. }
  6293. else
  6294. {
  6295. // pMsgEx->Msg.u.add_confirm.number_of_user_data_members = 0;
  6296. // pMsgEx->Msg.u.add_confirm.user_data_list = NULL;
  6297. }
  6298. pMsgEx->Msg.nConfID = conference_id;
  6299. pMsgEx->Msg.u.add_confirm.conference_id = conference_id;
  6300. pMsgEx->Msg.u.add_confirm.result = result;
  6301. // Queue up the message for delivery to the Node Controller.
  6302. PostConfirmCtrlSapMsg(pMsgEx);
  6303. rc = GCC_NO_ERROR;
  6304. }
  6305. else
  6306. {
  6307. ERROR_OUT(("CControlSAP::ConfAddConfirm: can't allocate buffer, size=%u", (UINT) block_size));
  6308. rc = GCC_ALLOCATION_FAILURE;
  6309. }
  6310. }
  6311. else
  6312. {
  6313. ERROR_OUT(("CControlSAP::ConfAddConfirm: can't create GCCCtrlSapMsgEx"));
  6314. rc = GCC_ALLOCATION_FAILURE;
  6315. }
  6316. if (GCC_NO_ERROR != rc)
  6317. {
  6318. FreeCtrlSapMsgEx(pMsgEx);
  6319. HandleResourceFailure(rc);
  6320. }
  6321. #endif // GCCNC_DIRECT_CONFIRM
  6322. DebugExitINT(CControlSAP::ConfAddConfirm, rc);
  6323. return rc;
  6324. }
  6325. /*
  6326. * SubInitializationCompleteIndication ()
  6327. *
  6328. * Public Function Description
  6329. * This function is called by the CConf when it need to send a
  6330. * sub-initialization complete indication to the node controller. It adds
  6331. * the message to a queue of messages to be sent to the node controller in
  6332. * the next heartbeat.
  6333. */
  6334. GCCError CControlSAP::SubInitializationCompleteIndication
  6335. (
  6336. UserID user_id,
  6337. ConnectionHandle connection_handle
  6338. )
  6339. {
  6340. GCCError rc;
  6341. DebugEntry(CControlSAP::SubInitializationCompleteIndication);
  6342. #ifdef GCCNC_DIRECT_INDICATION
  6343. GCCCtrlSapMsg Msg;
  6344. Msg.message_type = GCC_SUB_INITIALIZED_INDICATION;
  6345. Msg.u.conf_sub_initialized_indication.subordinate_node_id = user_id;
  6346. Msg.u.conf_sub_initialized_indication.connection_handle =connection_handle;
  6347. SendCtrlSapMsg(&Msg);
  6348. rc = GCC_NO_ERROR;
  6349. #else
  6350. GCCCtrlSapMsgEx *pMsgEx;
  6351. //
  6352. // Allocate control sap message.
  6353. //
  6354. DBG_SAVE_FILE_LINE
  6355. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_SUB_INITIALIZED_INDICATION)))
  6356. {
  6357. // ::ZeroMemory(&(pMsgEx->Msg.u.conf_sub_initialized_indication), sizeof(pMsgEx->Msg.u.conf_sub_initialized_indication));
  6358. pMsgEx->Msg.u.conf_sub_initialized_indication.subordinate_node_id = user_id;
  6359. pMsgEx->Msg.u.conf_sub_initialized_indication.connection_handle =connection_handle;
  6360. // Queue up the message for delivery to the Node Controller.
  6361. PostIndCtrlSapMsg(pMsgEx);
  6362. rc = GCC_NO_ERROR;
  6363. }
  6364. else
  6365. {
  6366. rc = GCC_ALLOCATION_FAILURE;
  6367. HandleResourceFailure();
  6368. }
  6369. #endif // GCCNC_DIRECT_INDICATION
  6370. DebugExitINT(CControlSAP::SubInitializationCompleteIndication, rc);
  6371. return rc;
  6372. }
  6373. /*
  6374. * Private member functions of the CControlSAP object.
  6375. */
  6376. /*
  6377. * BOOL CControlSAP::IsNumericNameValid(
  6378. * GCCNumericString numeric_string)
  6379. *
  6380. * Public member function of CControlSAP.
  6381. *
  6382. * Function Description:
  6383. * This routine is used to validate a numeric string by checking to make
  6384. * sure that none of the constraints imposed by the ASN.1 specification
  6385. * are violated.
  6386. *
  6387. * Formal Parameters:
  6388. * numeric_string (i) The numeric string to validate.
  6389. *
  6390. * Return Value:
  6391. * TRUE - The numeric string is valid.
  6392. * FALSE - The numeric string violates an ASN.1 constraint.
  6393. *
  6394. * Side Effects:
  6395. * None.
  6396. *
  6397. * Caveats:
  6398. * None.
  6399. */
  6400. BOOL CControlSAP::IsNumericNameValid ( GCCNumericString numeric_string )
  6401. {
  6402. BOOL rc = TRUE;
  6403. UINT numeric_string_length = 0;
  6404. //
  6405. // LONCHANC: We should change it such that the default is FALSE
  6406. // because many cases except one can be FALSE.
  6407. //
  6408. if (numeric_string != NULL)
  6409. {
  6410. if (*numeric_string == 0)
  6411. rc = FALSE;
  6412. else
  6413. {
  6414. while (*numeric_string != 0)
  6415. {
  6416. /*
  6417. ** Check to make sure the characters in the numeric string are
  6418. ** within the allowable range.
  6419. */
  6420. if ((*numeric_string < '0') ||
  6421. (*numeric_string > '9'))
  6422. {
  6423. rc = FALSE;
  6424. break;
  6425. }
  6426. numeric_string++;
  6427. numeric_string_length++;
  6428. /*
  6429. ** Check to make sure that the length of the string is within
  6430. ** the allowable range.
  6431. */
  6432. if (numeric_string_length > MAXIMUM_CONFERENCE_NAME_LENGTH)
  6433. {
  6434. rc = FALSE;
  6435. break;
  6436. }
  6437. }
  6438. }
  6439. }
  6440. else
  6441. rc = FALSE;
  6442. return rc;
  6443. }
  6444. /*
  6445. * BOOL CControlSAP::IsTextNameValid (LPWSTR text_string)
  6446. *
  6447. * Public member function of CControlSAP.
  6448. *
  6449. * Function Description:
  6450. * This routine is used to validate a text string by checking to make
  6451. * sure that none of the constraints imposed by the ASN.1 specification
  6452. * are violated.
  6453. *
  6454. * Formal Parameters:
  6455. * text_string (i) The text string to validate.
  6456. *
  6457. * Return Value:
  6458. * TRUE - The text string is valid.
  6459. * FALSE - The text string violates an ASN.1 constraint.
  6460. *
  6461. * Side Effects:
  6462. * None.
  6463. *
  6464. * Caveats:
  6465. * None.
  6466. */
  6467. BOOL CControlSAP::IsTextNameValid ( LPWSTR text_string )
  6468. {
  6469. BOOL rc = TRUE;
  6470. UINT text_string_length = 0;
  6471. if (text_string != NULL)
  6472. {
  6473. /*
  6474. ** Check to make sure that the length of the string is within
  6475. ** the allowable range.
  6476. */
  6477. while (*text_string != 0)
  6478. {
  6479. text_string++;
  6480. text_string_length++;
  6481. if (text_string_length > MAXIMUM_CONFERENCE_NAME_LENGTH)
  6482. {
  6483. rc = FALSE;
  6484. break;
  6485. }
  6486. }
  6487. }
  6488. else
  6489. rc = FALSE;
  6490. return rc;
  6491. }
  6492. /*
  6493. * GCCError CControlSAP::QueueJoinIndication(
  6494. * GCCResponseTag response_tag,
  6495. * GCCConfID conference_id,
  6496. * CPassword *convener_password,
  6497. * CPassword *password_challenge,
  6498. * LPWSTR pwszCallerID,
  6499. * TransportAddress calling_address,
  6500. * TransportAddress called_address,
  6501. * CUserDataListContainer *user_data_list,
  6502. * BOOL intermediate_node,
  6503. * ConnectionHandle connection_handle)
  6504. *
  6505. * Public member function of CControlSAP.
  6506. *
  6507. * Function Description:
  6508. * This routine is used to place join indications into the queue of
  6509. * messages to be delivered to the node controller.
  6510. *
  6511. * Formal Parameters:
  6512. * response_tag (i) Unique tag associated with this join .
  6513. * conference_id (i) The conference identifier.
  6514. * convener_password (i) Password used to obtain convener privileges.
  6515. * password_challenge (i) Password used to join the conference.
  6516. * pwszCallerID (i) Identifier of party initiating call.
  6517. * calling_address (i) Transport address of party making call.
  6518. * called_address (i) Transport address of party being called.
  6519. * user_data_list (i) User data carried in the join.
  6520. * intermediate_node (i) Flag indicating whether join is made at
  6521. * intermediate node.
  6522. * connection_handle (i) Handle for the logical connection.
  6523. *
  6524. * Return Value:
  6525. * GCC_NO_ERROR - Message successfully queued.
  6526. * GCC_ALLOCATION_FAILURE - A resource allocation failure occurred.
  6527. *
  6528. * Side Effects:
  6529. * None.
  6530. *
  6531. * Caveats:
  6532. * None.
  6533. */
  6534. GCCError CControlSAP::QueueJoinIndication
  6535. (
  6536. GCCResponseTag response_tag,
  6537. GCCConfID conference_id,
  6538. CPassword *convener_password,
  6539. CPassword *password_challenge,
  6540. LPWSTR pwszCallerID,
  6541. TransportAddress calling_address,
  6542. TransportAddress called_address,
  6543. CUserDataListContainer *user_data_list,
  6544. BOOL intermediate_node,
  6545. ConnectionHandle connection_handle
  6546. )
  6547. {
  6548. GCCError rc;
  6549. DebugEntry(CControlSAP::QueueJoinIndication);
  6550. #ifdef GCCNC_DIRECT_INDICATION
  6551. GCCCtrlSapMsg Msg;
  6552. Msg.message_type = GCC_JOIN_INDICATION;
  6553. /*
  6554. ** Copy the information that needs to be sent to the node
  6555. ** controller into local memory that can be deleted once the
  6556. ** information to be sent to the application is flushed. Note that
  6557. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  6558. ** action is taken on subsequent calls to that routine.
  6559. */
  6560. // start with success
  6561. rc = GCC_NO_ERROR;
  6562. // Copy the Convener Password
  6563. ::CSAP_CopyDataToGCCMessage_Password(
  6564. convener_password,
  6565. &(Msg.u.join_indication.convener_password));
  6566. // Copy the Password
  6567. ::CSAP_CopyDataToGCCMessage_Challenge(
  6568. password_challenge,
  6569. &(Msg.u.join_indication.password_challenge));
  6570. // Copy the Caller Identifier
  6571. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  6572. pwszCallerID,
  6573. &(Msg.u.join_indication.caller_identifier));
  6574. // Copy the Calling Address
  6575. ::CSAP_CopyDataToGCCMessage_Call(
  6576. calling_address,
  6577. &(Msg.u.join_indication.calling_address));
  6578. // Copy the Called Address
  6579. ::CSAP_CopyDataToGCCMessage_Call(
  6580. called_address,
  6581. &(Msg.u.join_indication.called_address));
  6582. // Copy the User Data if it exists.
  6583. LPBYTE pUserDataMemory = NULL;
  6584. if (user_data_list != NULL)
  6585. {
  6586. rc = RetrieveUserDataList(
  6587. user_data_list,
  6588. &(Msg.u.join_indication.number_of_user_data_members),
  6589. &(Msg.u.join_indication.user_data_list),
  6590. &pUserDataMemory);
  6591. }
  6592. else
  6593. {
  6594. Msg.u.join_indication.number_of_user_data_members = 0;
  6595. Msg.u.join_indication.user_data_list = NULL;
  6596. }
  6597. if (GCC_NO_ERROR == rc)
  6598. {
  6599. /*
  6600. ** Filling in the rest of the information that needs to be sent
  6601. ** to the application.
  6602. */
  6603. Msg.u.join_indication.join_response_tag = response_tag;
  6604. Msg.u.join_indication.conference_id = conference_id ;
  6605. Msg.u.join_indication.node_is_intermediate = intermediate_node;
  6606. Msg.u.join_indication.connection_handle = connection_handle;
  6607. SendCtrlSapMsg(&Msg);
  6608. delete pUserDataMemory;
  6609. if (NULL != convener_password)
  6610. {
  6611. convener_password->UnLockPasswordData();
  6612. }
  6613. if (NULL != password_challenge)
  6614. {
  6615. password_challenge->UnLockPasswordData();
  6616. }
  6617. }
  6618. #else
  6619. GCCCtrlSapMsgEx *pMsgEx;
  6620. /*
  6621. ** Allocate the GCC callback message and fill it in with the
  6622. ** appropriate values.
  6623. */
  6624. DBG_SAVE_FILE_LINE
  6625. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_JOIN_INDICATION, TRUE)))
  6626. {
  6627. ::ZeroMemory(&(pMsgEx->Msg.u.join_indication), sizeof(pMsgEx->Msg.u.join_indication));
  6628. /*
  6629. ** Copy the information that needs to be sent to the node
  6630. ** controller into local memory that can be deleted once the
  6631. ** information to be sent to the application is flushed. Note that
  6632. ** if an error occurs in one call to "CopyDataToGCCMessage" then no
  6633. ** action is taken on subsequent calls to that routine.
  6634. */
  6635. // start with success
  6636. rc = GCC_NO_ERROR;
  6637. // Copy the Convener Password
  6638. ::CSAP_CopyDataToGCCMessage_Password(
  6639. TRUE, // convener password
  6640. pMsgEx->pToDelete,
  6641. convener_password,
  6642. &(pMsgEx->Msg.u.join_indication.convener_password),
  6643. &rc);
  6644. // Copy the Password
  6645. ::CSAP_CopyDataToGCCMessage_Challenge(
  6646. pMsgEx->pToDelete,
  6647. password_challenge,
  6648. &(pMsgEx->Msg.u.join_indication.password_challenge),
  6649. &rc);
  6650. // Copy the Caller Identifier
  6651. ::CSAP_CopyDataToGCCMessage_IDvsDesc(
  6652. TRUE, // caller id
  6653. pMsgEx->pToDelete,
  6654. pwszCallerID,
  6655. &(pMsgEx->Msg.u.join_indication.caller_identifier),
  6656. &rc);
  6657. // Copy the Calling Address
  6658. ::CSAP_CopyDataToGCCMessage_Call(
  6659. TRUE, // calling address
  6660. pMsgEx->pToDelete,
  6661. calling_address,
  6662. &(pMsgEx->Msg.u.join_indication.calling_address),
  6663. &rc);
  6664. // Copy the Called Address
  6665. ::CSAP_CopyDataToGCCMessage_Call(
  6666. FALSE, // called address
  6667. pMsgEx->pToDelete,
  6668. called_address,
  6669. &(pMsgEx->Msg.u.join_indication.called_address),
  6670. &rc);
  6671. if (GCC_NO_ERROR == rc)
  6672. {
  6673. // Copy the User Data if it exists.
  6674. if (user_data_list != NULL)
  6675. {
  6676. rc = RetrieveUserDataList(
  6677. user_data_list,
  6678. &(pMsgEx->Msg.u.join_indication.number_of_user_data_members),
  6679. &(pMsgEx->Msg.u.join_indication.user_data_list),
  6680. &(pMsgEx->pToDelete->user_data_list_memory));
  6681. ASSERT(GCC_NO_ERROR == rc);
  6682. }
  6683. else
  6684. {
  6685. // pMsgEx->Msg.u.join_indication.number_of_user_data_members = 0;
  6686. // pMsgEx->Msg.u.join_indication.user_data_list = NULL;
  6687. }
  6688. if (GCC_NO_ERROR == rc)
  6689. {
  6690. /*
  6691. ** Filling in the rest of the information that needs to be sent
  6692. ** to the application.
  6693. */
  6694. pMsgEx->Msg.u.join_indication.join_response_tag = response_tag;
  6695. pMsgEx->Msg.u.join_indication.conference_id = conference_id ;
  6696. pMsgEx->Msg.u.join_indication.node_is_intermediate = intermediate_node;
  6697. pMsgEx->Msg.u.join_indication.connection_handle = connection_handle;
  6698. // Queue up the message for delivery to the Node Controller.
  6699. PostIndCtrlSapMsg(pMsgEx);
  6700. }
  6701. }
  6702. }
  6703. else
  6704. {
  6705. ERROR_OUT(("CControlSAP::QueueJoinIndication: can't create GCCCtrlSapMsgEx"));
  6706. rc = GCC_ALLOCATION_FAILURE;
  6707. }
  6708. if (GCC_NO_ERROR != rc)
  6709. {
  6710. FreeCtrlSapMsgEx(pMsgEx);
  6711. HandleResourceFailure(rc);
  6712. }
  6713. #endif // GCCNC_DIRECT_INDICATION
  6714. DebugExitINT(CControlSAP::QueueJoinIndication, rc);
  6715. return rc;
  6716. }
  6717. /*
  6718. * GCCError CControlSAP::RetrieveUserDataList(
  6719. * CUserDataListContainer *user_data_list_object,
  6720. * PUShort number_of_data_members,
  6721. * PGCCUserData **user_data_list,
  6722. * LPBYTE *pUserDataMemory)
  6723. *
  6724. * Public member function of CControlSAP.
  6725. *
  6726. * Function Description:
  6727. * This routine is used to fill in a user data list using a CUserDataListContainer
  6728. * container. The memory needed to hold the user data will be allocated
  6729. * by this routine.
  6730. *
  6731. * Formal Parameters:
  6732. * user_data_list_object (i) The CUserDataListContainer container holding the
  6733. * user data.
  6734. * number_of_data_members (o) The number of elements in the list of
  6735. * user data.
  6736. * user_data_list (o) The "API" user data list to fill in.
  6737. * data_to_be_deleted (o) Structure which will hold the memory
  6738. * allocated for the user data.
  6739. *
  6740. * Return Value:
  6741. * GCC_NO_ERROR - User data successfully retrieved.
  6742. * GCC_ALLOCATION_FAILURE - A resource allocation failure occurred.
  6743. *
  6744. * Side Effects:
  6745. * None.
  6746. *
  6747. * Caveats:
  6748. * None.
  6749. */
  6750. GCCError CControlSAP::RetrieveUserDataList
  6751. (
  6752. CUserDataListContainer *user_data_list_object,
  6753. UINT *number_of_data_members,
  6754. PGCCUserData **user_data_list,
  6755. LPBYTE *ppUserDataMemory
  6756. )
  6757. {
  6758. GCCError rc = GCC_NO_ERROR;
  6759. UINT user_data_length;
  6760. DebugEntry(CControlSAP::RetrieveUserDataList);
  6761. /*
  6762. * Lock the user data list object in order to determine the amount of
  6763. * memory to allocate to hold the user data.
  6764. */
  6765. user_data_length = user_data_list_object->LockUserDataList ();
  6766. DBG_SAVE_FILE_LINE
  6767. if (NULL != (*ppUserDataMemory = new BYTE[user_data_length]))
  6768. {
  6769. /*
  6770. * The CUserDataListContainer "Get" call will set the user_data_list
  6771. * pointer equal to this memory pointer.
  6772. */
  6773. user_data_list_object->GetUserDataList(
  6774. number_of_data_members,
  6775. user_data_list,
  6776. *ppUserDataMemory);
  6777. }
  6778. else
  6779. {
  6780. ERROR_OUT(("CControlSAP::RetrieveUserDataList: Error allocating memory"));
  6781. rc = GCC_ALLOCATION_FAILURE;
  6782. }
  6783. /*
  6784. * Unlock the data for the user data list object.
  6785. */
  6786. user_data_list_object->UnLockUserDataList ();
  6787. DebugExitINT(CControlSAP::RetrieveUserDataList, rc);
  6788. return rc;
  6789. }
  6790. /* ------ pure virtual in CBaseSap (shared with CAppSap) ------ */
  6791. /*
  6792. * ConfRosterInquireConfirm()
  6793. *
  6794. * Public Function Description
  6795. * This routine is called in order to return a requested conference
  6796. * roster to an application or the node controller.
  6797. */
  6798. GCCError CControlSAP::ConfRosterInquireConfirm
  6799. (
  6800. GCCConfID conference_id,
  6801. PGCCConferenceName conference_name,
  6802. GCCNumericString conference_modifier,
  6803. LPWSTR pwszConfDescriptor,
  6804. CConfRoster *conference_roster,
  6805. GCCResult result,
  6806. GCCAppSapMsgEx **ppAppSapMsgEx
  6807. )
  6808. {
  6809. GCCCtrlSapMsgEx *pMsgEx;
  6810. GCCError rc = GCC_NO_ERROR;
  6811. UINT memory_block_size = 0;
  6812. int name_unicode_string_length;
  6813. int descriptor_unicode_string_length;
  6814. LPBYTE pBuf = NULL;
  6815. LPBYTE memory_pointer;
  6816. DebugEntry(CControlSAP::ConfRosterInquireConfirm);
  6817. ASSERT(NULL == ppAppSapMsgEx);
  6818. /*
  6819. ** Create a new message structure to hold the message to be delivered
  6820. ** to the application or node controller.
  6821. */
  6822. DBG_SAVE_FILE_LINE
  6823. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_ROSTER_INQUIRE_CONFIRM)))
  6824. {
  6825. ::ZeroMemory(&(pMsgEx->Msg.u.conf_roster_inquire_confirm), sizeof(pMsgEx->Msg.u.conf_roster_inquire_confirm));
  6826. /*
  6827. * Determine the length of the numeric portion of the conference name.
  6828. */
  6829. if (conference_name->numeric_string != NULL)
  6830. {
  6831. memory_block_size += (::lstrlenA(conference_name->numeric_string) + 1);
  6832. memory_block_size = ROUNDTOBOUNDARY(memory_block_size);
  6833. }
  6834. /*
  6835. * Determine the length of the text portion of the conference name if it
  6836. * exists. A UnicodeString object is created temporarily to determine
  6837. * the length of the string.
  6838. */
  6839. if (conference_name->text_string != NULL)
  6840. {
  6841. name_unicode_string_length = ROUNDTOBOUNDARY(
  6842. (::lstrlenW(conference_name->text_string) + 1) * sizeof(WCHAR));
  6843. memory_block_size += name_unicode_string_length;
  6844. }
  6845. /*
  6846. * Determine the length of the conference modifier.
  6847. */
  6848. if (conference_modifier != NULL)
  6849. {
  6850. memory_block_size += (::lstrlenA(conference_modifier) + 1);
  6851. memory_block_size = ROUNDTOBOUNDARY(memory_block_size);
  6852. }
  6853. /*
  6854. * Determine the length of the conference descriptor. A UnicodeString
  6855. * object is created temporarily to determine the length of the string.
  6856. */
  6857. if (pwszConfDescriptor != NULL)
  6858. {
  6859. descriptor_unicode_string_length = ROUNDTOBOUNDARY(
  6860. (::lstrlenW(pwszConfDescriptor) + 1) * sizeof(WCHAR));
  6861. memory_block_size += descriptor_unicode_string_length;
  6862. }
  6863. /*
  6864. * Lock the data for the conference roster. The lock call will
  6865. * return the length of the data to be serialized for the roster so
  6866. * add that length to the total memory block size and allocate the
  6867. * memory block.
  6868. */
  6869. memory_block_size += conference_roster->LockConferenceRoster();
  6870. /*
  6871. * If the memory was successfully allocated, get a pointer to the
  6872. * memory. The first pointer in the roster inquire confirm message
  6873. * will be set to this location and all serialized data written into
  6874. * the memory block.
  6875. */
  6876. DBG_SAVE_FILE_LINE
  6877. if (NULL != (pMsgEx->pBuf = new BYTE[memory_block_size]))
  6878. {
  6879. memory_pointer = pMsgEx->pBuf;
  6880. /*
  6881. * Write the conference name string(s) into memory and set the
  6882. * message structure pointers.
  6883. */
  6884. if (conference_name->numeric_string != NULL)
  6885. {
  6886. ::lstrcpyA((LPSTR)memory_pointer, (LPSTR)conference_name->numeric_string);
  6887. pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_name.
  6888. numeric_string = (LPSTR) memory_pointer;
  6889. memory_pointer += ROUNDTOBOUNDARY(
  6890. ::lstrlenA(conference_name->numeric_string) + 1);
  6891. }
  6892. else
  6893. {
  6894. // pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_name.numeric_string = NULL;
  6895. }
  6896. /*
  6897. * Copy the text portion of the conference name if it exists.
  6898. */
  6899. if (conference_name->text_string != NULL)
  6900. {
  6901. ::CopyMemory(memory_pointer, (LPSTR)conference_name->text_string, name_unicode_string_length);
  6902. pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_name.text_string = (LPWSTR)memory_pointer;
  6903. memory_pointer += name_unicode_string_length;
  6904. }
  6905. else
  6906. {
  6907. // pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_name.text_string = NULL;
  6908. }
  6909. /*
  6910. * Copy the conference modifier is it exists
  6911. */
  6912. if (conference_modifier != NULL)
  6913. {
  6914. ::lstrcpyA((LPSTR)memory_pointer, (LPSTR)conference_modifier);
  6915. pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_modifier = (LPSTR) memory_pointer;
  6916. memory_pointer += ROUNDTOBOUNDARY(::lstrlenA(conference_modifier) + 1);
  6917. }
  6918. else
  6919. {
  6920. // pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_modifier = NULL;
  6921. }
  6922. /*
  6923. * Copy the conference descriptor.
  6924. */
  6925. if (pwszConfDescriptor != NULL)
  6926. {
  6927. ::CopyMemory(memory_pointer, (LPSTR)pwszConfDescriptor, descriptor_unicode_string_length);
  6928. pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_descriptor = (LPWSTR) memory_pointer;
  6929. memory_pointer += descriptor_unicode_string_length;
  6930. }
  6931. else
  6932. {
  6933. // pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_descriptor = NULL;
  6934. }
  6935. /*
  6936. * Retrieve the conference roster data from the roster object.
  6937. * The roster object will serialize any referenced data into
  6938. * the memory block passed in to the "Get" call.
  6939. */
  6940. conference_roster->GetConfRoster(
  6941. &pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_roster,
  6942. memory_pointer);
  6943. pMsgEx->Msg.nConfID = conference_id;
  6944. pMsgEx->Msg.u.conf_roster_inquire_confirm.conference_id = conference_id;
  6945. pMsgEx->Msg.u.conf_roster_inquire_confirm.result = result;
  6946. /*
  6947. * Add the message to the queue for delivery to the application or
  6948. * node controller.
  6949. */
  6950. PostConfirmCtrlSapMsg(pMsgEx);
  6951. rc = GCC_NO_ERROR;
  6952. }
  6953. else
  6954. {
  6955. ERROR_OUT(("CControlSAP::ConfRosterInquireConfirm: can't allocate buffer, size=%u", (UINT) memory_block_size));
  6956. rc = GCC_ALLOCATION_FAILURE;
  6957. }
  6958. /*
  6959. * Unlock the data for the conference roster.
  6960. */
  6961. conference_roster->UnLockConferenceRoster();
  6962. }
  6963. else
  6964. {
  6965. ERROR_OUT(("CControlSAP::ConfRosterInquireConfirm: can't create GCCCtrlSapMsgEx"));
  6966. rc = GCC_ALLOCATION_FAILURE;
  6967. }
  6968. if (rc != GCC_NO_ERROR)
  6969. {
  6970. FreeCtrlSapMsgEx(pMsgEx);
  6971. ASSERT(GCC_ALLOCATION_FAILURE == rc);
  6972. HandleResourceFailure();
  6973. }
  6974. DebugExitINT(CControlSAP::ConfRosterInquireConfirm, rc);
  6975. return (rc);
  6976. }
  6977. /*
  6978. * AppRosterInquireConfirm()
  6979. *
  6980. * Public Function Description
  6981. * This routine is called in order to return a requested list of
  6982. * application rosters to an application or the node controller.
  6983. */
  6984. GCCError CControlSAP::AppRosterInquireConfirm
  6985. (
  6986. GCCConfID conference_id,
  6987. CAppRosterMsg *roster_message,
  6988. GCCResult result,
  6989. GCCAppSapMsgEx **ppAppSapMsgEx
  6990. )
  6991. {
  6992. #ifdef JASPER
  6993. GCCError rc = GCC_NO_ERROR;
  6994. GCCCtrlSapMsgEx *pMsgEx;
  6995. UINT number_of_rosters;
  6996. LPBYTE pBuf = NULL;
  6997. DebugEntry(CControlSAP::AppRosterInquireConfirm);
  6998. ASSERT(NULL == ppAppSapMsgEx);
  6999. /*
  7000. ** Create a new message structure to hold the message to be delivered
  7001. ** to the application or node controller.
  7002. */
  7003. DBG_SAVE_FILE_LINE
  7004. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_APP_ROSTER_INQUIRE_CONFIRM, TRUE)))
  7005. {
  7006. // ::ZeroMemory(&(pMsgEx->Msg.u.app_roster_inquire_confirm), sizeof(pMsgEx->Msg.u.app_roster_inquire_confirm));
  7007. /*
  7008. * Lock the data for the roster message and retrieve the data.
  7009. */
  7010. rc = roster_message->LockApplicationRosterMessage();
  7011. if (rc == GCC_NO_ERROR)
  7012. {
  7013. rc = roster_message->GetAppRosterMsg(&pBuf, &number_of_rosters);
  7014. if (rc == GCC_NO_ERROR)
  7015. {
  7016. /*
  7017. * Retrieve the memory pointer and save it in the list of
  7018. * GCCApplicationRoster pointers.
  7019. */
  7020. pMsgEx->Msg.u.app_roster_inquire_confirm.application_roster_list =
  7021. (PGCCApplicationRoster *) pBuf;
  7022. }
  7023. else
  7024. {
  7025. /*
  7026. * Cleanup after an error.
  7027. */
  7028. roster_message->UnLockApplicationRosterMessage();
  7029. }
  7030. }
  7031. /*
  7032. * If everything is OK up to here, send the message on up.
  7033. */
  7034. if (rc == GCC_NO_ERROR)
  7035. {
  7036. pMsgEx->pToDelete->application_roster_message = roster_message;
  7037. pMsgEx->Msg.u.app_roster_inquire_confirm.conference_id = conference_id;
  7038. pMsgEx->Msg.u.app_roster_inquire_confirm.number_of_rosters = number_of_rosters;
  7039. pMsgEx->Msg.u.app_roster_inquire_confirm.result = result;
  7040. /*
  7041. * Add the message to the queue for delivery to the application
  7042. * or node controller.
  7043. */
  7044. PostConfirmCtrlSapMsg(pMsgEx);
  7045. }
  7046. }
  7047. else
  7048. {
  7049. ERROR_OUT(("CControlSAP::AppRosterInquireConfirm: can't create GCCCtrlSapMsgEx"));
  7050. rc = GCC_ALLOCATION_FAILURE;
  7051. }
  7052. if (rc != GCC_NO_ERROR)
  7053. {
  7054. FreeCtrlSapMsgEx(pMsgEx);
  7055. HandleResourceFailure(rc);
  7056. }
  7057. DebugExitINT(CControlSAP::AppRosterInquireConfirm, rc);
  7058. return (rc);
  7059. #else
  7060. return GCC_NO_ERROR;
  7061. #endif // JASPER
  7062. }
  7063. /*
  7064. * ConductorInquireConfirm ()
  7065. *
  7066. * Public Function Description
  7067. * This routine is called in order to return conductorship information
  7068. * which has been requested.
  7069. *
  7070. */
  7071. GCCError CControlSAP::ConductorInquireConfirm
  7072. (
  7073. GCCNodeID conductor_node_id,
  7074. GCCResult result,
  7075. BOOL permission_flag,
  7076. BOOL conducted_mode,
  7077. GCCConfID conference_id
  7078. )
  7079. {
  7080. #ifdef JASPER
  7081. GCCError rc;
  7082. GCCCtrlSapMsgEx *pMsgEx;
  7083. DebugEntry(CControlSAP::ConductorInquireConfirm);
  7084. /*
  7085. ** Create a new message structure to hold the message to be delivered
  7086. ** to the application or node controller.
  7087. */
  7088. DBG_SAVE_FILE_LINE
  7089. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_INQUIRE_CONFIRM)))
  7090. {
  7091. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_inquire_confirm), sizeof(pMsgEx->Msg.u.conduct_inquire_confirm));
  7092. pMsgEx->Msg.u.conduct_inquire_confirm.conference_id = conference_id;
  7093. pMsgEx->Msg.u.conduct_inquire_confirm.result = result;
  7094. pMsgEx->Msg.u.conduct_inquire_confirm.mode_is_conducted = conducted_mode;
  7095. pMsgEx->Msg.u.conduct_inquire_confirm.conductor_node_id = conductor_node_id;
  7096. pMsgEx->Msg.u.conduct_inquire_confirm.permission_is_granted = permission_flag;
  7097. /*
  7098. * Add the message to the queue for delivery to the application or
  7099. * node controller.
  7100. */
  7101. PostConfirmCtrlSapMsg(pMsgEx);
  7102. rc = GCC_NO_ERROR;
  7103. }
  7104. else
  7105. {
  7106. rc = GCC_ALLOCATION_FAILURE;
  7107. HandleResourceFailure();
  7108. }
  7109. DebugExitINT(CControlSAP::ConductorInquireConfirm, rc);
  7110. return rc;
  7111. #else
  7112. return GCC_NO_ERROR;
  7113. #endif // JASPER
  7114. }
  7115. /*
  7116. * AppInvokeConfirm ()
  7117. *
  7118. * Public Function Description
  7119. * This routine is called in order to confirm a call requesting application
  7120. * invocation.
  7121. */
  7122. GCCError CControlSAP::AppInvokeConfirm
  7123. (
  7124. GCCConfID conference_id,
  7125. CInvokeSpecifierListContainer *invoke_list,
  7126. GCCResult result,
  7127. GCCRequestTag nReqTag
  7128. )
  7129. {
  7130. GCCCtrlSapMsgEx *pMsgEx;
  7131. GCCError rc = GCC_NO_ERROR;
  7132. UINT invoke_list_memory_length;
  7133. DebugEntry(CControlSAP::AppInvokeConfirm);
  7134. /*
  7135. ** Create a new message structure to hold the message to be delivered
  7136. ** to the application or node controller.
  7137. */
  7138. DBG_SAVE_FILE_LINE
  7139. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_APPLICATION_INVOKE_CONFIRM)))
  7140. {
  7141. ::ZeroMemory(&(pMsgEx->Msg.u.application_invoke_confirm), sizeof(pMsgEx->Msg.u.application_invoke_confirm));
  7142. /*
  7143. ** Determine the amount of memory necessary to hold the list of
  7144. ** invoke specifiers and allocate that memory.
  7145. */
  7146. invoke_list_memory_length = invoke_list->LockApplicationInvokeSpecifierList();
  7147. if (invoke_list_memory_length != 0)
  7148. {
  7149. /*
  7150. * If the memory was successfully allocated, get a pointer
  7151. * to the memory and save it in the app_protocol_entity_list
  7152. * pointer of the GCC message. Call the
  7153. * CInvokeSpecifierList object to fill in the
  7154. * list.
  7155. */
  7156. DBG_SAVE_FILE_LINE
  7157. if (NULL != (pMsgEx->pBuf = new BYTE[invoke_list_memory_length]))
  7158. {
  7159. pMsgEx->Msg.u.application_invoke_confirm.app_protocol_entity_list =
  7160. (GCCAppProtocolEntity **) pMsgEx->pBuf;
  7161. invoke_list->GetApplicationInvokeSpecifierList(
  7162. &(pMsgEx->Msg.u.application_invoke_confirm.number_of_app_protocol_entities),
  7163. pMsgEx->pBuf);
  7164. pMsgEx->Msg.u.application_invoke_confirm.conference_id = conference_id;
  7165. pMsgEx->Msg.u.application_invoke_confirm.result = result;
  7166. /*
  7167. * Add the message to the queue for delivery to the application
  7168. * or node controller.
  7169. */
  7170. PostConfirmCtrlSapMsg(pMsgEx);
  7171. rc = GCC_NO_ERROR;
  7172. }
  7173. else
  7174. {
  7175. ERROR_OUT(("CControlSAP::AppInvokeConfirm: can't allocate buffer, size=%u", (UINT) invoke_list_memory_length));
  7176. rc = GCC_ALLOCATION_FAILURE;
  7177. }
  7178. }
  7179. /*
  7180. ** Unlock the data for the invoke specifier list.
  7181. */
  7182. invoke_list->UnLockApplicationInvokeSpecifierList();
  7183. }
  7184. else
  7185. {
  7186. ERROR_OUT(("CControlSAP::AppInvokeConfirm: can't create GCCCtrlSapMsgEx"));
  7187. rc = GCC_ALLOCATION_FAILURE;
  7188. }
  7189. if (rc != GCC_NO_ERROR)
  7190. {
  7191. FreeCtrlSapMsgEx(pMsgEx);
  7192. ASSERT(GCC_ALLOCATION_FAILURE == rc);
  7193. HandleResourceFailure();
  7194. }
  7195. DebugExitINT(CControlSAP::AppInvokeConfirm, rc);
  7196. return rc;
  7197. }
  7198. /*
  7199. * AppInvokeIndication ()
  7200. *
  7201. * Public Function Description
  7202. * This routine is called in order to send an indication to an application
  7203. * or node controller that a request for application invocation has been
  7204. * made.
  7205. */
  7206. GCCError CControlSAP::AppInvokeIndication
  7207. (
  7208. GCCConfID conference_id,
  7209. CInvokeSpecifierListContainer *invoke_list,
  7210. GCCNodeID invoking_node_id
  7211. )
  7212. {
  7213. GCCError rc = GCC_NO_ERROR;
  7214. DebugEntry(CControlSAP::AppInvokeIndication);
  7215. #ifdef GCCNC_DIRECT_INDICATION
  7216. GCCCtrlSapMsg Msg;
  7217. Msg.message_type = GCC_APPLICATION_INVOKE_INDICATION;
  7218. UINT invoke_list_memory_length;
  7219. /*
  7220. ** Determine the amount of memory necessary to hold the list of
  7221. ** invoke specifiers and allocate that memory.
  7222. */
  7223. invoke_list_memory_length = invoke_list->LockApplicationInvokeSpecifierList();
  7224. if (invoke_list_memory_length != 0)
  7225. {
  7226. LPBYTE pBuf;
  7227. /*
  7228. * If the memory was successfully allocated, get a pointer
  7229. * to the memory and save it in the app_protocol_entity_list
  7230. * pointer of the GCC message. Call the
  7231. * CInvokeSpecifierList object to fill in the
  7232. * list.
  7233. */
  7234. DBG_SAVE_FILE_LINE
  7235. if (NULL != (pBuf = new BYTE[invoke_list_memory_length]))
  7236. {
  7237. Msg.u.application_invoke_indication.app_protocol_entity_list = (GCCAppProtocolEntity **) pBuf;
  7238. invoke_list->GetApplicationInvokeSpecifierList(
  7239. &(Msg.u.application_invoke_indication.number_of_app_protocol_entities),
  7240. pBuf);
  7241. Msg.u.application_invoke_indication.conference_id = conference_id;
  7242. Msg.u.application_invoke_indication.invoking_node_id = invoking_node_id;
  7243. SendCtrlSapMsg(&Msg);
  7244. // rc = GCC_NO_ERROR;
  7245. delete [] pBuf;
  7246. }
  7247. else
  7248. {
  7249. ERROR_OUT(("CControlSAP::AppInvokeIndication: can't allocate buffer, size=%u", (UINT) invoke_list_memory_length));
  7250. rc = GCC_ALLOCATION_FAILURE;
  7251. }
  7252. }
  7253. /*
  7254. ** Unlock the data for the invoke specifier list.
  7255. */
  7256. invoke_list->UnLockApplicationInvokeSpecifierList ();
  7257. #else
  7258. GCCCtrlSapMsgEx *pMsgEx;
  7259. UINT invoke_list_memory_length;
  7260. /*
  7261. ** Create a new message structure to hold the message to be delivered
  7262. ** to the application or node controller.
  7263. */
  7264. DBG_SAVE_FILE_LINE
  7265. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_APPLICATION_INVOKE_INDICATION)))
  7266. {
  7267. ::ZeroMemory(&(pMsgEx->Msg.u.application_invoke_indication), sizeof(pMsgEx->Msg.u.application_invoke_indication));
  7268. /*
  7269. ** Determine the amount of memory necessary to hold the list of
  7270. ** invoke specifiers and allocate that memory.
  7271. */
  7272. invoke_list_memory_length = invoke_list->LockApplicationInvokeSpecifierList();
  7273. if (invoke_list_memory_length != 0)
  7274. {
  7275. /*
  7276. * If the memory was successfully allocated, get a pointer
  7277. * to the memory and save it in the app_protocol_entity_list
  7278. * pointer of the GCC message. Call the
  7279. * CInvokeSpecifierList object to fill in the
  7280. * list.
  7281. */
  7282. DBG_SAVE_FILE_LINE
  7283. if (NULL != (pMsgEx->pBuf = new BYTE[invoke_list_memory_length]))
  7284. {
  7285. pMsgEx->Msg.u.application_invoke_indication.app_protocol_entity_list =
  7286. (GCCAppProtocolEntity **) pMsgEx->pBuf;
  7287. invoke_list->GetApplicationInvokeSpecifierList(
  7288. &(pMsgEx->Msg.u.application_invoke_indication.number_of_app_protocol_entities),
  7289. pMsgEx->pBuf);
  7290. pMsgEx->Msg.u.application_invoke_indication.conference_id = conference_id;
  7291. pMsgEx->Msg.u.application_invoke_indication.invoking_node_id = invoking_node_id;
  7292. PostIndCtrlSapMsg(pMsgEx);
  7293. rc = GCC_NO_ERROR;
  7294. }
  7295. else
  7296. {
  7297. ERROR_OUT(("CControlSAP::AppInvokeIndication: can't allocate buffer, size=%u", (UINT) invoke_list_memory_length));
  7298. rc = GCC_ALLOCATION_FAILURE;
  7299. }
  7300. }
  7301. /*
  7302. ** Unlock the data for the invoke specifier list.
  7303. */
  7304. invoke_list->UnLockApplicationInvokeSpecifierList ();
  7305. }
  7306. else
  7307. {
  7308. ERROR_OUT(("CControlSAP::AppInvokeIndication: can't create GCCCtrlSapMsgEx"));
  7309. rc = GCC_ALLOCATION_FAILURE;
  7310. }
  7311. if (rc != GCC_NO_ERROR)
  7312. {
  7313. FreeCtrlSapMsgEx(pMsgEx);
  7314. ASSERT(GCC_ALLOCATION_FAILURE == rc);
  7315. HandleResourceFailure();
  7316. }
  7317. #endif // GCCNC_DIRECT_INDICATION
  7318. DebugExitINT(CControlSAP::AppInvokeIndication, rc);
  7319. return rc;
  7320. }
  7321. /*
  7322. * ConfRosterReportIndication ()
  7323. *
  7324. * Public Function Description
  7325. * This routine is called in order to indicate to applications and the
  7326. * node controller that the conference roster has been updated.
  7327. */
  7328. GCCError CControlSAP::ConfRosterReportIndication
  7329. (
  7330. GCCConfID conference_id,
  7331. CConfRosterMsg *roster_message
  7332. )
  7333. {
  7334. GCCError rc = GCC_NO_ERROR;
  7335. DebugEntry(CControlSAP::ConfRosterReportIndication);
  7336. #ifdef GCCNC_DIRECT_INDICATION
  7337. GCCCtrlSapMsg Msg;
  7338. Msg.message_type = GCC_ROSTER_REPORT_INDICATION;
  7339. /*
  7340. * Lock the conference roster message in order to force the object
  7341. * to serialize the data into its internal memory.
  7342. */
  7343. rc = roster_message->LockConferenceRosterMessage();
  7344. if (rc == GCC_NO_ERROR)
  7345. {
  7346. LPBYTE pBuf = NULL;
  7347. /*
  7348. * Retrieve the actual pointer to memory object that the
  7349. * serialized conference roster is contained in from the
  7350. * conference roster message.
  7351. */
  7352. rc = roster_message->GetConferenceRosterMessage(&pBuf);
  7353. if (rc == GCC_NO_ERROR)
  7354. {
  7355. Msg.nConfID = conference_id;
  7356. Msg.u.conf_roster_report_indication.conference_id = conference_id;
  7357. Msg.u.conf_roster_report_indication.conference_roster = (PGCCConferenceRoster) pBuf;
  7358. SendCtrlSapMsg(&Msg);
  7359. }
  7360. else
  7361. {
  7362. ERROR_OUT(("CControlSAP::ConfRosterReportIndication: can't get conf roster message"));
  7363. }
  7364. roster_message->UnLockConferenceRosterMessage();
  7365. }
  7366. else
  7367. {
  7368. ERROR_OUT(("CControlSAP::ConfRosterReportIndication: can't lock conf roster message"));
  7369. }
  7370. #else
  7371. GCCCtrlSapMsgEx *pMsgEx;
  7372. /*
  7373. ** Create a new message structure to hold the message to be delivered
  7374. ** to the application or node controller.
  7375. */
  7376. DBG_SAVE_FILE_LINE
  7377. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_ROSTER_REPORT_INDICATION, TRUE)))
  7378. {
  7379. // ::ZeroMemory(&(pMsgEx->Msg.u.conf_roster_report_indication), sizeof(pMsgEx->Msg.u.conf_roster_report_indication));
  7380. /*
  7381. * Lock the conference roster message in order to force the object
  7382. * to serialize the data into its internal memory.
  7383. */
  7384. rc = roster_message->LockConferenceRosterMessage();
  7385. if (rc == GCC_NO_ERROR)
  7386. {
  7387. LPBYTE pBuf = NULL;
  7388. /*
  7389. * Retrieve the actual pointer to memory object that the
  7390. * serialized conference roster is contained in from the
  7391. * conference roster message.
  7392. */
  7393. rc = roster_message->GetConferenceRosterMessage(&pBuf);
  7394. if (rc == GCC_NO_ERROR)
  7395. {
  7396. pMsgEx->Msg.u.conf_roster_report_indication.conference_roster =
  7397. (PGCCConferenceRoster) pBuf;
  7398. /*
  7399. * Fill in the roster's conference ID and then queue up the
  7400. * message.
  7401. */
  7402. pMsgEx->Msg.nConfID = conference_id;
  7403. pMsgEx->Msg.u.conf_roster_report_indication.conference_id = conference_id;
  7404. pMsgEx->pToDelete->conference_roster_message = roster_message;
  7405. PostIndCtrlSapMsg(pMsgEx);
  7406. }
  7407. else
  7408. {
  7409. ERROR_OUT(("CControlSAP::ConfRosterReportIndication: can't get conf roster message"));
  7410. }
  7411. }
  7412. else
  7413. {
  7414. ERROR_OUT(("CControlSAP::ConfRosterReportIndication: can't lock conf roster message"));
  7415. }
  7416. }
  7417. else
  7418. {
  7419. ERROR_OUT(("CControlSAP::ConfRosterReportIndication: can't create GCCCtrlSapMsgEx"));
  7420. rc = GCC_ALLOCATION_FAILURE;
  7421. }
  7422. if (rc != GCC_NO_ERROR)
  7423. {
  7424. FreeCtrlSapMsgEx(pMsgEx);
  7425. HandleResourceFailure(rc);
  7426. }
  7427. #endif // GCCNC_DIRECT_INDICATION
  7428. DebugExitINT(CControlSAP::ConfRosterReportIndication, rc);
  7429. return rc;
  7430. }
  7431. /*
  7432. * AppRosterReportIndication()
  7433. *
  7434. * Public Function Description
  7435. * This routine is called in order to indicate to applications and the
  7436. * node controller that the list of application rosters has been updated.
  7437. */
  7438. GCCError CControlSAP::AppRosterReportIndication
  7439. (
  7440. GCCConfID conference_id,
  7441. CAppRosterMsg *roster_message
  7442. )
  7443. {
  7444. GCCError rc = GCC_NO_ERROR;
  7445. DebugEntry(CControlSAP::AppRosterReportIndication);
  7446. #ifdef GCCNC_DIRECT_INDICATION
  7447. GCCCtrlSapMsg Msg;
  7448. Msg.message_type = GCC_APP_ROSTER_REPORT_INDICATION;
  7449. /*
  7450. * Determine the amount of memory needed to hold the list of
  7451. * application rosters and allocate that memory.
  7452. */
  7453. rc = roster_message->LockApplicationRosterMessage();
  7454. if (rc == GCC_NO_ERROR)
  7455. {
  7456. LPBYTE pBuf = NULL;
  7457. ULONG cRosters;
  7458. rc = roster_message->GetAppRosterMsg(&pBuf, &cRosters);
  7459. if (rc == GCC_NO_ERROR)
  7460. {
  7461. Msg.u.app_roster_report_indication.conference_id = conference_id;
  7462. Msg.u.app_roster_report_indication.application_roster_list = (PGCCApplicationRoster *) pBuf;
  7463. Msg.u.app_roster_report_indication.number_of_rosters = cRosters;
  7464. SendCtrlSapMsg(&Msg);
  7465. }
  7466. else
  7467. {
  7468. ERROR_OUT(("CControlSAP: AppRosterReportIndication: GetAppRosterMsg failed"));
  7469. }
  7470. roster_message->UnLockApplicationRosterMessage();
  7471. }
  7472. else
  7473. {
  7474. ERROR_OUT(("CControlSAP: AppRosterReportIndication: LockApplicationRosterMessage failed"));
  7475. }
  7476. #else
  7477. GCCCtrlSapMsgEx *pMsgEx;
  7478. LPBYTE pBuf = NULL;
  7479. UINT cRosters;
  7480. /*
  7481. ** Create a new message structure to hold the message to be delivered
  7482. ** to the application or node controller.
  7483. */
  7484. DBG_SAVE_FILE_LINE
  7485. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_APP_ROSTER_REPORT_INDICATION, TRUE)))
  7486. {
  7487. // ::ZeroMemory(&(pMsgEx->Msg.u.app_roster_report_indication), sizeof(pMsgEx->Msg.u.app_roster_report_indication));
  7488. /*
  7489. * Determine the amount of memory needed to hold the list of
  7490. * application rosters and allocate that memory.
  7491. */
  7492. rc = roster_message->LockApplicationRosterMessage();
  7493. if (rc == GCC_NO_ERROR)
  7494. {
  7495. rc = roster_message->GetAppRosterMsg(&pBuf, &cRosters);
  7496. if (rc == GCC_NO_ERROR)
  7497. {
  7498. /*
  7499. * Save it in the list of GCCApplicationRoster pointers.
  7500. */
  7501. pMsgEx->Msg.u.app_roster_report_indication.application_roster_list =
  7502. (PGCCApplicationRoster *) pBuf;
  7503. }
  7504. else
  7505. {
  7506. /*
  7507. * Cleanup after an error.
  7508. */
  7509. ERROR_OUT(("CControlSAP: AppRosterReportIndication: GetAppRosterMsg failed"));
  7510. roster_message->UnLockApplicationRosterMessage();
  7511. }
  7512. }
  7513. else
  7514. {
  7515. ERROR_OUT(("CControlSAP: AppRosterReportIndication: LockApplicationRosterMessage failed"));
  7516. }
  7517. /*
  7518. * If everything is OK up to here, send the message on up.
  7519. */
  7520. if (rc == GCC_NO_ERROR)
  7521. {
  7522. pMsgEx->Msg.u.app_roster_report_indication.conference_id = conference_id;
  7523. pMsgEx->Msg.u.app_roster_report_indication.number_of_rosters = cRosters;
  7524. pMsgEx->pToDelete->application_roster_message = roster_message;
  7525. /*
  7526. * Add the message to the queue for delivery to the application
  7527. * or node controller.
  7528. */
  7529. PostIndCtrlSapMsg(pMsgEx);
  7530. }
  7531. }
  7532. else
  7533. {
  7534. ERROR_OUT(("CControlSAP: AppRosterReportIndication: Failed to allocate a GCC message"));
  7535. rc = GCC_ALLOCATION_FAILURE;
  7536. }
  7537. if (rc != GCC_NO_ERROR)
  7538. {
  7539. FreeCtrlSapMsgEx(pMsgEx);
  7540. HandleResourceFailure(rc);
  7541. }
  7542. #endif // GCCNC_DIRECT_INDICATION
  7543. DebugExitINT(CControlSAP::AppRosterReportIndication, rc);
  7544. return rc;
  7545. }
  7546. /* ------ from CBaseSap ------ */
  7547. /*
  7548. * ConductorAssignIndication ()
  7549. *
  7550. * Public Function Description
  7551. * This routine is called in order to send an indication to an application
  7552. * or node controller that a request has been made to assign conductorship.
  7553. */
  7554. GCCError CControlSAP::ConductorAssignIndication
  7555. (
  7556. UserID conductor_node_id,
  7557. GCCConfID conference_id
  7558. )
  7559. {
  7560. #ifdef JASPER
  7561. GCCError rc;
  7562. DebugEntry(CControlSAP::ConductorAssignIndication);
  7563. #ifdef GCCNC_DIRECT_INDICATION
  7564. GCCCtrlSapMsg Msg;
  7565. Msg.message_type = GCC_CONDUCT_ASSIGN_INDICATION;
  7566. Msg.u.conduct_assign_indication.conference_id = conference_id;
  7567. Msg.u.conduct_assign_indication.node_id = conductor_node_id;
  7568. SendCtrlSapMsg(&Msg);
  7569. rc = GCC_NO_ERROR;
  7570. #else
  7571. GCCCtrlSapMsgEx *pMsgEx;
  7572. /*
  7573. ** Create a new message structure to hold the message to be delivered
  7574. ** to the application or node controller.
  7575. */
  7576. DBG_SAVE_FILE_LINE
  7577. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_ASSIGN_INDICATION)))
  7578. {
  7579. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_assign_indication), sizeof(pMsgEx->Msg.u.conduct_assign_indication));
  7580. pMsgEx->Msg.u.conduct_assign_indication.conference_id = conference_id;
  7581. pMsgEx->Msg.u.conduct_assign_indication.node_id = conductor_node_id;
  7582. /*
  7583. * Add the message to the queue for delivery to the application or
  7584. * node controller.
  7585. */
  7586. PostIndCtrlSapMsg(pMsgEx);
  7587. rc = GCC_NO_ERROR;
  7588. }
  7589. else
  7590. {
  7591. rc = GCC_ALLOCATION_FAILURE;
  7592. HandleResourceFailure();
  7593. }
  7594. #endif // GCCNC_DIRECT_INDICATION
  7595. DebugExitINT(CControlSAP::ConductorAssignIndication, rc);
  7596. return rc;
  7597. #else
  7598. return GCC_NO_ERROR;
  7599. #endif // JASPER
  7600. }
  7601. /*
  7602. * ConductorReleaseIndication ()
  7603. *
  7604. * Public Function Description
  7605. * This routine is called in order to send an indication to an application
  7606. * or node controller that a request for releasing conductorship has been
  7607. * made.
  7608. */
  7609. GCCError CControlSAP::
  7610. ConductorReleaseIndication ( GCCConfID conference_id )
  7611. {
  7612. #ifdef JASPER
  7613. GCCError rc;
  7614. DebugEntry(CControlSAP::ConductorReleaseIndication);
  7615. #ifdef GCCNC_DIRECT_INDICATION
  7616. GCCCtrlSapMsg Msg;
  7617. Msg.message_type = GCC_CONDUCT_RELEASE_INDICATION;
  7618. Msg.u.conduct_release_indication.conference_id = conference_id;
  7619. SendCtrlSapMsg(&Msg);
  7620. rc = GCC_NO_ERROR;
  7621. #else
  7622. GCCCtrlSapMsgEx *pMsgEx;
  7623. /*
  7624. ** Create a new message structure to hold the message to be delivered
  7625. ** to the application or node controller.
  7626. */
  7627. DBG_SAVE_FILE_LINE
  7628. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_RELEASE_INDICATION)))
  7629. {
  7630. // ::ZeroMemory(&(pMsgEx->Msg.u.conduct_release_indication), sizeof(pMsgEx->Msg.u.conduct_release_indication));
  7631. pMsgEx->Msg.u.conduct_release_indication.conference_id = conference_id;
  7632. /*
  7633. * Add the message to the queue for delivery to the application or
  7634. * node controller.
  7635. */
  7636. PostIndCtrlSapMsg(pMsgEx);
  7637. rc = GCC_NO_ERROR;
  7638. }
  7639. else
  7640. {
  7641. rc = GCC_ALLOCATION_FAILURE;
  7642. HandleResourceFailure();
  7643. }
  7644. #endif // GCCNC_DIRECT_INDICATION
  7645. DebugExitINT(CControlSAP::ConductorReleaseIndication, rc);
  7646. return rc;
  7647. #else
  7648. return GCC_NO_ERROR;
  7649. #endif // JASPER
  7650. }
  7651. /*
  7652. * ConductorPermitGrantIndication ()
  7653. *
  7654. * Public Function Description
  7655. * This routine is called in order to send an indication to an application
  7656. * or node controller that a request for permission from the conductor
  7657. * has been made.
  7658. */
  7659. GCCError CControlSAP::ConductorPermitGrantIndication
  7660. (
  7661. GCCConfID conference_id,
  7662. UINT number_granted,
  7663. GCCNodeID *granted_node_list,
  7664. UINT number_waiting,
  7665. GCCNodeID *waiting_node_list,
  7666. BOOL permission_is_granted
  7667. )
  7668. {
  7669. #ifdef JASPER
  7670. GCCError rc = GCC_NO_ERROR;
  7671. DebugEntry(CControlSAP::ConductorPermitGrantIndication);
  7672. #ifdef GCCNC_DIRECT_INDICATION
  7673. GCCCtrlSapMsg Msg;
  7674. Msg.message_type = GCC_CONDUCT_GRANT_INDICATION;
  7675. Msg.u.conduct_permit_grant_indication.conference_id = conference_id;
  7676. Msg.u.conduct_permit_grant_indication.number_granted = number_granted;
  7677. Msg.u.conduct_permit_grant_indication.granted_node_list = granted_node_list;
  7678. Msg.u.conduct_permit_grant_indication.number_waiting = number_waiting;
  7679. Msg.u.conduct_permit_grant_indication.waiting_node_list = waiting_node_list;
  7680. Msg.u.conduct_permit_grant_indication.permission_is_granted = permission_is_granted;
  7681. SendCtrlSapMsg(&Msg);
  7682. #else
  7683. GCCCtrlSapMsgEx *pMsgEx;
  7684. int bulk_memory_size;
  7685. LPBYTE memory_pointer;
  7686. UINT i;
  7687. /*
  7688. ** Create a new message structure to hold the message to be delivered
  7689. ** to the application or node controller.
  7690. */
  7691. DBG_SAVE_FILE_LINE
  7692. if (NULL != (pMsgEx = CreateCtrlSapMsgEx(GCC_CONDUCT_GRANT_INDICATION)))
  7693. {
  7694. ::ZeroMemory(&(pMsgEx->Msg.u.conduct_permit_grant_indication), sizeof(pMsgEx->Msg.u.conduct_permit_grant_indication));
  7695. /*
  7696. ** Here we determine if bulk memory is necessary.
  7697. */
  7698. if ((number_granted != 0) || (number_waiting != 0))
  7699. {
  7700. /*
  7701. ** We must first determine how big the bulk memory block will be
  7702. ** and allocate that memory.
  7703. */
  7704. bulk_memory_size = (ROUNDTOBOUNDARY(sizeof(UserID)) * number_granted) +
  7705. (ROUNDTOBOUNDARY(sizeof(UserID)) * number_waiting);
  7706. DBG_SAVE_FILE_LINE
  7707. if (NULL != (pMsgEx->pBuf = new BYTE[bulk_memory_size]))
  7708. {
  7709. memory_pointer = pMsgEx->pBuf;
  7710. }
  7711. else
  7712. {
  7713. ERROR_OUT(("CControlSAP::ConductorPermitGrantIndication: can't allocate buffer, size=%u", (UINT) bulk_memory_size));
  7714. rc = GCC_ALLOCATION_FAILURE;
  7715. }
  7716. }
  7717. if (rc == GCC_NO_ERROR)
  7718. {
  7719. /*
  7720. ** If there are any nodes in the permission list copy them over.
  7721. */
  7722. if (number_granted != 0)
  7723. {
  7724. TRACE_OUT(("CControlSAP::ConductorPermitGrantIndication:"
  7725. " number_granted = %d", number_granted));
  7726. pMsgEx->Msg.u.conduct_permit_grant_indication.
  7727. granted_node_list = (PUserID)memory_pointer;
  7728. for (i = 0; i < number_granted; i++)
  7729. {
  7730. pMsgEx->Msg.u.conduct_permit_grant_indication.
  7731. granted_node_list[i] = granted_node_list[i];
  7732. }
  7733. memory_pointer += ROUNDTOBOUNDARY(sizeof(UserID)) * number_granted;
  7734. }
  7735. else
  7736. {
  7737. // pMsgEx->Msg.u.conduct_permit_grant_indication.granted_node_list = NULL;
  7738. }
  7739. /*
  7740. ** If there are any nodes in the waiting list copy them over.
  7741. */
  7742. if (number_waiting != 0)
  7743. {
  7744. TRACE_OUT(("CControlSAP::ConductorPermitGrantIndication:"
  7745. " number_waiting = %d", number_waiting));
  7746. pMsgEx->Msg.u.conduct_permit_grant_indication.
  7747. waiting_node_list = (PUserID)memory_pointer;
  7748. for (i = 0; i < number_waiting; i++)
  7749. {
  7750. pMsgEx->Msg.u.conduct_permit_grant_indication.
  7751. waiting_node_list[i] = waiting_node_list[i];
  7752. }
  7753. }
  7754. else
  7755. {
  7756. // pMsgEx->Msg.u.conduct_permit_grant_indication.waiting_node_list = NULL;
  7757. }
  7758. pMsgEx->Msg.u.conduct_permit_grant_indication.conference_id = conference_id;
  7759. pMsgEx->Msg.u.conduct_permit_grant_indication.number_granted = number_granted;
  7760. pMsgEx->Msg.u.conduct_permit_grant_indication.number_waiting = number_waiting;
  7761. pMsgEx->Msg.u.conduct_permit_grant_indication.permission_is_granted = permission_is_granted;
  7762. /*
  7763. * Add the message to the queue for delivery to the application or
  7764. * node controller.
  7765. */
  7766. PostIndCtrlSapMsg(pMsgEx);
  7767. }
  7768. }
  7769. else
  7770. {
  7771. ERROR_OUT(("CControlSAP::ConductorPermitGrantIndication: can't create GCCCtrlSapMsgEx"));
  7772. rc = GCC_ALLOCATION_FAILURE;
  7773. }
  7774. if (rc != GCC_NO_ERROR)
  7775. {
  7776. FreeCtrlSapMsgEx(pMsgEx);
  7777. ASSERT(GCC_ALLOCATION_FAILURE == rc);
  7778. HandleResourceFailure();
  7779. }
  7780. #endif // GCCNC_DIRECT_INDICATION
  7781. DebugExitINT(CControlSAP::ConductorPermitGrantIndication, rc);
  7782. return (rc);
  7783. #else
  7784. return GCC_NO_ERROR;
  7785. #endif // JASPER
  7786. }
  7787. GCCError CControlSAP::AppletInvokeRequest
  7788. (
  7789. GCCConfID nConfID,
  7790. UINT number_of_app_protcol_entities,
  7791. GCCAppProtocolEntity **app_protocol_entity_list,
  7792. UINT number_of_destination_nodes,
  7793. UserID *list_of_destination_nodes
  7794. )
  7795. {
  7796. GCCAppProtEntityList ApeList;
  7797. GCCSimpleNodeList NodeList;
  7798. GCCRequestTag nReqTag;
  7799. ApeList.cApes = number_of_app_protcol_entities;
  7800. ApeList.apApes = app_protocol_entity_list;
  7801. NodeList.cNodes = number_of_destination_nodes;
  7802. NodeList.aNodeIDs = list_of_destination_nodes;
  7803. return CBaseSap::AppInvoke(nConfID, &ApeList, &NodeList, &nReqTag);
  7804. }
  7805. GCCError CControlSAP::ConfRosterInqRequest
  7806. (
  7807. GCCConfID nConfID
  7808. )
  7809. {
  7810. return CBaseSap::ConfRosterInquire(nConfID, NULL);
  7811. }
  7812. #ifdef JASPER
  7813. GCCError CControlSAP::ConductorInquireRequest
  7814. (
  7815. GCCConfID nConfID
  7816. )
  7817. {
  7818. return CBaseSap::ConductorInquire(nConfID);
  7819. }
  7820. #endif // JASPER
  7821. //
  7822. // LONCHANC: The following SAP_*** stuff are all app sap related
  7823. // because FreeCallbackMessage() in CControlSAP does not handle
  7824. // the DataToBeDeleted stuff.
  7825. //
  7826. /*
  7827. * void CopyDataToGCCMessage(
  7828. * SapCopyType copy_type,
  7829. * PDataToBeDeleted data_to_be_deleted,
  7830. * LPVOID source_ptr,
  7831. * LPVOID destination_ptr,
  7832. * PGCCError rc)
  7833. *
  7834. * Protected member function of CControlSAP.
  7835. *
  7836. * Function Description:
  7837. * This routine is used to fill in the various components of the message
  7838. * structures to be delivered to applications or the node controller.
  7839. *
  7840. * Formal Parameters:
  7841. * copy_type (i) Enumerated type indicating what field is to be
  7842. * copied.
  7843. * data_to_be_deleted (o) Structure to hold part of the data to be
  7844. * delivered in the message.
  7845. * source_ptr (i) Pointer to structure to copy from.
  7846. * destination_ptr (o) Pointer to structure to copy into.
  7847. * rc (o) Return value for routine.
  7848. *
  7849. * Return Value:
  7850. * None.
  7851. *
  7852. * Side Effects:
  7853. * None.
  7854. *
  7855. * Caveats:
  7856. * The return value should be setup before it is passed into this
  7857. * routine. This allows the error checking to be done in one place
  7858. * (this routine).
  7859. */
  7860. void CSAP_CopyDataToGCCMessage_ConfName
  7861. (
  7862. PDataToBeDeleted data_to_be_deleted,
  7863. PGCCConferenceName source_conference_name,
  7864. PGCCConferenceName destination_conference_name,
  7865. PGCCError pRetCode
  7866. )
  7867. {
  7868. if (GCC_NO_ERROR == *pRetCode)
  7869. {
  7870. LPSTR pszNumeric;
  7871. LPWSTR pwszText;
  7872. if (source_conference_name != NULL)
  7873. {
  7874. if (source_conference_name->numeric_string != NULL)
  7875. {
  7876. /*
  7877. * First copy the numeric conference name if one exists.
  7878. */
  7879. if (NULL != (pszNumeric = ::My_strdupA(source_conference_name->numeric_string)))
  7880. {
  7881. destination_conference_name->numeric_string = (GCCNumericString) pszNumeric;
  7882. data_to_be_deleted->pszNumericConfName = pszNumeric;
  7883. }
  7884. else
  7885. {
  7886. *pRetCode = GCC_ALLOCATION_FAILURE;
  7887. }
  7888. }
  7889. else
  7890. {
  7891. // destination_conference_name->numeric_string = NULL;
  7892. }
  7893. /*
  7894. * Next copy the text conference name if one exists.
  7895. */
  7896. if ((source_conference_name->text_string != NULL) &&
  7897. (*pRetCode == GCC_NO_ERROR))
  7898. {
  7899. if (NULL != (pwszText = ::My_strdupW(source_conference_name->text_string)))
  7900. {
  7901. destination_conference_name->text_string = pwszText;
  7902. data_to_be_deleted->pwszTextConfName = pwszText;
  7903. }
  7904. else
  7905. {
  7906. *pRetCode = GCC_ALLOCATION_FAILURE;
  7907. }
  7908. }
  7909. else
  7910. {
  7911. // destination_conference_name->text_string = NULL;
  7912. }
  7913. }
  7914. else
  7915. {
  7916. // destination_conference_name->numeric_string = NULL;
  7917. // destination_conference_name->text_string = NULL;
  7918. }
  7919. ASSERT(GCC_NO_ERROR == *pRetCode);
  7920. }
  7921. }
  7922. void CSAP_CopyDataToGCCMessage_Modifier
  7923. (
  7924. BOOL fRemoteModifier,
  7925. PDataToBeDeleted data_to_be_deleted,
  7926. GCCNumericString source_numeric_string,
  7927. GCCNumericString *destination_numeric_string,
  7928. PGCCError pRetCode
  7929. )
  7930. {
  7931. if (GCC_NO_ERROR == *pRetCode)
  7932. {
  7933. LPSTR numeric_ptr;
  7934. if (source_numeric_string != NULL)
  7935. {
  7936. if (NULL != (numeric_ptr = ::My_strdupA(source_numeric_string)))
  7937. {
  7938. *destination_numeric_string = (GCCNumericString) numeric_ptr;
  7939. if (fRemoteModifier)
  7940. {
  7941. data_to_be_deleted->pszRemoteModifier = numeric_ptr;
  7942. }
  7943. else
  7944. {
  7945. data_to_be_deleted->pszConfNameModifier = numeric_ptr;
  7946. }
  7947. TRACE_OUT(("CopyDataToGCCMessage_Modifier: modifier = %s", *destination_numeric_string));
  7948. }
  7949. else
  7950. {
  7951. // *destination_numeric_string = NULL;
  7952. *pRetCode = GCC_ALLOCATION_FAILURE;
  7953. }
  7954. }
  7955. else
  7956. {
  7957. // *destination_numeric_string = NULL;
  7958. }
  7959. ASSERT(GCC_NO_ERROR == *pRetCode);
  7960. }
  7961. }
  7962. void CSAP_CopyDataToGCCMessage_Password
  7963. (
  7964. BOOL fConvener,
  7965. PDataToBeDeleted data_to_be_deleted,
  7966. CPassword *source_password,
  7967. PGCCPassword *destination_password,
  7968. PGCCError pRetCode
  7969. )
  7970. {
  7971. if (GCC_NO_ERROR == *pRetCode)
  7972. {
  7973. if (source_password != NULL)
  7974. {
  7975. source_password->LockPasswordData();
  7976. source_password->GetPasswordData (destination_password);
  7977. if (fConvener)
  7978. {
  7979. data_to_be_deleted->convener_password = source_password;
  7980. }
  7981. else
  7982. {
  7983. data_to_be_deleted->password = source_password;
  7984. }
  7985. }
  7986. else
  7987. {
  7988. // *destination_password = NULL;
  7989. }
  7990. ASSERT(GCC_NO_ERROR == *pRetCode);
  7991. }
  7992. }
  7993. void CSAP_CopyDataToGCCMessage_Challenge
  7994. (
  7995. PDataToBeDeleted data_to_be_deleted,
  7996. CPassword *source_password,
  7997. PGCCChallengeRequestResponse *password_challenge,
  7998. PGCCError pRetCode
  7999. )
  8000. {
  8001. if (GCC_NO_ERROR == *pRetCode)
  8002. {
  8003. if (source_password != NULL)
  8004. {
  8005. source_password->LockPasswordData();
  8006. source_password->GetPasswordChallengeData (password_challenge);
  8007. data_to_be_deleted->password = source_password;
  8008. }
  8009. else
  8010. {
  8011. // *password_challenge = NULL;
  8012. }
  8013. ASSERT(GCC_NO_ERROR == *pRetCode);
  8014. }
  8015. }
  8016. void CSAP_CopyDataToGCCMessage_PrivilegeList
  8017. (
  8018. PPrivilegeListData source_privilege_list_data,
  8019. PGCCConferencePrivileges *destination_privilege_list,
  8020. PGCCError pRetCode
  8021. )
  8022. {
  8023. if (GCC_NO_ERROR == *pRetCode)
  8024. {
  8025. if (source_privilege_list_data != NULL)
  8026. {
  8027. DBG_SAVE_FILE_LINE
  8028. if (NULL != (*destination_privilege_list = new GCCConferencePrivileges))
  8029. {
  8030. **destination_privilege_list =
  8031. *(source_privilege_list_data->GetPrivilegeListData());
  8032. }
  8033. else
  8034. {
  8035. *pRetCode = GCC_ALLOCATION_FAILURE;
  8036. }
  8037. }
  8038. else
  8039. {
  8040. // *destination_privilege_list = NULL;
  8041. }
  8042. ASSERT(GCC_NO_ERROR == *pRetCode);
  8043. }
  8044. }
  8045. void CSAP_CopyDataToGCCMessage_IDvsDesc
  8046. (
  8047. BOOL fCallerID,
  8048. PDataToBeDeleted data_to_be_deleted,
  8049. LPWSTR source_text_string,
  8050. LPWSTR *destination_text_string,
  8051. PGCCError pRetCode
  8052. )
  8053. {
  8054. if (GCC_NO_ERROR == *pRetCode)
  8055. {
  8056. if (source_text_string != NULL)
  8057. {
  8058. if (NULL != (*destination_text_string = ::My_strdupW(source_text_string)))
  8059. {
  8060. if (fCallerID)
  8061. {
  8062. data_to_be_deleted->pwszCallerID = *destination_text_string;
  8063. }
  8064. else
  8065. {
  8066. data_to_be_deleted->pwszConfDescriptor = *destination_text_string;
  8067. }
  8068. }
  8069. else
  8070. {
  8071. *pRetCode = GCC_ALLOCATION_FAILURE;
  8072. }
  8073. }
  8074. else
  8075. {
  8076. // *destination_text_string = NULL;
  8077. }
  8078. ASSERT(GCC_NO_ERROR == *pRetCode);
  8079. }
  8080. }
  8081. //
  8082. // LONCHANC: TransportAddress is defined as LPSTR (i.e. char *)
  8083. //
  8084. void CSAP_CopyDataToGCCMessage_Call
  8085. (
  8086. BOOL fCalling,
  8087. PDataToBeDeleted data_to_be_deleted,
  8088. TransportAddress source_transport_address,
  8089. TransportAddress *destination_transport_address,
  8090. PGCCError pRetCode
  8091. )
  8092. {
  8093. if (GCC_NO_ERROR == *pRetCode)
  8094. {
  8095. if (source_transport_address != NULL)
  8096. {
  8097. if (NULL != (*destination_transport_address = ::My_strdupA(source_transport_address)))
  8098. {
  8099. if (fCalling)
  8100. {
  8101. data_to_be_deleted->pszCallingAddress = *destination_transport_address ;
  8102. }
  8103. else
  8104. {
  8105. data_to_be_deleted->pszCalledAddress = *destination_transport_address ;
  8106. }
  8107. }
  8108. else
  8109. {
  8110. *pRetCode = GCC_ALLOCATION_FAILURE;
  8111. }
  8112. }
  8113. else
  8114. {
  8115. // *destination_transport_address = NULL;
  8116. }
  8117. ASSERT(GCC_NO_ERROR == *pRetCode);
  8118. }
  8119. }
  8120. void CSAP_CopyDataToGCCMessage_DomainParams
  8121. (
  8122. PDataToBeDeleted data_to_be_deleted,
  8123. PDomainParameters source_domain_parameters,
  8124. PDomainParameters *destination_domain_parameters,
  8125. PGCCError pRetCode
  8126. )
  8127. {
  8128. if (GCC_NO_ERROR == *pRetCode)
  8129. {
  8130. if (source_domain_parameters != NULL)
  8131. {
  8132. DBG_SAVE_FILE_LINE
  8133. if (NULL != (*destination_domain_parameters = new DomainParameters))
  8134. {
  8135. **destination_domain_parameters = *source_domain_parameters;
  8136. data_to_be_deleted->pDomainParams = *destination_domain_parameters;
  8137. }
  8138. else
  8139. {
  8140. *pRetCode = GCC_ALLOCATION_FAILURE;
  8141. }
  8142. }
  8143. else
  8144. {
  8145. // *destination_domain_parameters = NULL;
  8146. }
  8147. ASSERT(GCC_NO_ERROR == *pRetCode);
  8148. }
  8149. }
  8150. void CControlSAP::NotifyProc ( GCCCtrlSapMsgEx *pCtrlSapMsgEx )
  8151. {
  8152. if (NULL != m_pfnNCCallback)
  8153. {
  8154. pCtrlSapMsgEx->Msg.user_defined = m_pNCData;
  8155. (*m_pfnNCCallback)(&(pCtrlSapMsgEx->Msg));
  8156. }
  8157. //
  8158. // Free this callback message.
  8159. //
  8160. FreeCtrlSapMsgEx(pCtrlSapMsgEx);
  8161. }
  8162. void CControlSAP::WndMsgHandler
  8163. (
  8164. UINT uMsg,
  8165. WPARAM wParam,
  8166. LPARAM lParam
  8167. )
  8168. {
  8169. ASSERT(uMsg >= CSAPCONFIRM_BASE);
  8170. GCCCtrlSapMsg Msg;
  8171. Msg.message_type = (GCCMessageType) (uMsg - CSAPCONFIRM_BASE);
  8172. Msg.nConfID = (GCCConfID) lParam;
  8173. GCCResult nResult = (GCCResult) LOWORD(wParam);
  8174. switch (Msg.message_type)
  8175. {
  8176. case GCC_EJECT_USER_CONFIRM:
  8177. #ifdef JASPER
  8178. Msg.u.eject_user_confirm.conference_id = Msg.nConfID;
  8179. Msg.u.eject_user_confirm.result = nResult;
  8180. Msg.u.eject_user_confirm.ejected_node_id = (GCCNodeID) HIWORD(wParam);
  8181. #endif // JASPER
  8182. break;
  8183. case GCC_CONDUCT_GIVE_CONFIRM:
  8184. #ifdef JASPER
  8185. Msg.u.conduct_give_confirm.conference_id = Msg.nConfID;
  8186. Msg.u.conduct_give_confirm.result = nResult;
  8187. Msg.u.conduct_give_confirm.recipient_node_id = (GCCNodeID) HIWORD(wParam);
  8188. #endif // JASPER
  8189. break;
  8190. case GCC_CONDUCT_ASK_CONFIRM:
  8191. #ifdef JASPER
  8192. Msg.u.conduct_permit_ask_confirm.conference_id = Msg.nConfID;
  8193. Msg.u.conduct_permit_ask_confirm.result = nResult;
  8194. Msg.u.conduct_permit_ask_confirm.permission_is_granted = HIWORD(wParam);;
  8195. #endif // JASPER
  8196. break;
  8197. case GCC_EJECT_USER_INDICATION:
  8198. Msg.u.eject_user_indication.conference_id = Msg.nConfID;
  8199. Msg.u.eject_user_indication.ejected_node_id = (GCCNodeID) HIWORD(wParam);
  8200. Msg.u.eject_user_indication.reason = (GCCReason) LOWORD(wParam);
  8201. break;
  8202. // case GCC_DISCONNECT_CONFIRM:
  8203. // case GCC_LOCK_CONFIRM:
  8204. // case GCC_UNLOCK_CONFIRM:
  8205. // case GCC_ANNOUNCE_PRESENCE_CONFIRM:
  8206. // case GCC_TERMINATE_CONFIRM:
  8207. // case GCC_CONDUCT_ASSIGN_CONFIRM:
  8208. // case GCC_CONDUCT_RELEASE_CONFIRM:
  8209. // case GCC_CONDUCT_PLEASE_CONFIRM:
  8210. // case GCC_CONDUCT_GRANT_CONFIRM:
  8211. // case GCC_TIME_REMAINING_CONFIRM:
  8212. // case GCC_TIME_INQUIRE_CONFIRM:
  8213. // case GCC_ASSISTANCE_CONFIRM:
  8214. // case GCC_TEXT_MESSAGE_CONFIRM:
  8215. default:
  8216. // This is a shortcut to fill in conf id and gcc result.
  8217. Msg.u.simple_confirm.conference_id = Msg.nConfID;
  8218. Msg.u.simple_confirm.result = nResult;
  8219. break;
  8220. }
  8221. SendCtrlSapMsg(&Msg);
  8222. }
  8223. GCCCtrlSapMsgEx * CControlSAP::CreateCtrlSapMsgEx
  8224. (
  8225. GCCMessageType eMsgType,
  8226. BOOL fUseToDelete
  8227. )
  8228. {
  8229. GCCCtrlSapMsgEx *pMsgEx;
  8230. UINT cbSize = (UINT)(fUseToDelete ?
  8231. sizeof(GCCCtrlSapMsgEx) + sizeof(DataToBeDeleted) :
  8232. sizeof(GCCCtrlSapMsgEx));
  8233. DBG_SAVE_FILE_LINE
  8234. if (NULL != (pMsgEx = (GCCCtrlSapMsgEx *) new BYTE[cbSize]))
  8235. {
  8236. pMsgEx->Msg.message_type = eMsgType;
  8237. pMsgEx->pBuf = NULL;
  8238. if (fUseToDelete)
  8239. {
  8240. pMsgEx->pToDelete = (DataToBeDeleted *) (pMsgEx + 1);
  8241. ::ZeroMemory(pMsgEx->pToDelete, sizeof(DataToBeDeleted));
  8242. }
  8243. else
  8244. {
  8245. pMsgEx->pToDelete = NULL;
  8246. }
  8247. }
  8248. return pMsgEx;
  8249. }
  8250. void CControlSAP::FreeCtrlSapMsgEx ( GCCCtrlSapMsgEx *pMsgEx )
  8251. {
  8252. switch (pMsgEx->Msg.message_type)
  8253. {
  8254. case GCC_QUERY_INDICATION:
  8255. delete pMsgEx->Msg.u.query_indication.asymmetry_indicator;
  8256. break;
  8257. #ifndef GCCNC_DIRECT_CONFIRM
  8258. case GCC_QUERY_CONFIRM:
  8259. delete pMsgEx->Msg.u.query_confirm.asymmetry_indicator;
  8260. break;
  8261. #endif
  8262. #ifdef JASPER
  8263. case GCC_TEXT_MESSAGE_INDICATION:
  8264. delete pMsgEx->Msg.u.text_message_indication.text_message;
  8265. break;
  8266. #endif // JASPER
  8267. #ifdef TSTATUS_INDICATION
  8268. case GCC_TRANSPORT_STATUS_INDICATION:
  8269. delete pMsgEx->Msg.u.transport_status.device_identifier;
  8270. delete pMsgEx->Msg.u.transport_status.remote_address;
  8271. delete pMsgEx->Msg.u.transport_status.message;
  8272. break;
  8273. #endif
  8274. }
  8275. //
  8276. // Now free up the data to be deleted,
  8277. //
  8278. if (NULL != pMsgEx->pToDelete)
  8279. {
  8280. DataToBeDeleted *p = pMsgEx->pToDelete;
  8281. delete p->pszNumericConfName;
  8282. delete p->pwszTextConfName;
  8283. delete p->pszConfNameModifier;
  8284. delete p->pszRemoteModifier;
  8285. delete p->pwszConfDescriptor;
  8286. delete p->pwszCallerID;
  8287. delete p->pszCalledAddress;
  8288. delete p->pszCallingAddress;
  8289. delete p->user_data_list_memory;
  8290. delete p->pDomainParams;
  8291. delete p->conductor_privilege_list;
  8292. delete p->conducted_mode_privilege_list;
  8293. delete p->non_conducted_privilege_list;
  8294. if (p->convener_password != NULL)
  8295. {
  8296. p->convener_password->UnLockPasswordData();
  8297. }
  8298. if (p->password != NULL)
  8299. {
  8300. p->password->UnLockPasswordData();
  8301. }
  8302. if (p->conference_list != NULL)
  8303. {
  8304. p->conference_list->UnLockConferenceDescriptorList();
  8305. }
  8306. if (p->conference_roster_message != NULL)
  8307. {
  8308. //
  8309. // Set bulk memory back to NULL here since the conference
  8310. // roster message object is responsible for freeing this up.
  8311. //
  8312. pMsgEx->pBuf = NULL;
  8313. p->conference_roster_message->UnLockConferenceRosterMessage();
  8314. }
  8315. if (p->application_roster_message != NULL)
  8316. {
  8317. //
  8318. // Set bulk memory back to NULL here since the application
  8319. // roster message object is responsible for freeing this up.
  8320. //
  8321. pMsgEx->pBuf = NULL;
  8322. //
  8323. // App roster indication can definitely be sent to app sap.
  8324. //
  8325. ::EnterCriticalSection(&g_csGCCProvider);
  8326. p->application_roster_message->UnLockApplicationRosterMessage();
  8327. ::LeaveCriticalSection(&g_csGCCProvider);
  8328. }
  8329. }
  8330. //
  8331. // Next free up any bulk memory used.
  8332. //
  8333. delete pMsgEx->pBuf;
  8334. //
  8335. // Finally, free the structure itself.
  8336. //
  8337. delete pMsgEx;
  8338. }