private EM_SIP_RESULT SIP_CallBackMethod(int msgType, int eventType, StringBuilder pPara)
{
NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
logEx.Trace("Enter: SipStackAdapter.SIP_CallBackMethod");
try
{
//收到的消息类型
EM_SIP_MSG_TYPE sipMsgType = (EM_SIP_MSG_TYPE)msgType;
EM_SIP_REQUEST_EVENT sipEventType = (EM_SIP_REQUEST_EVENT)eventType;
if (sipMsgType == EM_SIP_MSG_TYPE.SIP_REQUEST_MSG && sipEventType == EM_SIP_REQUEST_EVENT.SIP_REQ_MESSAGE)
{
ParameterizedThreadStart para = new ParameterizedThreadStart(SIP_CallBackThreadMethod);
Thread thread = new Thread(para);
thread.Priority = ThreadPriority.Highest;
thread.Start(pPara.ToString());
}
}
catch (System.Exception ex)
{
logEx.Error("SipStackAdapter.SIP_CallBackMethod ,Exception:{0}", ex.ToString());
return EM_SIP_RESULT.RET_FAILURE;
}
return EM_SIP_RESULT.RET_SUCCESS;
}