void FreeAllDeviceRes (void) { int i; for ( i = 0; i < MAX_DSP_MODULE_NUMBER_OF_XMS; i ++ ) { FreeOneDeviceRes ( i ); } InitAllDeviceRes (); }
// -------------------------------------------------------------------------------- bool InitSystem() { RetCode_t r; char MsgStr[160]; pdlg = (CXMS_VOIPTestDemoDlg *)theApp.m_pMainWnd; // Read From "XMS_Demo.INI" ReadFromConfig(); // Init m_ListMain InitListMain(); // Init m_ListMsg InitListMsg(); // Init m_ListCount InitListCount(); // Init Conifg's text box InitTextBox(); // now open ACS Server /*调用acsOpenStream 建立与ACS服务器的连接*/ r = XMS_acsOpenStream ( &g_acsHandle, &cfg_ServerID, g_u8UnitID, // App Unit ID 64, // sendQSize, in K Bytes 64, // recvQSize, in K Bytes 0, NULL); if ( r < 0 ) { sprintf ( MsgStr, "XMS_acsOpenStream(IP Addr : %s, port : %d) FAIL. ret = %d", cfg_ServerID.m_s8ServerIp, cfg_ServerID.m_u32ServerPort, r ); MessageBox(NULL, MsgStr, "Init System", MB_OK ) ; AddMsg ( MsgStr ); return false; } else { sprintf ( MsgStr, "XMS_acsOpenStream(%s,%d) OK!", cfg_ServerID.m_s8ServerIp, cfg_ServerID.m_u32ServerPort ); AddMsg ( MsgStr ); WriteMsgLog(MsgStr); } r = XMS_acsSetESR ( g_acsHandle, (EsrFunc)EvtHandler, 0, 1 ); if ( r < 0 ) { sprintf ( MsgStr, "XMS_acsSetESR() FAIL! ret = %d", r ); AddMsg ( MsgStr ); WriteMsgLog(MsgStr); return false; } else { sprintf ( MsgStr, "XMS_acsSetESR() OK!" ); AddMsg ( MsgStr ); WriteMsgLog(MsgStr); } InitAllDeviceRes (); XMS_acsGetDeviceList ( g_acsHandle, NULL ); return true; }
// -------------------------------------------------------------------------------- bool InitSystem() { RetCode_t r; char MsgStr[160]; pdlg = (CXMS_LoadTestDlg *)theApp.m_pMainWnd; // Read From "XMS_Demo.INI" ReadFromConfig(); // Special code for CAS(SS1) // Read From "C:\\DJXMS\\Samples\\CAS_Common_Code\\SaXMS_CAS_Cfg.INI" if ( CAS_Common_Cfg_ReadCfg ( &g_Param_CAS ) != 0 ) { sprintf ( MsgStr, "CAS_Common_Cfg_ReadCfg \"C:\\DJXMS\\Samples\\CAS_Common_Code\\XMS_CAS_Cfg.INI\" Error!" ); MessageBox(NULL, MsgStr, "Init System", MB_OK ) ; } // end of code for CAS(SS1) // Init m_ListMain InitListMain(); // Init m_ListPcm InitListPcm(); // Init m_ListMsg InitListMsg(); // Init m_ListCount InitListCount(); // Init Conifg's text box InitTextBox(); // now open ACS Server /*调用acsOpenStream 建立与ACS服务器的连接*/ r = XMS_acsOpenStream ( &g_acsHandle, &cfg_ServerID, g_u8UnitID, // App Unit ID 64, // sendQSize, in K Bytes 64, // recvQSize, in K Bytes 0, NULL); if ( r < 0 ) { sprintf ( MsgStr, "XMS_acsOpenStream(IP Addr : %s, port : %d) FAIL. ret = %d", cfg_ServerID.m_s8ServerIp, cfg_ServerID.m_u32ServerPort, r ); MessageBox(NULL, MsgStr, "Init System", MB_OK ) ; AddMsg ( MsgStr ); return false; } else { sprintf ( MsgStr, "XMS_acsOpenStream(%s,%d) OK!", cfg_ServerID.m_s8ServerIp, cfg_ServerID.m_u32ServerPort ); AddMsg ( MsgStr ); WriteMsgLog(MsgStr); } r = XMS_acsSetESR ( g_acsHandle, (EsrFunc)EvtHandler, 0, 1 ); if ( r < 0 ) { sprintf ( MsgStr, "XMS_acsSetESR() FAIL! ret = %d", r ); AddMsg ( MsgStr ); WriteMsgLog(MsgStr); return false; } else { sprintf ( MsgStr, "XMS_acsSetESR() OK!" ); AddMsg ( MsgStr ); WriteMsgLog(MsgStr); } InitAllDeviceRes (); XMS_acsGetDeviceList ( g_acsHandle, NULL ); return true; }