sak1b

LAC_v1.rb

Dec 6th, 2019
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 7.42 KB | None | 0 0
  1. input = "ALMS01_MSOFTX
  2. +++    MSOFTX/*MEID:5 MENAME:ALMS01_MSOFTX*/        2019-06-24 16:44:22+06:00
  3. O&M    #1682000
  4. %%/*1879364950 MEID=005*/LST LAIGCI: GCI=\"470020495\",QR=LOCAL;%%
  5. RETCODE = 0  Operation succeeded
  6.  
  7. Local LAIGCI Detailed Description
  8. ---------------------------------
  9.                                       Global cell ID  =  470020495
  10.                                         LA cell name  =  ALMS01_CBEA5_LAC_1173
  11.                            MSC number of the LA cell  =  8801801000070
  12.                            VLR number of the LA cell  =  8801801000070
  13.                                  Mobile network code  =  FFF
  14.                             Perform roaming analysis  =  No
  15.                               Restrict incoming call  =  No
  16.                               Restrict outgoing call  =  No
  17.                               Location area category  =  LAI
  18.                                   Location area type  =  Local VLR
  19.                                Early assignment flag  =  Early assignment
  20.                                 Location number name  =  INVALID
  21.                                           BSC number  =  1
  22.                         Home BSC network indicator 1  =  National reserved network
  23.                                       Home BSC DPC 1  =  H'000069
  24.                         Home BSC network indicator 2  =  National reserved network
  25.                                       Home BSC DPC 2  =  H'000000
  26.                         Home BSC network indicator 3  =  National reserved network
  27.                                       Home BSC DPC 3  =  H'000000
  28.                         Home BSC network indicator 4  =  National reserved network
  29.                                       Home BSC DPC 4  =  H'000000
  30.                         Home BSC network indicator 5  =  National reserved network
  31.                                       Home BSC DPC 5  =  H'000000
  32.                         Home BSC network indicator 6  =  National reserved network
  33.                                       Home BSC DPC 6  =  H'000000
  34.                         Home BSC network indicator 7  =  National reserved network
  35.                                       Home BSC DPC 7  =  H'000000
  36.                         Home BSC network indicator 8  =  National reserved network
  37.                                       Home BSC DPC 8  =  H'000000
  38.                         Home BSC network indicator 9  =  National reserved network
  39.                                       Home BSC DPC 9  =  H'000000
  40.                        Home BSC network indicator 10  =  National reserved network
  41.                                      Home BSC DPC 10  =  H'000000
  42.                                     Call source name  =  CBEA5
  43.                               East or west longitude  =  East longitude
  44.                                    Longitude(degree)  =  0
  45.                                    Longitude(minute)  =  0
  46.                                    Longitude(second)  =  0
  47.                              South or north latitude  =  North latitude
  48.                                     Latitude(degree)  =  0
  49.                                     Latitude(minute)  =  0
  50.                                     Latitude(second)  =  0
  51.                                    Radius(kilometre)  =  0
  52.                                      Multi area name  =  0
  53.                                          Server name  =  LOCAL
  54.                                    Tone playing name  =  INVALID
  55.                                  IDP Location number  =  8801801000220
  56.                                      Cell group name  =  INVALID
  57.                                           TZDST name  =  INVALID
  58.                               Location Identify Name  =  INVALID
  59.                IDP Location Number Address Attribute  =  International Number
  60.                                 Managed object group  =  PUBLIC
  61.                                      If Support USSD  =  Yes
  62.                                    Non Broadcast LAI  =  No
  63.                                      Location number  =  65535
  64.                                        Cell group ID  =  65535
  65.                                  Cipher Mode Setting  =  NO
  66.                                 Encryption Algorithm  =  <NULL>
  67.                                       Classmark2 RFC  =  111
  68.                                            Cell Type  =  SAI
  69.                             Containing Classmark3 IE  =  YES
  70.                 Containing Chosen Encry Algorithm IE  =  NO
  71.                                   Containing Imsi IE  =  NO
  72.                       Half rate channel is forbidden  =  PERMIT
  73.                                    Containing DTX IE  =  NO
  74.                   Containing Integrity Protection IE  =  YES
  75.                             Containing OBssToNBss IE  =  YES
  76.                             Containing SRncToTRnc IE  =  YES
  77.               BIEI_SERVICE_HANDOVER is not contained  =  NO
  78.                Only Contain FR Speech Version 1 Flag  =  NO
  79.                  Contain Current Speech Version Flag  =  YES
  80.      Support whole net configuration or not when SNA  =  NO
  81.                           Not Send Classmark Request  =  YES
  82. Inter MSC Handover/Relocation MAP Not Carry Codeclist  =  YES
  83.         Not containing Alternative RAB Configuration  =  YES
  84.          Inter MSC Handover Not Support Active Trace  =  YES
  85.                   Handover parameter Reserved Bit 24  =  YES
  86.                 Inter MSC Handover Not Support HSCSD  =  YES
  87.                   Handover parameter Reserved Bit 26  =  NO
  88.                                Not Support POS TRACK  =  YES
  89.                   Handover parameter Reserved Bit 28  =  YES
  90.   Handover parameter Reserved Bit 29-Reserved Bit 31  =  111
  91.                           Handover extra parameter 1  =  NULL
  92.                                              Hot LAI  =  NO
  93.                                             VIP cell  =  NO
  94.                        Other Property Reserved Bit 2  =  NO
  95.                                        IN MM trigger  =  NO
  96.                                        Specific cell  =  NO
  97.                           Not Support Pre_Paging LAI  =  NO
  98.                                      Network Area ID  =  FFF
  99.                                          Region Code  =  FF
  100.        Other Property Reserved Bit 6-Reserved Bit 31  =  00000000000000000000000000
  101.                                     Charge area code  =  FFFF
  102.    Benchmark duration for cell paging no response(s)  =  30
  103.                                       Paging monitor  =  No
  104.                                           E911 phase  =  INVALID
  105.                                        EMA Parameter  =  0
  106.                                Extended service list  =  NULL
  107.                                 ICS call source name  =  NULL
  108. (Number of results = 1)
  109. "
  110.  
  111. def parse_LAC(data)
  112.  
  113.   my_hash = {}
  114.   lines = data.split("\n")
  115.   p lines.length
  116.   lines.each_with_index do |line,index|
  117.     if index > 7 # first 8 lines are omitted
  118.       if line.length > 0
  119.         splitted = line.split("=")
  120.         key = splitted[0].strip
  121.         value = splitted[1].strip
  122.         my_hash[key] = value
  123.      
  124.       end
  125.     end
  126.   end
  127.  
  128.   last_key = my_hash.keys.last
  129.   last_value = my_hash.values.last
  130.  
  131.   my_hash.delete(last_key)
  132.  
  133.   last_key = last_key.gsub('(','')
  134.   last_value = last_value.gsub(')','')
  135.  
  136.   my_hash[last_key] = last_value
  137.   my_hash
  138.  
  139. end
  140.  
  141. z = parse_LAC(input)
Advertisement
Add Comment
Please, Sign In to add comment