فهرست منبع

Z991239-4942 #comment feat: 修复vtmloader的编译异常

陈良瑜80374463 2 سال پیش
والد
کامیت
d5301e9c5c
3فایلهای تغییر یافته به همراه33 افزوده شده و 3 حذف شده
  1. 32 1
      Module/mod_vtmloader/VtmLoaderFSM.cpp
  2. 1 0
      Module/mod_vtmloader/VtmLoaderFSM.h
  3. 0 2
      Module/mod_vtmloader/mod_vtmloader.cpp

+ 32 - 1
Module/mod_vtmloader/VtmLoaderFSM.cpp

@@ -26,7 +26,7 @@ enum EntityOP
 	OP_CONTINUE_ENTITY,
 };
 
-extern struct callback_entry : public IReleasable
+struct callback_entry : public IReleasable
 {
 	virtual ~callback_entry() {}
 
@@ -176,6 +176,37 @@ unsigned int CVtmLoaderFSM::s0_on_event(FSMEvent* pEvt)
 	return 0;
 }
 		
+void CVtmLoaderFSM::ShowEntityBootFailedAtFront(LPCTSTR lpcszEntityName, ErrorCodeEnum bootFailedResult, bool isBlock)
+{
+#if defined(RVC_OS_LINUX)
+
+	CEntityLastErrorInfo errInfo = {};
+	ErrorCodeEnum errCode = GetEntityBase()->GetFunction()->GetEntityLastError(lpcszEntityName, errInfo);
+	CSimpleStringA strErrMsg(true);
+	if (!errInfo.strErrMsg.IsNullOrEmpty()) {
+		strErrMsg = CSimpleStringA::Format("%s:%s", lpcszEntityName, (LPCTSTR)errInfo.strErrMsg);
+	}
+	else {
+		strErrMsg = CSimpleStringA::Format("%s模块初始化失败: %s", lpcszEntityName, (LPCTSTR)SpStrError(bootFailedResult));
+	}
+
+	if (CSimpleStringA(lpcszEntityName).Compare("SIPPhone", true) == 0)
+	{
+		GetEntityBase()->GetFunction()->SetSysVar("AuthErrMsg", strErrMsg.GetData());//实体启动失败保存到错误页字段
+	}
+
+	if (isBlock) {
+		SP::Module::Comm::LogErrorNotiyStruct notifyItem(bootFailedResult, 0);
+		SP::Module::Comm::LogNotiyMessageStruct notifyMsg(strErrMsg);
+		notifyItem.Notify(notifyMsg);
+	}
+	else {
+		LogError(Severity_High, bootFailedResult, 0, strErrMsg);
+	}
+
+#endif //RVC_OS_LINUX
+}
+
 //CoreBoot
 void CVtmLoaderFSM::s1_on_entry()
 {

+ 1 - 0
Module/mod_vtmloader/VtmLoaderFSM.h

@@ -144,6 +144,7 @@ private:
 	void OnAnswer(CSmartPointer<IAsynWaitSp> pAsynWaitSp);
 	bool IsRootINIExist();
 	ErrorCodeEnum SubscribeEntitysEvents();
+	void ShowEntityBootFailedAtFront(LPCTSTR lpcszEntityName, ErrorCodeEnum bootFailedResult, bool isBlock = true);
 
 private:
 	CSystemStaticInfo m_sysInfo;

+ 0 - 2
Module/mod_vtmloader/mod_vtmloader.cpp

@@ -3,8 +3,6 @@
 #include "EventCode.h"
 #include "VtmLoader_UserCode.h"
 #include "publicFunExport.h"
-//#pragma comment(lib, "libpublicFun.lib")
-#include "tokenDefine.h"
 #include <SpIni.h>