Prefer talkgroup ID over radio ID for Calls (#1227)

This commit is contained in:
Doug Hoffman
2022-05-07 06:51:27 -04:00
committed by GitHub
parent 3c58e98788
commit f4ab46b79d

View File

@@ -447,28 +447,20 @@ public class BroadcastifyCallBroadcaster extends AbstractAudioBroadcaster<Broadc
*/ */
private static String getTo(AudioRecording audioRecording) private static String getTo(AudioRecording audioRecording)
{ {
List<Identifier> toIdentifiers = audioRecording.getIdentifierCollection().getIdentifiers(Role.TO); Identifier identifier = audioRecording.getIdentifierCollection().getToIdentifier();
//Format a patch group first, if there are multiples if(identifier instanceof PatchGroupIdentifier patchGroupIdentifier)
for(Identifier identifier: toIdentifiers)
{ {
if(identifier instanceof PatchGroupIdentifier patchGroupIdentifier) return format(patchGroupIdentifier);
{
return format(patchGroupIdentifier);
}
} }
else if(identifier instanceof TalkgroupIdentifier talkgroupIdentifier)
for(Identifier identifier: toIdentifiers)
{ {
if(identifier instanceof TalkgroupIdentifier talkgroupIdentifier) return String.valueOf(RadioReferenceDecoder.convertToRadioReferenceTalkgroup(talkgroupIdentifier.getValue(),
{ talkgroupIdentifier.getProtocol()));
return String.valueOf(RadioReferenceDecoder.convertToRadioReferenceTalkgroup(talkgroupIdentifier.getValue(), }
talkgroupIdentifier.getProtocol())); else if(identifier instanceof RadioIdentifier radioIdentifier)
} {
else if(identifier instanceof RadioIdentifier radioIdentifier) return radioIdentifier.getValue().toString();
{
return radioIdentifier.getValue().toString();
}
} }
return "0"; return "0";