Пример #1
0
 private bool CompareNumbers(MetaAddressBookEntry mabe, MetaSms msms)
 {
     if (CompareNumbers1(mabe, msms))
     {
         return(true);
     }
     return(CompareNumbers2(mabe, msms));
 }
Пример #2
0
 private bool CompareNumbers(MetaCallLog mcl, MetaSms msms)
 {
     if (CompareNumbers1(mcl, msms))
     {
         return(true);
     }
     return(CompareNumbers2(mcl, msms));
 }
Пример #3
0
 private void GetSmsNumberInfo()
 {
     foreach (ProcessedSms psms in this.smsFields)
     {
         MetaSms sms = psms.MetaData;
         psms.Number1Frequency      = GetNumberCount(sms.Number, sms1NumbersFull) + GetNumberCount(sms.Number, sms2NumbersFull);
         psms.Number2Frequency      = GetNumberCount(sms.Number2, sms1NumbersFull) + GetNumberCount(sms.Number2, sms2NumbersFull);
         psms.SevenDigits1Frequency = GetNumberCount(sms.SevenDigit, sms1Numbers7) + GetNumberCount(sms.SevenDigit, sms2Numbers7);
         psms.SevenDigits2Frequency = GetNumberCount(sms.SevenDigit2, sms1Numbers7) + GetNumberCount(sms.SevenDigit2, sms2Numbers7);
     }
 }
Пример #4
0
 private bool CompareNumbers2(MetaAddressBookEntry mabe, MetaSms msms)
 {
     if ((mabe.Number != null) && (msms.Number2 != null) &&
         (mabe.Number != MetaField.DEFAULT_STRING) && (mabe.Number == msms.Number2))
     {
         return(true);
     }
     if ((mabe.Number != null) && (msms.Number2 != null))
     {
         string acode1 = Dec0de.Bll.Utilities.GetAreaCode(mabe.Number);
         string acode2 = Dec0de.Bll.Utilities.GetAreaCode(msms.Number2);
         if ((acode1 != null) && (acode2 != null) && (acode1 != acode2))
         {
             return(false);
         }
     }
     if ((mabe.SevenDigit != null) && (msms.SevenDigit2 != null) &&
         (mabe.SevenDigit != MetaField.DEFAULT_STRING) && (mabe.SevenDigit == msms.SevenDigit2))
     {
         return(true);
     }
     return(false);
 }
Пример #5
0
 private bool CompareNumbers1(MetaCallLog mcl, MetaSms msms)
 {
     if ((mcl.Number != null) && (msms.Number != null) &&
         (mcl.Number != MetaField.DEFAULT_STRING) && (mcl.Number == msms.Number))
     {
         return(true);
     }
     if ((mcl.Number != null) && (msms.Number != null))
     {
         string acode1 = Dec0de.Bll.Utilities.GetAreaCode(mcl.Number);
         string acode2 = Dec0de.Bll.Utilities.GetAreaCode(msms.Number);
         if ((acode1 != null) && (acode2 != null) && (acode1 != acode2))
         {
             return(false);
         }
     }
     if ((mcl.SevenDigit != null) && (msms.SevenDigit != null) &&
         (mcl.SevenDigit != MetaField.DEFAULT_STRING) && (mcl.SevenDigit == msms.SevenDigit))
     {
         return(true);
     }
     return(false);
 }
Пример #6
0
 public ProcessedSms(MetaSms mf)
 {
     this.MetaData            = mf;
     this.SuspectPhoneNumber  = false;
     this.SuspectPhoneNumber2 = false;
 }
Пример #7
0
        private MetaSms GetMetaSms(ViterbiField field, List <MetaResult> metaResults)
        {
            string   name        = null;
            string   number      = null;
            string   number2     = null;
            DateTime?timeStamp   = null;
            string   message     = null;
            long     startOffset = -1;

            FieldPaths path = new FieldPaths();

            for (int i = 0; i < field.Raw.Length; i++)
            {
                if (i == 0)
                {
                    path._path_beg_offset = metaResults[(int)field.OffsetFile].Field.OffsetFile;
                }
                if (i == field.Raw.Length - 1)
                {
                    path._path_end_offset = metaResults[(int)field.OffsetFile + i].Field.OffsetFile;
                }
                path._fields_in_path.Add(metaResults[(int)field.OffsetFile + i].Field.MachineName.ToString());

                //if (field.Raw[i] == (byte)MetaMachine.Text && name == null)
                //    name = metaResults[(int)field.OffsetFile + i].Field.FieldString;

                if (field.Raw[i] == (byte)MetaMachine.PhoneNumber && number == null)
                {
                    number = metaResults[(int)field.OffsetFile + i].Field.FieldString;
                }

                else if (field.Raw[i] == (byte)MetaMachine.PhoneNumber && number2 == null)
                {
                    number2 = metaResults[(int)field.OffsetFile + i].Field.FieldString;
                }

                else if (field.Raw[i] == (byte)MetaMachine.TimeStamp && timeStamp == null)
                {
                    timeStamp = DateTime.Parse(metaResults[(int)field.OffsetFile + i].Field.FieldString);
                }

                else if (field.Raw[i] == (byte)MetaMachine.Text && message == null)
                {
                    message = metaResults[(int)field.OffsetFile + i].Field.FieldString;
                }

                if (startOffset == -1)
                {
                    startOffset = metaResults[(int)field.OffsetFile + i].Field.OffsetFile;
                }
            }
            path.find_actual_path();
            fieldPaths.Add(path);


            var entry = new MetaSms()
            {
                Name            = name,
                Number          = number,
                Number2         = number2,
                SevenDigit      = Utilities.GetLastSevenDigits(number),
                SevenDigit2     = Utilities.GetLastSevenDigits(number2),
                TimeStamp       = timeStamp,
                Message         = message,
                Offset          = startOffset,
                MachineName     = field.MachineName,
                ProximityOffset = startOffset
            };

            if (entry.Name == null)
            {
                entry.Name = MetaField.DEFAULT_STRING;
            }

            if (entry.Number == null)
            {
                entry.Number = MetaField.DEFAULT_STRING;
            }

            if (entry.SevenDigit == null)
            {
                entry.SevenDigit = MetaField.DEFAULT_STRING;
            }

            if (entry.Number2 == null)
            {
                entry.Number2 = MetaField.DEFAULT_STRING;
            }

            if (entry.SevenDigit2 == null)
            {
                entry.SevenDigit2 = MetaField.DEFAULT_STRING;
            }

            if (entry.Message == null)
            {
                entry.Message = MetaField.DEFAULT_STRING;
            }

            if (entry.TimeStamp == null)
            {
                entry.TimeStamp = MetaField.DEFAULT_DATE;
            }

            return(entry);
        }
Пример #8
0
        public MetaSms GetMetaSms(ViterbiField field, List <MetaResult> metaResults)
        {
            string   name        = null;
            string   number      = null;
            string   number2     = null;
            DateTime?timeStamp   = null;
            string   message     = null;
            long     startOffset = -1;

            for (int i = 0; i < field.Raw.Length; i++)
            {
                //if (field.Raw[i] == (byte)MetaMachine.Text && name == null)
                //    name = metaResults[(int)field.OffsetFile + i].Field.FieldString;

                if (field.Raw[i] == (byte)MetaMachine.PhoneNumber && number == null)
                {
                    number = metaResults[(int)field.OffsetFile + i].Field.FieldString;
                }

                else if (field.Raw[i] == (byte)MetaMachine.PhoneNumber && number2 == null)
                {
                    number2 = metaResults[(int)field.OffsetFile + i].Field.FieldString;
                }

                else if (field.Raw[i] == (byte)MetaMachine.TimeStamp && timeStamp == null)
                {
                    timeStamp = DateTime.Parse(metaResults[(int)field.OffsetFile + i].Field.FieldString);
                }

                else if (field.Raw[i] == (byte)MetaMachine.Text && message == null)
                {
                    message = metaResults[(int)field.OffsetFile + i].Field.FieldString;
                }

                if (startOffset == -1)
                {
                    startOffset = metaResults[(int)field.OffsetFile + i].Field.OffsetFile;
                }
            }



            var entry = new MetaSms()
            {
                Name        = name,
                Number      = number,
                Number2     = number2,
                SevenDigit  = Utilities.GetLastSevenDigits(number),
                SevenDigit2 = Utilities.GetLastSevenDigits(number2),
                TimeStamp   = timeStamp,
                Message     = message,
                Offset      = startOffset
            };

            if (entry.Name == null)
            {
                entry.Name = MetaField.DEFAULT_STRING;
            }

            if (entry.Number == null)
            {
                entry.Number = MetaField.DEFAULT_STRING;
            }

            if (entry.SevenDigit == null)
            {
                entry.SevenDigit = MetaField.DEFAULT_STRING;
            }

            if (entry.Number2 == null)
            {
                entry.Number2 = MetaField.DEFAULT_STRING;
            }

            if (entry.SevenDigit2 == null)
            {
                entry.SevenDigit2 = MetaField.DEFAULT_STRING;
            }

            if (entry.Message == null)
            {
                entry.Message = MetaField.DEFAULT_STRING;
            }

            if (entry.TimeStamp == null)
            {
                entry.TimeStamp = MetaField.DEFAULT_DATE;
            }

            return(entry);
        }