@Test
  public void testDlcx() {
    MgcpEvent evt = (MgcpEvent) mgcpProvider.createEvent(MgcpEvent.REQUEST, address);
    MgcpRequest msg = (MgcpRequest) evt.getMessage();

    msg.setCommand(new Text("DLCX"));
    msg.setEndpoint(new Text("test@localhost:2427"));
    msg.setTxID(1);

    Action action = selector.getAction(evt);
    assertTrue("Unexpected action", action instanceof DeleteConnectionCmd);
  }
Пример #2
0
    private void deleteForEndpoint(MgcpRequest request) {
      // getting endpoint name
      request.getEndpoint().divide('@', endpointName);
      // searching endpoint
      try {
        int n = transaction().find(localName, endpoints);
        if (n == 0) {
          throw new MgcpCommandException(
              MgcpResponseCode.ENDPOINT_NOT_AVAILABLE, new Text("Endpoint not available"));
        }
      } catch (UnknownEndpointException e) {
        throw new MgcpCommandException(
            MgcpResponseCode.ENDPOINT_UNKNOWN, new Text("Endpoint not available"));
      }

      // extract found endpoint
      endpoint = endpoints[0];
      endpoint.deleteAllConnections();
    }