@Test public void testParseNtfyRequest() throws MgcpParseException { StringBuilder builder = new StringBuilder(); builder.append("NTFY 2 mobicents/ivr/1@127.0.0.1:2427").append(System.lineSeparator()); builder.append("N:restcomm@127.0.0.1:2727").append(System.lineSeparator()); builder.append("O:AU/oc(rc=100)").append(System.lineSeparator()); builder.append("X:1").append(System.lineSeparator()); MgcpMessageParser parser = new MgcpMessageParser(); MgcpRequest request = parser.parseRequest(builder.toString()); assertEquals(MgcpRequestType.NTFY, request.getRequestType()); assertEquals(2, request.getTransactionId()); assertEquals("mobicents/ivr/1@127.0.0.1:2427", request.getEndpointId()); assertEquals("1", request.getParameter(MgcpParameterType.REQUEST_ID)); assertEquals("AU/oc(rc=100)", request.getParameter(MgcpParameterType.OBSERVED_EVENT)); }
public MgcpRequest parseRequest(byte[] data, int offset, int length) throws MgcpParseException { return parseRequest(new String(data, offset, length)); }
MgcpMessageParser { public MgcpRequest parseRequest(byte[] data, int offset, int length) throws MgcpParseException { return parseRequest(new String(data, offset, length)); } }
MgcpMessageParser { public MgcpRequest parseRequest(byte[] data, int offset, int length) throws MgcpParseException { return parseRequest(new String(data, offset, length)); } MgcpMessageParser(); }
MgcpMessageParser { public MgcpRequest parseRequest(byte[] data, int offset, int length) throws MgcpParseException { return parseRequest(new String(data, offset, length)); } MgcpMessageParser(); MgcpRequest parseRequest(byte[] data, int offset, int length); MgcpRequest parseRequest(String message); MgcpResponse parseResponse(byte[] data, int offset, int length); MgcpResponse parseResponse(String message); }
MgcpMessageParser { public MgcpRequest parseRequest(byte[] data, int offset, int length) throws MgcpParseException { return parseRequest(new String(data, offset, length)); } MgcpMessageParser(); MgcpRequest parseRequest(byte[] data, int offset, int length); MgcpRequest parseRequest(String message); MgcpResponse parseResponse(byte[] data, int offset, int length); MgcpResponse parseResponse(String message);  }