docs: AsteriskChannelImpl getChannelImplByName(String name)
      {
          Date dateOfCreation = null;
          AsteriskChannelImpl channel = null;
  
          if (name == null)
          {
              return null;
          }
  
          synchronized (channels)
          {
              for (AsteriskChannelImpl tmp : channels.values())
              {
                  if (name.equals(tmp.getName()))
                  {
                      // return the most recent channel or when dates are similar,
                      // the active one
                      if (dateOfCreation == null || tmp.getDateOfCreation().after(dateOfCreation)
                              || (tmp.getDateOfCreation().equals(dateOfCreation) && tmp.getState() != ChannelState.HUNGUP))
                      {
                          channel = tmp;
                          dateOfCreation = channel.getDateOfCreation();
                      }
                  }
              }
          }
          return channel;
      }