From c635dc5d79427ae5cbaae428f0fc8721b0cf4b33 Mon Sep 17 00:00:00 2001 From: Denny Date: Sun, 31 Jul 2016 10:08:13 -0400 Subject: [PATCH] Updated call event details message for traffic channel rejects (no tuner, unknown frequency) to include the original call event details in addition to the traffic channel reject message. --- .../decode/state/TrafficChannelManager.java | 69 ++++++++++++++++--- 1 file changed, 58 insertions(+), 11 deletions(-) diff --git a/src/module/decode/state/TrafficChannelManager.java b/src/module/decode/state/TrafficChannelManager.java index 452d5680..37ebc3a7 100644 --- a/src/module/decode/state/TrafficChannelManager.java +++ b/src/module/decode/state/TrafficChannelManager.java @@ -33,9 +33,12 @@ import controller.channel.TrafficChannelEvent; public class TrafficChannelManager extends Module implements ICallEventProvider, IDecoderStateEventListener { - private final static Logger mLog = LoggerFactory.getLogger( TrafficChannelManager.class ); - - private int mTrafficChannelPoolMaximumSize = + private final static Logger mLog = LoggerFactory.getLogger( TrafficChannelManager.class ); + public static final String CHANNEL_START_REJECTED = "CHANNEL START REJECTED"; + public static final String NO_TUNER_AVAILABLE = "NO TUNER AVAILABLE"; + public static final String UNKNOWN_FREQUENCY = "UNKNOWN FREQUENCY"; + + private int mTrafficChannelPoolMaximumSize = DecodeConfiguration.TRAFFIC_CHANNEL_LIMIT_DEFAULT; private List mTrafficChannelPool = new ArrayList(); private Map mTrafficChannelsInUse = new ConcurrentHashMap(); @@ -56,13 +59,21 @@ public class TrafficChannelManager extends Module * Monitors call events and allocates traffic decoder channels in response * to traffic channel allocation call events. Manages a pool of reusable * traffic channel allocations. - * - * @param resourceManager - resource manager - * - * @param decodeConfiguration - decoder configuration to use for each + * + * @param channelModel containing channels currently in use + * + * @param channelProcessingManager + * + * @param decodeConfiguration - decoder configuration to use for each * traffic channel allocation. * * @param recordConfiguration - recording options for each traffic channel + * + * @param system label to use to describe the system + * + * @param site label to use to describe the site + * + * @param aliasListName designated for the channel * * @param trafficChannelTimeout - millisecond call timer limit used when an * end of call signalling event is not decoded. @@ -215,19 +226,55 @@ public class TrafficChannelManager extends Module else { callEvent.setCallEventType( CallEventType.CALL_DETECT ); - callEvent.setDetails( "CHANNEL START REJECTED" ); - } + + String details = callEvent.getDetails(); + + if(details == null || details.isEmpty()) + { + callEvent.setDetails(CHANNEL_START_REJECTED); + } + else if(!details.contains(CHANNEL_START_REJECTED)) + { + callEvent.setDetails(new StringBuilder(CHANNEL_START_REJECTED) + .append(" : ") + .append(callEvent.getDetails()).toString()); + } + } } else { callEvent.setCallEventType( CallEventType.CALL_DETECT ); - callEvent.setDetails( "NO TUNER AVAILABLE" ); + + String details = callEvent.getDetails(); + + if(details == null || details.isEmpty()) + { + callEvent.setDetails(NO_TUNER_AVAILABLE); + } + else if(!details.contains(NO_TUNER_AVAILABLE)) + { + callEvent.setDetails(new StringBuilder(NO_TUNER_AVAILABLE) + .append(" : ") + .append(callEvent.getDetails()).toString()); + } } } else { callEvent.setCallEventType( CallEventType.CALL_DETECT ); - callEvent.setDetails( "UNKNOWN FREQUENCY" ); + + String details = callEvent.getDetails(); + + if(details == null || details.isEmpty()) + { + callEvent.setDetails(UNKNOWN_FREQUENCY); + } + else if(!details.contains(UNKNOWN_FREQUENCY)) + { + callEvent.setDetails(new StringBuilder(UNKNOWN_FREQUENCY) + .append(" : ") + .append(callEvent.getDetails()).toString()); + } } final Listener listener = mCallEventListener;