コード例 #1
0
  @Override
  public void consume(DataUnit dataUnit) {
    super.consume(dataUnit);
    if (!dataUnit.isIntact()) {
      return;
    }

    switch (dataUnit.getNid().getDuid().getId()) {
      case Duid.ID_TRUNK_SIGNALING:
        ((TrunkSignalDataUnit) dataUnit)
            .getBlocks()
            .forEach(
                block -> {
                  channelIdMap.consume(block);

                  switch (block.getOpCode()) {
                    case TrunkSignalBlock.GROUP_VOICE_CHAN_GRANT:
                      followGroupChannelGrant((GroupVoiceChannelGrant) block);
                      break;

                    case TrunkSignalBlock.GROUP_VOICE_CHAN_GRANT_UPDATE_EXPLICIT:
                      followGroupChannelGrantExplicit((GroupVoiceChannelGrantUpdateExplicit) block);
                      break;
                  }
                });
        break;
    }
  }
コード例 #2
0
  private void followGroupChannelGrantExplicit(GroupVoiceChannelGrantUpdateExplicit grant) {
    Integer channelId = grant.getTransmitId();
    Optional<IdUpdateBlock> idBlock = channelIdMap.getBlockForId(channelId);

    if (!idBlock.isPresent()) {
      log.debug(
          followRequest.getChannelId()
              + " unable to process voice channel grant, id map missing "
              + channelId);
    } else {
      sendRequest(buildCaptureRequest(grant, grant.getDownlinkFreq(idBlock.get())));
    }
  }