protected void setLocalDescriptor(String sdp) throws SdpException { this.localSdp = sdpFactory.createSessionDescription(sdp); }
protected void setLocalDescriptor(String sdp) throws SdpException { this.localSdp = sdpFactory.createSessionDescription(sdp); }
public static String getSdp(final String contentType, final byte[] data) throws SdpParseException { final String text = new String(data); String sdpResult = null; if (contentType.equalsIgnoreCase("application/sdp")) { final SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(text); sdpResult = sdp.toString(); } else { String boundary = contentType.split(";")[1].split("=")[1]; String[] parts = text.split(boundary); String sdpText = null; for (String part : parts) { if (part.contains("application/sdp")) { sdpText = part.replaceAll("Content.*", "").replaceAll("--", "").trim(); } } final SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(sdpText); sdpResult = sdp.toString(); } return sdpResult; }
private byte[] patchMedia(final String realIp, final byte[] data) throws UnknownHostException, SdpException { final String text = new String(data); final SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(text); final Connection connection = sdp.getConnection(); if(Connection.IN.equals(connection.getNetworkType()) && Connection.IP4.equals(connection.getAddressType())) { final InetAddress address = InetAddress.getByName(connection.getAddress()); final String ip = address.getHostAddress(); if(!IPUtils.isRoutableAddress(ip)) { connection.setAddress(realIp); } } return sdp.toString().getBytes(); }
public void processSdpAnswer(byte[] sdp) throws SdpPortManagerException { connection.debug("Processing SDP answer"); try { this.remoteSdp = sdpFactory.createSessionDescription(new String(sdp)); } catch (Exception e) { throw new SdpPortManagerException(e.getMessage()); } try { connection.fsm.signal(ConnectionTransition.MODIFY); } catch (UnknownTransitionException e) { throw new SdpPortManagerException(e.getMessage()); } }
public void processSdpAnswer(byte[] sdp) throws SdpPortManagerException { connection.debug("Processing SDP answer"); try { this.remoteSdp = sdpFactory.createSessionDescription(new String(sdp)); } catch (Exception e) { throw new SdpPortManagerException(e.getMessage()); } try { connection.fsm.signal(ConnectionTransition.MODIFY); } catch (UnknownTransitionException e) { throw new SdpPortManagerException(e.getMessage()); } }
private String convertSDP(String sdpString) throws SdpException { SdpFactory factory = javax.sdp.SdpFactory.getInstance(); SessionDescription sd = factory.createSessionDescription(sdpString); Vector<?> mediaDescriptions = sd.getMediaDescriptions(false); for (Object object : mediaDescriptions) { MediaDescription md = (MediaDescription) object; Vector<?> attributes = md.getAttributes(false); for (Object object2 : attributes) { Attribute attribute = (Attribute) object2; if (attribute.getName().compareToIgnoreCase("rtpmap") == 0) { attribute.setValue(attribute.getValue().toUpperCase()); } } } return sd.toString(); }
private String convertSDP(String sdpString) throws SdpException { SdpFactory factory = javax.sdp.SdpFactory.getInstance(); SessionDescription sd = factory.createSessionDescription(sdpString); Vector<?> mediaDescriptions = sd.getMediaDescriptions(false); for (Object object : mediaDescriptions) { MediaDescription md = (MediaDescription) object; Vector<?> attributes = md.getAttributes(false); for (Object object2 : attributes) { Attribute attribute = (Attribute) object2; if (attribute.getName().compareToIgnoreCase("rtpmap") == 0) { attribute.setValue(attribute.getValue().toUpperCase()); } } } return sd.toString(); }
@SuppressWarnings("unchecked") private static String patch(final byte[] data, final String externalIp) throws UnknownHostException, SdpException { final String text = new String(data); if(logger.isInfoEnabled()){ logger.info("About to patch "); logger.info("SDP :" + text); logger.info("Using externalIP: " + externalIp); } final SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(text); SessionName sessionName = SdpFactory.getInstance().createSessionName("Restcomm B2BUA"); sdp.setSessionName(sessionName); // Handle the connection at the session level. fix(sdp.getConnection(), externalIp); // Handle the connections at the media description level. final Vector<MediaDescription> descriptions = sdp.getMediaDescriptions(false); for (final MediaDescription description : descriptions) { fix(description.getConnection(), externalIp); } sdp.getOrigin().setAddress(externalIp); return sdp.toString(); }
String patchedSdp = null; if (contentType.equalsIgnoreCase("application/sdp")) { final SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(text); final SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(sdpText); fix(sdp.getConnection(), externalIp);
public SDP parse(final Buffer data) throws SdpException { try { final SessionDescription sdp = sdpFactory.createSessionDescription(data.toString()); return new SDPWrapper(sdp); } catch (final javax.sdp.SdpParseException e) { throw new SdpParseException(e.getLineNumber(), e.getCharOffset(), e.getMessage(), e.getCause()); } }
public SDP parse(final Buffer data) throws SdpException { try { final SessionDescription sdp = sdpFactory.createSessionDescription(data.toString()); return new SDPWrapper(sdp); } catch (final javax.sdp.SdpParseException e) { throw new SdpParseException(e.getLineNumber(), e.getCharOffset(), e.getMessage(), e.getCause()); } }
SdpParseException { SdpFactory sdpFactory = SdpFactory.getInstance(); SessionDescription sourceSessionDescription = sdpFactory.createSessionDescription(sourceSDP); SessionDescription destinationSessionDescription = sdpFactory.createSessionDescription(destinationSDP); Vector<MediaDescription> sourceMediaDescriptions = sourceSessionDescription.getMediaDescriptions(false); Vector<MediaDescription> destinationMediaDescriptions = destinationSessionDescription.getMediaDescriptions(false);
SessionDescription sourceSessionDescription = sdpFactory.createSessionDescription(sourceSDP); Vector<MediaDescription> sourceMediaDescriptions = sourceSessionDescription.getMediaDescriptions(false); Vector<AttributeField> attributes;
if (mdcx.getRemoteConnectionDescriptor()!=null) { try { sessionDescription = SdpFactory.getInstance().createSessionDescription(mdcx.getRemoteConnectionDescriptor().toString()); isNonValidSdp = sessionDescription.getSessionName().getValue().contains("NonValidSDP"); } catch (SdpParseException e) {
this.remoteSdp = sdpFactory.createSessionDescription(new String(sdp)); } catch (Exception e) { e.printStackTrace();
this.remoteSdp = sdpFactory.createSessionDescription(new String(sdp)); } catch (Exception e) { e.printStackTrace();
result = "s=Diameter GQ Parser" + System.getProperty("line.separator") + result; result = "v=0" + System.getProperty("line.separator") + result; SessionDescription resultDescription = sdpFactory.createSessionDescription(result); return resultDescription;
if (mdcx.getRemoteConnectionDescriptor() != null) { try { sessionDescription = SdpFactory.getInstance().createSessionDescription(mdcx.getRemoteConnectionDescriptor().toString()); isNonValidSdp = sessionDescription.getSessionName().getValue().contains("NonValidSDP"); } catch (SdpParseException e) {