TEXT 70
Spans Guest on 3rd August 2025 08:10:35 AM
  1.  private static List<int> GetActiveSpans(NetworkStream stream)
  2.  {
  3.      List<int> spans = new List<int>();
  4.      string cmd = "Action: smscommand\r\ncommand: gsm show spans\r\n\r\n";
  5.      SendCommand(stream, cmd);
  6.      string response = ReadResponse(stream);
  7.  
  8.      string[] lines = response.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);
  9.      foreach (string line in lines)
  10.      {
  11.          if (line.Contains("GSM span") && line.Contains("Up, Active"))
  12.          {
  13.              string[] parts = line.Split();
  14.              if (parts.Length >= 3 && int.TryParse(parts[2].TrimEnd(':'), out int span))
  15.              {
  16.                  spans.Add(span);
  17.              }
  18.          }
  19.      }
  20.      LogMessage("Active Spans: " + string.Join(", ", spans), System.Diagnostics.EventLogEntryType.Information);
  21.      return spans;
  22.  }

Hightechrobo bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.