private void Parse(PDUStreamReader reader, SIPMsg msg) { var tag = string.Empty; var value = string.Empty; // message body if (reader.Peek() > 0) { var line = reader.ReadLine(); //Console.WriteLine("++ BODY ++"); while (line != null) { this.ParseSIPBodyLine(line, ref tag, ref value); //Console.WriteLine("\"" + _tag + "\" : \"" + _value + "\""); //Console.WriteLine(_line.Length.ToString() + ": \"" + _line.ToString() + "\""); string[] values; switch (tag) { case "c": values = value.Split(' '); if (values.Length < 2) { msg.Valid = false; msg.InvalidReason = "wrong format in message body: '" + line + "'"; return; } if (values[1] == "IP4") { this.RTPAddress = values[2]; } break; case "m": values = value.Split(' '); if (values.Length < 2) { msg.Valid = false; msg.InvalidReason = "wrong format in message body: '" + line + "'"; return; } this.RTPPort = values[1]; break; case "a": values = value.Split(' '); if (values.Count() == 2 && values[0].Contains("rtpmap:")) // codecs' descriptions { this.PossibleCodecs.Add(values[1] + " (" + values[0].Split(':')[1] + ")"); } break; default: break; } line = reader.ReadLine(); } //Console.WriteLine("---------"); } }