SdpProcessor { public void exclude(String f, SessionDescription sdp) throws SdpException { Vector<MediaDescription> mds = sdp.getMediaDescriptions(false); for (MediaDescription m : mds) { Collection<RTPFormat> fmts = getRTPFormats(m); for (RTPFormat rtpFormat : fmts) { if (rtpFormat.description.toLowerCase().contains(f.toLowerCase())) { this.excludeFormat(rtpFormat.id, m); this.excludeAttribute(rtpFormat.id, m); } } } } 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 testExclude() throws Exception { sdpProcessor.exclude("G.729b", sdp); assertFalse("SDP should not contain G.729b", sdpProcessor.containsFormat("G.729b", sdp)); }