CgwMonitorManage.T28181.SipSDKInterface.SIP_SDK_Init C# (CSharp) Method

SIP_SDK_Init() private method

private SIP_SDK_Init ( string pLocalSipAccount, string pLocalSipPasswd, string pLocalID, string pLocalIP, int iLocalPort, string pServerSipAccount, string pServerSipPasswd, string pServerID, string pServerIP, int iServerPort, SIP_CallBack pCallBackFunc ) : EM_SIP_RESULT
pLocalSipAccount string
pLocalSipPasswd string
pLocalID string
pLocalIP string
iLocalPort int
pServerSipAccount string
pServerSipPasswd string
pServerID string
pServerIP string
iServerPort int
pCallBackFunc SIP_CallBack
return EM_SIP_RESULT
        public static extern EM_SIP_RESULT SIP_SDK_Init(string pLocalSipAccount, string pLocalSipPasswd, string pLocalID, string pLocalIP, int iLocalPort, string pServerSipAccount, string pServerSipPasswd, string pServerID, string pServerIP, int iServerPort, SIP_CallBack pCallBackFunc);

Usage Example

Example #1
0
        /// <summary>
        /// 初始化SIP协议栈
        /// </summary>
        public EM_SIP_RESULT SIP_SDK_Init(string pSipAccount, string pSipPasswd, string pLocalID, int iLocalPort, string pServerSipAccount, string pServerSipPasswd, string pServerID, string pServerIP, int iServerPort, EventHandler receivedAllDevice)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: SipStackAdapter.SIP_SDK_Init().");
            EM_SIP_RESULT iRet = EM_SIP_RESULT.RET_FAILURE;

            try
            {
                //string pLocalIP = GetLocalIP(pServerIP, iServerPort, iLocalPort);
                if (string.IsNullOrEmpty(localIP))
                {
                    localIP = GetLocalIP(pServerIP, iServerPort, iLocalPort);
                }
                ReceivedAllDevice = receivedAllDevice;

                sip_CallBack = SIP_CallBackMethod;

                iRet = SipSDKInterface.SIP_SDK_Init(pSipAccount, pSipPasswd, pLocalID, localIP, iLocalPort, pServerSipAccount, pServerSipPasswd, pServerID, pServerIP, iServerPort, sip_CallBack);
                if (iRet != EM_SIP_RESULT.RET_SUCCESS)
                {
                    logEx.Error("SipStackAdapter.SIP_SDK_Init Failed ,pAccount:{0}", pSipAccount);
                }

                //设置NETSOURCE日志目录
                IVS_NETSOURCE_RESULT iNet = NetSourcedInterface.IVS_NETSOURCE_Init(AppDomain.CurrentDomain.BaseDirectory + "\\logs");
                if (iNet != IVS_NETSOURCE_RESULT.SUCCESS)
                {
                    logEx.Error("SipStackAdapter.IVS_NETSOURCE_Init Failed,pAccount:{0}", pSipAccount);
                    iRet = EM_SIP_RESULT.RET_FAILURE;
                }
            }
            catch (System.Exception ex)
            {
                logEx.Error("SipStackAdapter.SIP_SDK_Init ,Exception:{0}", ex.ToString());
                iRet = EM_SIP_RESULT.RET_FAILURE;
            }
            return(iRet);
        }