private static void protocolName(string line_detail)
        {
            if (line_detail.Substring(0, 1) != " ")
            {
                streamMessagePool._stream_message sm = s.Pop();

                line_detail = regex.Replace(line_detail, "").Trim();

                sm.message_protocol = "M3UA";

                if (line_detail.IndexOf("GSMA-I") != -1)
                {
                    sm.message_protocol = "GSM";
                }
                if (line_detail.IndexOf("GSMSMS") != -1)
                {
                    sm.message_protocol = "SMS";
                }
                if (line_detail.IndexOf("UserPart") != -1)
                {
                    sm.message_protocol = "ISUP";
                }
                if (line_detail.IndexOf("RadioAccess") != -1)
                {
                    sm.message_protocol = "RANAP";
                }
                if (line_detail.IndexOf("ConnectionControl") != -1)
                {
                    sm.message_protocol = "SCCP";
                }

                s.Push(sm);
            }
        }
Beispiel #2
0
        public static HashSet <string> iu_cs_sinalling_relation_delegate_fr(int fr, bool sFlag)
        {
            Dictionary <int, string> ds = new Dictionary <int, string>();

            streamMessagePool._stream_message sm = streamMessagePool.ml.ElementAt(fr);
            ds.Add(0, sm.message_gsm_a_imsi);
            ds.Add(1, sm.message_sccp_dlr + sm.message_destination);
            ds.Add(2, sm.message_sccp_slr + sm.message_source);
            ds.Add(3, sm.CIC + sm.message_source + sm.message_destination);
            HashSet <string> hs = new HashSet <string>();

            foreach (KeyValuePair <int, string> kv in ds)
            {
                if (kv.Value != null)
                {
                    if (kv.Value.Length > 10)
                    {
                        switch (kv.Key)
                        {
                        case 0:
                            hs = iu_cs_sinalling_relation_delegate_imsi(streamMessagePool.ml, kv.Value, sFlag);
                            break;

                        case 1:
                            hs = iu_cs_sinalling_relation_delegate_lr(streamMessagePool.ml, kv.Value, sFlag);
                            break;

                        case 2:
                            hs = iu_cs_sinalling_relation_delegate_lr(streamMessagePool.ml, kv.Value, sFlag);
                            break;

                        case 3:
                            hs.Add(sm.CIC + sm.message_source + sm.message_destination);
                            hs.Add(sm.CIC + sm.message_destination + sm.message_source);
                            hs.UnionWith(iu_cs_sinalling_relation_delegate_cic(streamMessagePool.ml, kv.Value, sFlag));
                            break;

                        default:
                            break;
                        }
                        break;
                    }
                }
            }
            return(hs);
        }
        public static void saveStreamMessageSql(string tableName)
        {
            string strsql = null;

            streamMessagePool._stream_message user_field = new streamMessagePool._stream_message();
            FieldInfo[] fields = user_field.GetType().GetFields();

            strsql = kpiCommonClass.createListTable(fields);

            strsql = "create table " + tableName + " (" + strsql + " ) ";
            streamMessagePool.Acc.RunNoQuery(strsql);

            foreach (streamMessagePool._stream_message sm in streamMessagePool.ml)
            {
                strsql = kpiCommonClass.insertListTable(fields, sm);

                strsql = "insert into " + tableName + " values(" + strsql + ")";
                streamMessagePool.Acc.RunNoQuery(strsql);
            }
        }
        private void DataTableToList(DataTable dt)
        {
            //GC.Collect();
            Stack <streamMessagePool._stream_message> s = new Stack <streamMessagePool._stream_message>();
            int rc = dt.Rows.Count;

            for (int i = 0; i < rc; i++)
            {
                toolStripLabel1.Text    = (int)(100 * i / rc) + "%";
                toolStripLabel1.Visible = true;
                Application.DoEvents();
                streamMessagePool._stream_message sm = new streamMessagePool._stream_message();
                sm.message_number           = dt.Rows[i]["message_number"].ToString();
                sm.message_ttime            = dt.Rows[i]["message_ttime"].ToString();
                sm.message_time             = dt.Rows[i]["message_time"].ToString();
                sm.message_source           = dt.Rows[i]["message_source"].ToString();
                sm.message_destination      = dt.Rows[i]["message_destination"].ToString();
                sm.message_protocol         = dt.Rows[i]["message_protocol"].ToString();
                sm.message_info             = dt.Rows[i]["message_info"].ToString();
                sm.message_frame            = dt.Rows[i]["message_frame"].ToString();
                sm.message_begin_lineNumber = Int32.Parse(dt.Rows[i]["message_begin_lineNumber"].ToString());
                sm.message_end_lineNumber   = Int32.Parse(dt.Rows[i]["message_end_lineNumber"].ToString());
                sm.message_sccp_slr         = dt.Rows[i]["message_sccp_slr"].ToString();
                sm.message_sccp_dlr         = dt.Rows[i]["message_sccp_dlr"].ToString();
                sm.message_gsm_a_imsi       = dt.Rows[i]["message_gsm_a_imsi"].ToString();
                sm.message_gsm_a_tmsi       = dt.Rows[i]["message_gsm_a_tmsi"].ToString();
                sm.message_rnc_id           = dt.Rows[i]["message_rnc_id"].ToString();
                sm.message_lac          = dt.Rows[i]["message_lac"].ToString();
                sm.message_id_type      = dt.Rows[i]["message_id_type"].ToString();
                sm.message_id_num       = dt.Rows[i]["message_id_num"].ToString();
                sm.message_radioNetwork = dt.Rows[i]["message_radioNetwork"].ToString();
                sm.message_Cause        = dt.Rows[i]["message_Cause"].ToString();
                sm.CalledPartyNumber    = dt.Rows[i]["CalledPartyNumber"].ToString();
                sm.CallingPartyNumber   = dt.Rows[i]["CallingPartyNumber"].ToString();
                sm.CIC = dt.Rows[i]["CIC"].ToString();
                s.Push(sm);
            }
            streamMessagePool.ml.AddRange(s.Reverse());
        }
Beispiel #5
0
        public static void mobile_original_call_flow()
        {
            string strsql = null;

            streamMessagePool._moc_message moc_field = new streamMessagePool._moc_message();
            FieldInfo[] fields = moc_field.GetType().GetFields();

            strsql = kpiCommonClass.createListTable(fields);

            strsql = "create table " + streamMessagePool.dataTableName + "_moc" + " (" + strsql + " ) ";
            streamMessagePool.Acc.RunNoQuery(strsql);

            IEnumerable <string> list_n =
                from n in streamMessagePool.ml
                where n.message_info.IndexOf("CM Service Request") != -1
                select n.message_frame;

            foreach (string i in list_n)//针对每1个类型的字段
            {
                int fr = Int32.Parse(i);

                //在此调用父窗口的进度条,采用托管的方式传递
                middleDelegate.DoSendPMessage(fr);
                Application.DoEvents();

                //建1条moc流程消息
                streamMessagePool._moc_message moc = new streamMessagePool._moc_message();

                //找出现消息i的关联字段hs表
                HashSet <string> hs = messageFlowSearch.iu_cs_sinalling_relation_delegate_fr(fr, false);

                //找出用户消息流程
                HashSet <string> hsEndMessage = new HashSet <string>();
                hsEndMessage.Add("Release Complete (0x05)");    //主叫呼出的SCCP连接释放
                hsEndMessage.Add("Connect Acknowledge (0x0f)"); //通话连接确认
                IEnumerable <streamMessagePool._stream_message> list_fr =
                    messageFlowSearch.convert_hsRelationString_listUserMessage(hs, fr, hsEndMessage);

                streamMessagePool._stream_message sm = list_fr.First();
                moc.CM_Service_Request_message_frame      = sm.message_frame;
                moc.CM_Service_Request_message_time       = sm.message_time;
                moc.CM_Service_Request_message_rnc_id     = sm.message_rnc_id;
                moc.CM_Service_Request_message_lac        = sm.message_lac;
                moc.CM_Service_Request_message_gsm_a_tmsi = sm.message_gsm_a_tmsi;

                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Connection Confirm (0x02)") != -1);
                if (sm != null)
                {
                    moc.CC_message_frame = sm.message_frame;
                    moc.CC_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("id-CommonID (15)") != -1);
                if (sm != null)
                {
                    moc.id_CommonID_message_frame = sm.message_frame;
                    moc.id_CommonID_message_time  = sm.message_time;
                    moc.id_CommonID_message_imsi  = sm.message_gsm_a_imsi;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Authentication Request (0x12)") != -1);
                if (sm != null)
                {
                    moc.Authentication_Request_message_frame = sm.message_frame;
                    moc.Authentication_Request_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Authentication Response (0x14)") != -1);
                if (sm != null)
                {
                    moc.Authentication_Response_message_frame = sm.message_frame;
                    moc.Authentication_Response_message_time  = sm.message_time;
                }

                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("Identity Request (0x18)") != -1
                                            & n.message_id_type.IndexOf("IMEI") != -1);
                if (sm != null)
                {
                    moc.Identity_Request_IMEI_message_frame = sm.message_frame;
                    moc.Identity_Request_IMEI_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("Identity Response (0x19)") != -1
                                            & n.message_id_type.IndexOf("IMEI") != -1);
                if (sm != null)
                {
                    moc.Identity_Response_IMEI_message_frame   = sm.message_frame;
                    moc.Identity_Response_IMEI_message_time    = sm.message_time;
                    moc.Identity_Response_IMEI_message_id_type = sm.message_id_type;
                    moc.Identity_Response_IMEI_message_id_num  = sm.message_id_num;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("CM Service Accept (0x21)") != -1);
                if (sm != null)
                {
                    moc.CM_Service_Accept_message_frame = sm.message_frame;
                    moc.CM_Service_Accept_message_time  = sm.message_time;
                }

                //1.cp
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("CP-DATA (0x01)") != -1);
                if (sm != null)
                {
                    moc.CP_DATA_message_frame = sm.message_frame;
                    moc.CP_DATA_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("CP-ACK (0x04)") != -1);
                if (sm != null)
                {
                    moc.CP_ACK_message_frame = sm.message_frame;
                    moc.CP_ACK_message_time  = sm.message_time;
                }

                //2.register
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Register (0x3b)") != -1);
                if (sm != null)
                {
                    moc.Register_message_frame = sm.message_frame;
                    moc.Register_message_time  = sm.message_time;
                }

                //3.setup
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Setup (0x05)") != -1);
                if (sm != null)
                {
                    moc.Setup_message_frame = sm.message_frame;
                    moc.Setup_message_time  = sm.message_time;
                    moc.Setup_called_number = sm.message_id_num;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Call Proceeding (0x02)") != -1);
                if (sm != null)
                {
                    moc.Call_Proceeding_message_frame = sm.message_frame;
                    moc.Call_Proceeding_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("id-RAB-Assignment (0)") != -1);
                if (sm != null)
                {
                    moc.id_RAB_Assignment_r_message_frame = sm.message_frame;
                    moc.id_RAB_Assignment_r_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n => n.message_frame != moc.id_RAB_Assignment_r_message_frame
                                            & n.message_info.IndexOf("id-RAB-Assignment (0)") != -1);
                if (sm != null)
                {
                    moc.id_RAB_Assignment_s_message_frame = sm.message_frame;
                    moc.id_RAB_Assignment_s_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Alerting (0x01)") != -1);
                if (sm != null)
                {
                    moc.Alerting_message_frame = sm.message_frame;
                    moc.Alerting_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Connect (0x07)") != -1);
                if (sm != null)
                {
                    moc.Connect_message_frame = sm.message_frame;
                    moc.Connect_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Connect Acknowledge (0x0f)") != -1);
                if (sm != null)
                {
                    moc.Connect_Acknowledge_message_frame = sm.message_frame;
                    moc.Connect_Acknowledge_message_time  = sm.message_time;
                }


                strsql = kpiCommonClass.insertListTable(fields, moc);

                strsql = "insert into " + streamMessagePool.dataTableName + "_moc" + " values(" + strsql + ")";
                streamMessagePool.Acc.RunNoQuery(strsql);
            }
        }
Beispiel #6
0
        public static void mobile_iu_release_request_flow()
        {
            string strsql = null;

            streamMessagePool._iu_release_request_message iu_rr_field = new streamMessagePool._iu_release_request_message();
            FieldInfo[] fields = iu_rr_field.GetType().GetFields();

            strsql = kpiCommonClass.createListTable(fields);

            strsql = "create table " + streamMessagePool.dataTableName + "_iu_rr" + " (" + strsql + " ) ";
            streamMessagePool.Acc.RunNoQuery(strsql);


            IEnumerable <string> list_n =
                from n in streamMessagePool.ml
                where n.message_info.IndexOf("id-Iu-ReleaseRequest (11)") != -1
                select n.message_frame;

            foreach (string i in list_n)//针对每1个类型的字段
            {
                int fr = Int32.Parse(i);

                //在此调用父窗口的进度条,采用托管的方式传递
                middleDelegate.DoSendPMessage(fr);
                Application.DoEvents();

                streamMessagePool._iu_release_request_message iu_rr = new streamMessagePool._iu_release_request_message();
                streamMessagePool._stream_message             sm    = streamMessagePool.ml.ElementAt(fr);
                iu_rr.iu_release_request_message_frame        = sm.message_frame;
                iu_rr.iu_release_request_message_time         = sm.message_time;
                iu_rr.iu_release_request_message_radioNetwork = sm.message_radioNetwork;
                iu_rr.iu_release_request_message_Cause        = sm.message_Cause;

                //找出现消息i的关联字段hs表
                //考虑用这个方法
                //IEnumerable<string> strings = ...;// C# 3 and .NET 3.5:string joined = string.Join(",", strings.ToArray());

                HashSet <string> hs = messageFlowSearch.iu_cs_sinalling_relation_delegate_fr(fr, true);

                IEnumerable <streamMessagePool._stream_message> list_fr =
                    from n in streamMessagePool.ml
                    where hs.Contains(n.message_sccp_slr + n.message_source)
                    | hs.Contains(n.message_sccp_dlr + n.message_destination)
                    | hs.Contains(n.message_gsm_a_imsi)
                    | hs.Contains(n.CIC + n.message_source + n.message_destination)
                    select n;

                var query1 =
                    from n in list_fr
                    where n.message_gsm_a_imsi != null
                    select n.message_gsm_a_imsi;
                if (query1.Any())
                {
                    iu_rr.iu_release_request_imsi = query1.FirstOrDefault(n => n.Length > 1);
                }

                var query2 =
                    from n in list_fr
                    where n.message_rnc_id != null
                    select n.message_rnc_id;
                if (query2.Any())
                {
                    iu_rr.iu_release_request_rnc_id = query2.FirstOrDefault(n => n.Length > 1);
                }

                var query3 =
                    from n in list_fr
                    where n.message_id_num != null & n.message_id_type != null
                    select n
                    into m
                    where m.message_id_type.IndexOf("IMEI") != -1
                    select m.message_id_num;
                if (query3.Any())
                {
                    iu_rr.iu_release_request_imei = query3.FirstOrDefault(n => n.Length > 1);
                }


                strsql = kpiCommonClass.insertListTable(fields, iu_rr);

                strsql = "insert into " + streamMessagePool.dataTableName + "_iu_rr" + " values(" + strsql + ")";
                streamMessagePool.Acc.RunNoQuery(strsql);
            }
        }
        public static void open_iu_cs_file()
        {
            int    file_line_number = 0;
            string file_line_detail = null;

            string line_detail  = null; //消息行号
            int    line_number  = 0;    //消息行号
            int    read_message = 0;    //是否读入消息
            int    read_sctp    = 0;    //读入的消息是否有组包

            StreamReader rd = new StreamReader(streamMessagePool.signallingFilePath);

            rd.BaseStream.Seek(0, SeekOrigin.Begin);

            Queue <string> q = new Queue <string>();

            while (rd.Peek() >= 0)
            {
                GC.Collect();

                Application.DoEvents();

                //MemoryStream ms = new MemoryStream();
                //StreamWriter sw = new StreamWriter(ms);

                while (file_line_number < line_total_number + line_number && file_line_number >= line_number)//在此分次读取
                {
                    file_line_detail = rd.ReadLine();
                    //sw.WriteLine(file_line_detail);
                    q.Enqueue(file_line_detail);
                    file_line_number++;
                }

                //sw.Flush();
                //ms.Position = 0;
                //StreamReader reader = new StreamReader(ms);
                //reader.BaseStream.Seek(0, SeekOrigin.Begin);
                //while (reader.Peek() >= 0)

                pb = 0;

                while (q.Count > 0)
                {
                    //line_detail = reader.ReadLine();
                    line_detail = q.Dequeue();
                    line_number++;
                    read_message++;
                    pb++;

                    //在此调用父窗口的进度条,采用托管的方式传递
                    middleDelegate.DoSendPMessage(pb);
                    Application.DoEvents();

                    if (line_detail != null)
                    {
                        if (line_detail.Length > 10)
                        {
                            if (line_detail.Substring(0, 2).IndexOf("Fr") != -1)
                            {
                                read_message = 0;//开关参数
                                read_sctp    = 0;
                            }
                        }

                        if (read_message == 0)//如果出现消息行,那么存入基本消息到内存
                        {
                            message_number++;
                            streamMessagePool._stream_message sm = new streamMessagePool._stream_message();
                            sm.message_begin_lineNumber = line_number;//消息开始位置
                            line_detail = regex.Replace(line_detail, " ");
                            string[] ar = line_detail.Split(Convert.ToChar(" "));
                            sm.message_frame  = message_number.ToString();//----------------------------------------------->
                            sm.message_number = ar[1].Trim();
                            fr = message_number;
                            if (fr != 0)
                            {
                                //streamMessagePool.ml.ElementAt(fr - 1).message_end_lineNumber = line_number;

                                streamMessagePool._stream_message _sm = s.Pop();
                                _sm.message_end_lineNumber = line_number;
                                s.Push(_sm);
                            }
                            //streamMessagePool.ml.Add(sm);
                            s.Push(sm);
                        }

                        if (line_detail.IndexOf("Stream Control Transmission Protocol") != -1)
                        {
                            read_sctp++;
                            if (read_sctp != 1)//如果出现消息组包,那么直接复制前1条消息的内容
                            {
                                message_number++;
                                fr = message_number;
                                streamMessagePool._stream_message sm = new streamMessagePool._stream_message();

                                //streamMessagePool._stream_message _sm = streamMessagePool.ml.ElementAt(fr - 1);
                                streamMessagePool._stream_message _sm = s.Peek();

                                sm.message_begin_lineNumber = _sm.message_begin_lineNumber;
                                sm.message_frame            = message_number.ToString();
                                sm.message_number           = _sm.message_number;
                                sm.message_time             = _sm.message_time;
                                sm.message_ttime            = _sm.message_ttime;
                                sm.message_source           = _sm.message_source;
                                sm.message_destination      = _sm.message_destination;
                                sm.message_protocol         = _sm.message_protocol;
                                sm.message_info             = _sm.message_info;
                                sm.message_end_lineNumber   = _sm.message_end_lineNumber;
                                if (fr != 1)
                                {
                                    _sm.message_end_lineNumber = line_number;
                                }

                                //streamMessagePool.ml.Add(sm);
                                s.Push(sm);
                            }
                        }

                        if (line_detail.Length > 2)
                        {
                            //ThreadPool.QueueUserWorkItem(new WaitCallback(infoName),line_detail);
                            protocolName(line_detail);
                            infoName(line_detail);
                        }
                    }
                }

                //reader.Dispose();
                //sw.Dispose();
                //ms.Dispose();
                //streamMessagePool.ml.ElementAt(streamMessagePool.ml.Count() - 1).message_end_lineNumber = line_number;

                streamMessagePool._stream_message _smLast = s.Pop();
                _smLast.message_end_lineNumber = line_number;
                s.Push(_smLast);
            }
            rd.Close();
            rd.Dispose();
            streamMessagePool.ml.AddRange(s.Reverse());
        }
        private static void infoName(string line_detail)
        {
            if (line_detail.IndexOf(":") != -1)
            {
                string[] ar = line_detail.Split(Convert.ToChar(":"));
                if (ar.Length < 5)
                {
                    streamMessagePool._stream_message sm = s.Pop();

                    ar[0] = regex.Replace(ar[0], "");

                    if (ar[0].IndexOf("OPC") != -1)
                    {
                        sm.message_source = ar[1].Trim();
                    }
                    if (ar[0].IndexOf("DPC") != -1)
                    {
                        sm.message_destination = ar[1].Trim();
                    }

                    //此处更正时间-->测试OK
                    if (ar[0].IndexOf("ArrivalTime") != -1)
                    {
                        line_detail = line_detail.Replace("Arrival Time:", "");
                        DateTime dt = DateTime.Parse(line_detail.Trim().Substring(0, 20));
                        sm.message_ttime = dt.ToString("yyyy-MM-dd HH:mm:ss.fff");
                    }
                    if (ar[0].IndexOf("Timesincereferenceorfirstframe") != -1)
                    {
                        sm.message_time = ar[1].Replace(" seconds]", "").Trim();
                    }

                    //此处更新info
                    if (ar[0].IndexOf("procedureCode") != -1)
                    {
                        sm.message_info = ar[1].Trim();
                    }
                    if (ar[0].IndexOf("MessageType") != -1 || ar[0].IndexOf("Messagetype") != -1)
                    {
                        sm.message_info = ar[1].Trim();
                    }
                    //此处更新isup
                    if (ar[0].IndexOf("CalledPartyNumber") != -1)
                    {
                        sm.CalledPartyNumber = ar[1].Trim();
                    }
                    if (ar[0].IndexOf("CallingPartyNumber") != -1)
                    {
                        sm.CallingPartyNumber = ar[1].Trim();
                    }
                    if (ar[0].IndexOf("CIC") != -1)
                    {
                        sm.CIC = ar[1].Trim();
                    }


                    if (ar[0].IndexOf("SourceLocalReference") != -1)
                    {
                        sm.message_sccp_slr = ar[1].Trim();
                    }

                    if (ar[0].IndexOf("DestinationLocalReference") != -1)
                    {
                        sm.message_sccp_dlr = ar[1].Trim();
                    }

                    if (ar[0].IndexOf("TMSI/P-TMSI") != -1)
                    {
                        sm.message_gsm_a_tmsi = ar[1].Trim();
                    }

                    if (ar[0].IndexOf("IMSIdigits") != -1)
                    {
                        sm.message_gsm_a_imsi = ar[1].Trim();
                    }


                    if (ar[0].IndexOf("rNC-ID") != -1)                                   //<----------增加字段处
                    {
                        sm.message_rnc_id = ar[1].Trim();
                    }

                    if (ar[1].IndexOf("  Type of identity") != -1)
                    {
                        sm.message_id_type = ar[2].Trim();
                    }
                    if (ar[0].IndexOf("MobileIdentityType") != -1)
                    {
                        sm.message_id_type = ar[1].Trim();
                    }

                    if (ar[0].IndexOf("BCDDigits") != -1)
                    {
                        sm.message_id_num = ar[1].Trim();
                    }

                    if (ar[0].IndexOf("lAC") != -1)
                    {
                        sm.message_lac = ar[1].Trim();
                    }

                    if (ar[0].IndexOf("radioNetwork") != -1)
                    {
                        sm.message_radioNetwork = ar[1].Trim();
                    }

                    if (ar[0].IndexOf("Cause") != -1)
                    {
                        sm.message_Cause = ar[1].Trim();
                    }

                    s.Push(sm);
                }
            }
        }
Beispiel #9
0
        public static void mobile_handover_in_rnc_flow()
        {
            string strsql = null;

            streamMessagePool._ho_in_message ho_in_field = new streamMessagePool._ho_in_message();
            FieldInfo[] fields = ho_in_field.GetType().GetFields();

            strsql = kpiCommonClass.createListTable(fields);

            strsql = "create table " + streamMessagePool.dataTableName + "_ho_in" + " (" + strsql + " ) ";
            streamMessagePool.Acc.RunNoQuery(strsql);

            IEnumerable <string> list_n =
                from n in streamMessagePool.ml
                where n.message_info.IndexOf("id-RelocationResourceAllocation (3)") != -1 & n.message_gsm_a_imsi.Length > 1
                select n.message_frame;

            foreach (string i in list_n)//针对每1个类型的字段
            {
                int fr = Int32.Parse(i);

                //在此调用父窗口的进度条,采用托管的方式传递
                middleDelegate.DoSendPMessage(fr);
                Application.DoEvents();

                //建1条LAU流程消息
                streamMessagePool._ho_in_message ho_in = new streamMessagePool._ho_in_message();

                //找出现消息i的关联字段hs表
                HashSet <string> hs = messageFlowSearch.iu_cs_sinalling_relation_delegate_fr(fr, false);

                //找出用户消息流程
                HashSet <string> hsEndMessage = new HashSet <string>();
                hsEndMessage.Add("id-RelocationComplete (13)");         //切换完成
                IEnumerable <streamMessagePool._stream_message> list_fr =
                    messageFlowSearch.convert_hsRelationString_listUserMessage(hs, fr, hsEndMessage);

                streamMessagePool._stream_message sm = list_fr.First();
                ho_in.id_RelocationResourceAllocation_r_message_frame = sm.message_frame;
                ho_in.id_RelocationResourceAllocation_r_message_time  = sm.message_time;
                ho_in.id_RelocationResourceAllocation_r_imsi          = sm.message_gsm_a_imsi;

                sm = list_fr.FirstOrDefault(n => n.message_frame != i
                                            & n.message_info.IndexOf("id-RelocationResourceAllocation (3)") != -1);
                if (sm != null)
                {
                    ho_in.id_RelocationResourceAllocation_s_message_frame = sm.message_frame;
                    ho_in.id_RelocationResourceAllocation_s_message_time  = sm.message_time;
                }

                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("id-RelocationDetect (12)") != -1);
                if (sm != null)
                {
                    ho_in.id_RelocationDetect_message_frame = sm.message_frame;
                    ho_in.id_RelocationDetect_message_time  = sm.message_time;
                }

                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("id-RelocationComplete (13)") != -1);
                if (sm != null)
                {
                    ho_in.id_RelocationComplete_message_frame = sm.message_frame;
                    ho_in.id_RelocationComplete_message_time  = sm.message_time;
                }

                strsql = kpiCommonClass.insertListTable(fields, ho_in);

                strsql = "insert into " + streamMessagePool.dataTableName + "_ho_in" + " values(" + strsql + ")";
                streamMessagePool.Acc.RunNoQuery(strsql);
            }
        }
Beispiel #10
0
        public static void isup_iam_acm_flow()
        {
            string strsql = null;

            streamMessagePool._isup_iam_message isup_iam_field = new streamMessagePool._isup_iam_message();
            FieldInfo[] fields = isup_iam_field.GetType().GetFields();

            strsql = kpiCommonClass.createListTable(fields);

            strsql = "create table " + streamMessagePool.dataTableName + "_isup_iam" + " (" + strsql + " ) ";
            streamMessagePool.Acc.RunNoQuery(strsql);

            IEnumerable <string> list_n =
                from n in streamMessagePool.ml
                where n.message_info.IndexOf("Initial address (1)") != -1
                select n.message_frame;

            foreach (string i in list_n)//针对每1个类型的字段
            {
                int fr = Int32.Parse(i);

                //在此调用父窗口的进度条,采用托管的方式传递
                middleDelegate.DoSendPMessage(fr);
                Application.DoEvents();

                //建1条LAU流程消息
                streamMessagePool._isup_iam_message iam = new streamMessagePool._isup_iam_message();

                //找出现消息i的关联字段hs表
                HashSet <string> hs = messageFlowSearch.iu_cs_sinalling_relation_delegate_fr(fr, false);

                //找出用户消息流程
                HashSet <string> hsEndMessage = new HashSet <string>();
                hsEndMessage.Add("Release complete (16)");         //切换完成
                IEnumerable <streamMessagePool._stream_message> list_fr =
                    messageFlowSearch.convert_hsRelationString_listUserMessage(hs, fr, hsEndMessage);

                streamMessagePool._stream_message sm = list_fr.First();
                iam.Initial_address_message_frame = sm.message_frame;
                iam.Initial_address_message_time  = sm.message_time;

                sm = list_fr.FirstOrDefault(n => n.message_frame != i
                                            & n.message_info.IndexOf("Address complete (6)") != -1);
                if (sm != null)
                {
                    iam.Address_complete_message_frame = sm.message_frame;
                    iam.Address_complete_message_time  = sm.message_time;
                }

                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("Release (12)") != -1);
                if (sm != null)
                {
                    iam.Release_message_frame = sm.message_frame;
                    iam.Release_message_time  = sm.message_time;
                }

                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("Release complete (16)") != -1);
                if (sm != null)
                {
                    iam.Release_complete_message_frame = sm.message_frame;
                    iam.Release_complete_message_time  = sm.message_time;
                }


                strsql = kpiCommonClass.insertListTable(fields, iam);

                strsql = "insert into " + streamMessagePool.dataTableName + "_isup_iam" + " values(" + strsql + ")";
                streamMessagePool.Acc.RunNoQuery(strsql);
            }
        }
        public static void mobile_location_update_flow()
        {
            string strsql = null;

            streamMessagePool._lau_message _lau = new streamMessagePool._lau_message();
            FieldInfo[] fields = _lau.GetType().GetFields();

            strsql = kpiCommonClass.createListTable(fields);

            strsql = "create table " + streamMessagePool.dataTableName + "_lau" + " (" + strsql + " ) ";
            streamMessagePool.Acc.RunNoQuery(strsql);

            IEnumerable <string> list_n =
                from n in streamMessagePool.ml
                where n.message_info.IndexOf("Location Updating Request (0x08)") != -1
                select n.message_frame;

            foreach (string i in list_n)//针对每1个类型的字段
            {
                int fr = Int32.Parse(i);

                //在此调用父窗口的进度条,采用托管的方式传递
                middleDelegate.DoSendPMessage(fr);
                Application.DoEvents();

                //建1条LAU流程消息
                streamMessagePool._lau_message lau = new streamMessagePool._lau_message();

                //找出现消息i的关联字段hs表
                HashSet <string> hs = messageFlowSearch.iu_cs_sinalling_relation_delegate_fr(fr, false);

                //找出用户消息流程
                HashSet <string> hsEndMessage = new HashSet <string>();
                hsEndMessage.Add("Release Complete (0x05)");            //位置更新的SCCP连接释放
                IEnumerable <streamMessagePool._stream_message> list_fr =
                    messageFlowSearch.convert_hsRelationString_listUserMessage(hs, fr, hsEndMessage);

                streamMessagePool._stream_message sm = list_fr.First();
                lau.Location_Updating_Request_message_frame      = sm.message_frame;
                lau.Location_Updating_Request_message_time       = sm.message_time;
                lau.Location_Updating_Request_message_rnc_id     = sm.message_rnc_id;
                lau.Location_Updating_Request_message_lac        = sm.message_lac;
                lau.Location_Updating_Request_message_gsm_a_tmsi = sm.message_gsm_a_tmsi;

                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Connection Confirm (0x02)") != -1);
                if (sm != null)
                {
                    lau.CC_message_frame = sm.message_frame;
                    lau.CC_message_time  = sm.message_time;
                }

                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("Identity Request (0x18)") != -1
                                            & n.message_id_type.IndexOf("IMSI") != -1);
                if (sm != null)
                {
                    lau.Identity_Request_IMSI_message_frame = sm.message_frame;
                    lau.Identity_Request_IMSI_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("Identity Response (0x19)") != -1
                                            & n.message_id_type.IndexOf("IMSI") != -1);
                if (sm != null)
                {
                    lau.Identity_Response_IMSI_message_frame   = sm.message_frame;
                    lau.Identity_Response_IMSI_message_time    = sm.message_time;
                    lau.Identity_Response_IMSI_message_id_type = sm.message_id_type;
                    lau.Identity_Response_IMSI_message_id_num  = sm.message_id_num;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("id-CommonID (15)") != -1);
                if (sm != null)
                {
                    lau.id_CommonID_message_frame = sm.message_frame;
                    lau.id_CommonID_message_time  = sm.message_time;
                    lau.id_CommonID_message_imsi  = sm.message_gsm_a_imsi;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Authentication Request (0x12)") != -1);
                if (sm != null)
                {
                    lau.Authentication_Request_message_frame = sm.message_frame;
                    lau.Authentication_Request_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Authentication Response (0x14)") != -1);
                if (sm != null)
                {
                    lau.Authentication_Response_message_frame = sm.message_frame;
                    lau.Authentication_Response_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("Identity Request (0x18)") != -1
                                            & n.message_id_type.IndexOf("IMEI") != -1);
                if (sm != null)
                {
                    lau.Identity_Request_IMEI_message_frame = sm.message_frame;
                    lau.Identity_Request_IMEI_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n => n.message_info.IndexOf("Identity Response (0x19)") != -1
                                            & n.message_id_type.IndexOf("IMEI") != -1);
                if (sm != null)
                {
                    lau.Identity_Response_IMEI_message_frame   = sm.message_frame;
                    lau.Identity_Response_IMEI_message_time    = sm.message_time;
                    lau.Identity_Response_IMEI_message_id_type = sm.message_id_type;
                    lau.Identity_Response_IMEI_message_id_num  = sm.message_id_num;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Location Updating Accept (0x02)") != -1);
                if (sm != null)
                {
                    lau.Location_Updating_Accept_message_frame = sm.message_frame;
                    lau.Location_Updating_Accept_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("TMSI Reallocation Complete (0x1b)") != -1);
                if (sm != null)
                {
                    lau.TMSI_Reallocation_Complete_message_frame = sm.message_frame;
                    lau.TMSI_Reallocation_Complete_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("id-Iu-Release (1)") != -1);
                if (sm != null)
                {
                    lau.id_Iu_Release_1_message_frame = sm.message_frame;
                    lau.id_Iu_Release_1_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n => n.message_frame != lau.id_Iu_Release_1_message_frame
                                            & n.message_info.IndexOf("id-Iu-Release (1)") != -1);
                if (sm != null)
                {
                    lau.id_Iu_Release_2_message_frame = sm.message_frame;
                    lau.id_Iu_Release_2_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Released (0x04)") != -1);
                if (sm != null)
                {
                    lau.RLSD_message_frame = sm.message_frame;
                    lau.RLSD_message_time  = sm.message_time;
                }
                sm = list_fr.FirstOrDefault(n =>
                                            n.message_info.IndexOf("Release Complete (0x05)") != -1);
                if (sm != null)
                {
                    lau.RLC_message_frame = sm.message_frame;
                    lau.RLC_message_time  = sm.message_time;
                }

                strsql = kpiCommonClass.insertListTable(fields, lau);

                strsql = "insert into " + streamMessagePool.dataTableName + "_lau" + " values(" + strsql + ")";
                streamMessagePool.Acc.RunNoQuery(strsql);
            }
        }