Skip to content

#2018 P25 Phase 1 Now Playing Flickering Identifiers #2019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import io.github.dsheirer.identifier.talkgroup.TalkgroupIdentifier;
import io.github.dsheirer.log.LoggingSuppressor;
import io.github.dsheirer.message.IMessage;
import io.github.dsheirer.message.TimeslotMessage;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.module.decode.dmr.channel.DMRAbsoluteChannel;
import io.github.dsheirer.module.decode.dmr.channel.DMRChannel;
Expand Down Expand Up @@ -1459,14 +1460,22 @@ public String getActivitySummary()
{
StringBuilder sb = new StringBuilder();

boolean networkAdded = false;

if(mNetworkConfigurationMonitor != null)
{
sb.append(mNetworkConfigurationMonitor.getActivitySummary());
sb.append("\n\n");
sb.append(mTrafficChannelManager.getTalkerAliasManager().getAliasSummary());
networkAdded = true;
}
else

//Only add the talker alias summary to timeslot 1 activity summary since we aggregate across both timeslots.
if(getTimeslot() == TimeslotMessage.TIMESLOT_1)
{
if(networkAdded)
{
sb.append("\n\n");
}

sb.append(mTrafficChannelManager.getTalkerAliasManager().getAliasSummary());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import io.github.dsheirer.module.decode.p25.phase2.enumeration.ScrambleParameters;
import io.github.dsheirer.module.decode.p25.phase2.message.mac.MacOpcode;
import io.github.dsheirer.module.decode.p25.reference.ServiceOptions;
import io.github.dsheirer.module.decode.p25.reference.VoiceServiceOptions;
import io.github.dsheirer.module.decode.traffic.TrafficChannelManager;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.source.config.SourceConfigTuner;
Expand Down Expand Up @@ -729,27 +730,36 @@ public void processP1TrafficCallStart(long frequency, Identifier<?> talkgroup, I
{
P25TrafficChannelEventTracker tracker = getTracker(frequency, P25P1Message.TIMESLOT_1);

if(tracker != null)
//If the tracker is already started, it was for another call. Close it and recreate the event.
if(tracker != null && tracker.isStarted())
{
removeTracker(frequency, P25P1Message.TIMESLOT_1);
tracker = null;
}

DecodeEventType decodeEventType = getDecodeEventType(talkgroup, eki);

MutableIdentifierCollection mic = new MutableIdentifierCollection();
mic.update(talkgroup);
mic.update(radio);
mic.update(eki);

//Create a new event for the current call.
P25ChannelGrantEvent callEvent = P25ChannelGrantEvent.builder(decodeEventType, timestamp, serviceOptions)
.channelDescriptor(channelDescriptor)
.details("PHASE 1 CALL " + (serviceOptions != null ? serviceOptions : ""))
.identifiers(mic)
.build();
if(tracker != null)
{
tracker.addIdentifierIfMissing(talkgroup);
}
else
{
DecodeEventType decodeEventType = getDecodeEventType(talkgroup, eki);
MutableIdentifierCollection mic = new MutableIdentifierCollection();
mic.update(talkgroup);
mic.update(radio);
mic.update(eki);

//Create a new event for the current call.
P25ChannelGrantEvent callEvent = P25ChannelGrantEvent.builder(decodeEventType, timestamp, serviceOptions)
.channelDescriptor(channelDescriptor)
.details("PHASE 1 CALL " + (serviceOptions != null ? serviceOptions : ""))
.identifiers(mic)
.build();

tracker = new P25TrafficChannelEventTracker(callEvent);
addTracker(tracker, frequency, P25P1Message.TIMESLOT_1);
}

tracker = new P25TrafficChannelEventTracker(callEvent);
addTracker(tracker, frequency, P25P1Message.TIMESLOT_1);
broadcast(tracker);
}
finally
Expand Down Expand Up @@ -838,19 +848,22 @@ public void processP1TrafficCurrentUser(long frequency, Identifier identifier, l
* This is used primarily to add encryption, GPS, talker alias, etc. but can be used for any identifier update.
*
* @param frequency for the call event
* @param identifier to update within the event.
* @param identifiers to update within the event.
* @param timestamp for the update
*/
public void processP1TrafficCurrentUserIdentifiers(long frequency, List<Identifier> identifiers, long timestamp, String context)
public void processP1TrafficLDU1(long frequency, List<Identifier> identifiers, long timestamp, String context)
{
mLock.lock();

try
{
IChannelDescriptor channelDescriptor = null;

P25TrafficChannelEventTracker tracker = getTracker(frequency, P25P1Message.TIMESLOT_1);

if(tracker != null && tracker.isComplete())
{
channelDescriptor = tracker.getEvent().getChannelDescriptor();;
removeTracker(frequency, P25P1Message.TIMESLOT_1);
tracker = null;
}
Expand All @@ -871,6 +884,29 @@ public void processP1TrafficCurrentUserIdentifiers(long frequency, List<Identifi
tracker.updateDurationTraffic(timestamp);
broadcast(tracker);
}
else
{
MutableIdentifierCollection mic = new MutableIdentifierCollection(identifiers);
Identifier talkgroup = mic.getToIdentifier();
Identifier encryption = mic.getEncryptionIdentifier();

if(talkgroup != null && encryption instanceof EncryptionKeyIdentifier eki)
{
DecodeEventType decodeEventType = getDecodeEventType(talkgroup, eki);
//Create a new event for the current call.
ServiceOptions serviceOptions = (eki.isEncrypted() ? VoiceServiceOptions.createEncrypted() :
VoiceServiceOptions.createUnencrypted());
P25ChannelGrantEvent callEvent = P25ChannelGrantEvent.builder(decodeEventType, timestamp, serviceOptions)
.channelDescriptor(channelDescriptor)
.details("PHASE 1 CALL " + (eki.isEncrypted() ? eki.toString() : ""))
.identifiers(mic)
.build();

tracker = new P25TrafficChannelEventTracker(callEvent);
addTracker(tracker, frequency, P25P1Message.TIMESLOT_1);
broadcast(tracker);
}
}
}
finally
{
Expand Down
Loading
Loading