// main excute method // Copyright © Huawei Technologies Co., Ltd. 2015. All rights reserved. var WndUiOcx = new WndUi(); var ICSClientOcx = new ICSClient(); var ConferenceOcx = new Conference(); var VoiceOcx = new Voice(); var AgentOcx = new Agent(); var Event = {}; var ConferenceNotPrintElems = { SendMessage: [2], SendFile: [2], ReceiveFile: [2], JoinConf: [1] }; var VoiceNotPrintElems = { Call: [1], Register: [1, 2], DtmfDial: [1], SetSipTlsMode: [2], SetSipServerInfo: [1], SetLocalInfo: [1], AnonymousCall: [1, 2] }; var ICSClientNotPrintElems = { Call: [2, 3], SendTextMsg: [2], SetServerInfo: [1] }; var AgentNotPrintElems = { Register: [1, 2], SignInEx: [2, 4], SendChat: [2], CallOutEx: [1, 2], TransOutEx2: [3], SetCallDataEx: [2], AgentSendDTMF: [1], ModifyAgentPwd: [1,2,3] }; var ICSNotPrintJSONElems = { SetServerInfo: ["ip"] }; // !function whether object is null function isNull(object) { return (null===object || undefined===object); } // !function init function initAgentApp(navigator, document, sLogDir,localIp) { //Internationalization //I18N.utils.parseI18N(navigator,document,I18N.Module.AgentApp); //Initial log file FileUtil.setConfig({module:"AgentApp", logDir:sLogDir}); WndUiOcx.init("WndUiOcx"); ICSClientOcx.init("ICSClientOcx"); ConferenceOcx.init("ConferenceOcx"); VoiceOcx.init("VoiceOcx"); AgentOcx.init("AgentOcx"); LoadAgentConfig(localIp); } function initUserApp(navigator, document, sLogDir) { //Internationalization //I18N.utils.parseI18N(navigator, document, I18N.Module.UserApp); //Initial log file FileUtil.setConfig({module:"UserApp", logDir:sLogDir}); WndUiOcx.init("WndUiOcx"); ICSClientOcx.init("ICSClientOcx"); ConferenceOcx.init("ConferenceOcx"); VoiceOcx.init("VoiceOcx"); LoadUserConfig(); } // !function print method's log of info level function INFO_LOG_METHOD(component, logInfo) { console.log('[' + component + ']' + logInfo); try { FileUtil.writeLog(FileUtil.LogLevel.INFO,component,FileUtil.LogType.Function,logInfo); } catch (e) { //handle exception } } // !function print method's log of info level function DEBUG_LOG_METHOD(component, logInfo) { console.log('[' + component + ']' + logInfo); try { FileUtil.writeLog(FileUtil.LogLevel.DEBUG, component, FileUtil.LogType.Function, logInfo); } catch (e) { //handle exception } } // !function print method's log of info level function WARN_LOG_METHOD(component, logInfo) { console.log('[' + component + ']' + logInfo); try { FileUtil.writeLog(FileUtil.LogLevel.WARN, component, FileUtil.LogType.Function, logInfo); } catch (e) { //handle exception } } // !function print method's log of info level function ERROR_LOG_METHOD(component, logInfo) { console.log('[' + component + ']' + logInfo); try { FileUtil.writeLog(FileUtil.LogLevel.ERROR, component, FileUtil.LogType.Function, logInfo); } catch (e) { //handle exception } } //add '\n' in the JSON string. function recoverJSONForm(objStr) { objStr = objStr.replace("\{", "\{\n "); objStr = objStr.replace("\}", "\n\}"); objStr = objStr.replace(/\,/g, "\,\n "); return objStr; } // !function WndUiOcx interfaces excute function WndUiExcute(sInterfaceName) { var _argumentsInfo = ""; for(var i=0; i