SdpProcessor { public boolean containsFormat(String format, SessionDescription sdp) throws SdpException { Vector<MediaDescription> mds = sdp.getMediaDescriptions(false); for (MediaDescription m : mds) { Vector<Attribute> attributes = m.getAttributes(false); for (Attribute a : attributes) { if (a.getName().equalsIgnoreCase("rtpmap") && a.getValue().toLowerCase().contains(format.toLowerCase())) { return true; } } } return false; } SdpProcessor(); boolean containsFormat(String format, SessionDescription sdp); boolean containsMedia(String media, SessionDescription sdp); void exclude(String f, SessionDescription sdp); void excludeAttribute(String id, MediaDescription m); boolean checkForMinimalOffer(SessionDescription sdp);  }
@Test public void testContainsFormat() throws Exception { assertTrue("Excepted format G.729b", sdpProcessor.containsFormat("G.729b", sdp)); assertTrue("Excepted format G.729b", sdpProcessor.containsFormat("g.729b", sdp)); }