@Test public void testParseRqntRequest() throws MgcpParseException { StringBuilder builder = new StringBuilder(); builder.append("RQNT 147483656 mobicents/ivr/1@127.0.0.1:2427 MGCP 1.0").append(System.lineSeparator()); builder.append("N:restcomm@127.0.0.1:2727").append(System.lineSeparator()); builder.append("X:1").append(System.lineSeparator()); builder.append("S:AU/pa(an=http: builder.append("R:AU/oc(N),AU/of(N)").append(System.lineSeparator()); MgcpMessageParser parser = new MgcpMessageParser(); MgcpRequest request = parser.parseRequest(builder.toString()); assertEquals(MgcpRequestType.RQNT, request.getRequestType()); assertEquals(147483656, request.getTransactionId()); assertEquals("mobicents/ivr/1@127.0.0.1:2427", request.getEndpointId()); assertEquals("1", request.getParameter(MgcpParameterType.REQUEST_ID)); assertEquals("AU/pa(an=http: assertEquals("AU/oc(N),AU/of(N)", request.getParameter(MgcpParameterType.REQUESTED_EVENTS)); }
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);  }