Ejemplo n.º 1
0
  void handleUnparkedCallEvent(UnparkedCallEvent event) {
    // Only bristuffed versions: AsteriskChannelImpl channel =
    // getChannelImplById(event.getUniqueId());
    final AsteriskChannelImpl channel = getChannelImplByNameAndActive(event.getChannel());

    if (channel == null) {
      logger.info("Ignored UnparkedCallEvent for unknown channel " + event.getChannel());
      return;
    }

    Extension wasParkedAt = channel.getParkedAt();

    if (wasParkedAt == null) {
      logger.info("Ignored UnparkedCallEvent as the channel was not parked");
      return;
    }

    synchronized (channel) {
      channel.setParkedAt(null);
    }
    logger.info(
        "Channel "
            + channel.getName()
            + " is unparked (moved away) from "
            + wasParkedAt.getExtension());
  }
Ejemplo n.º 2
0
  void handleParkedCallEvent(ParkedCallEvent event) {
    // Only bristuffed versions: AsteriskChannelImpl channel =
    // getChannelImplById(event.getUniqueId());
    AsteriskChannelImpl channel = getChannelImplByNameAndActive(event.getChannel());

    if (channel == null) {
      logger.info("Ignored ParkedCallEvent for unknown channel " + event.getChannel());
      return;
    }

    synchronized (channel) {
      // todo The context should be "parkedcalls" or whatever has been configured in features.conf
      // unfortunately we don't get the context in the ParkedCallEvent so for now we'll set it to
      // null.
      Extension ext = new Extension(null, event.getExten(), 1);
      channel.setParkedAt(ext);
      logger.info(
          "Channel " + channel.getName() + " is parked at " + channel.getParkedAt().getExtension());
    }
  }