public UserPacket(bool data, bool group) : base(PacketType.GroupVoiceCall) { if (data == true) { if (group == false) { this.type = PacketType.PrivateDataCall; } else { this.type = PacketType.GroupDataCall; } } else if (group == false) { this.type = PacketType.PrivateVoiceCall; } this.rtp = new RTPData(93); }
public UserPacket(byte[] data) : base(data) { this.src = new RadioID(data, 6, 3); this.dest = new RadioID(data, 9, 3); this.calltype = data[12]; //This seems to be some kind of group tag to help group packets together this.groupTag = (UInt32)((data[13] << 24) | (data[14] << 16) | (data[15] << 8) | data[16]); this.encrypted = ((data[17] & 0x80) != 0); this.end = ((data[17] & 0x40) != 0); this.timeslot = ((data[17] & 0x20) != 0); this.phone = ((data[17] & 0x10) != 0); //RTP Data... this.rtp = new RTPData(data, 18); //Burst data... if (this.rtp.Extension) { throw new Exception("Have a header extenstion! Don't know how to process packet!"); } else { this.burst = Burst.Decode(data.Skip(30).ToArray()); } }