Codota Logo
StringMsgParser
Code IndexAdd Codota to your IDE (free)

How to use
StringMsgParser
in
gov.nist.javax.sip.parser

Best Java code snippets using gov.nist.javax.sip.parser.StringMsgParser (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: org.jitsi/jain-sip-ri-ossonly

/**
 * Create a response from a string
 *
 * @param responseString --
 *            string from which to create the message null string returns an
 *            empty message.
 *
 */
public Response createResponse(String responseString)
    throws java.text.ParseException {
  if (responseString == null)
    return new SIPResponse();
  StringMsgParser smp = new StringMsgParser();
  SIPMessage sipMessage = smp.parseSIPMessage(responseString.getBytes(), true, false, null);
  if (!(sipMessage instanceof SIPResponse))
    throw new ParseException(responseString, 0);
  return (SIPResponse) sipMessage;
}
origin: org.jitsi/jain-sip-ri-ossonly

/** Create and return a list of headers.
 *@param headers -- list of headers.
 *@throws ParseException -- if a parse exception occurs or a List
 * of that type of header is not alowed.
 *@return a List containing the headers.
 */
public java.util.List createHeaders(String headers)
  throws java.text.ParseException {
  if (headers == null)
    throw new NullPointerException("null arg!");
  StringMsgParser smp = new StringMsgParser();
  SIPHeader shdr = smp.parseSIPHeader(headers);
  if (shdr instanceof SIPHeaderList)
    return (SIPHeaderList) shdr;
  else
    throw new ParseException(
      "List of headers of this type is not allowed in a message",
      0);
}
origin: org.jitsi/jain-sip-ri-ossonly

/** create a sip uri.
 *
 *@param uri -- the uri to parse.
 */
public javax.sip.address.SipURI createSipURI(String uri) throws ParseException {
  if (uri == null)
    throw new NullPointerException("null URI");
  try {
    StringMsgParser smp = new StringMsgParser();
    SipUri sipUri = smp.parseSIPUrl(uri);
    return (SipURI) sipUri;
  } catch (ParseException ex) {
    throw new ParseException(ex.getMessage(), 0);
  }
}
origin: org.jitsi/jain-sip-ri-ossonly

currentLine = trimEndOfLine(currentLine);
     processHeader(currentHeader, message, parseExceptionListener, msgBuffer);
    message = processFirstLine(currentLine, parseExceptionListener, msgBuffer);
  } else {
    char firstChar = currentLine.charAt(0);
         processHeader(currentHeader, message, parseExceptionListener, msgBuffer);
origin: org.mobicents.javax.sip/mobicents-jain-sip-ext

@Override
public SIPMessage parseSIPMessage(byte[] msgBuffer, boolean readBody, boolean strict, ParseExceptionListener parseExceptionListener) throws ParseException {	
  return super.parseSIPMessage(msgBuffer, readBody, strict, parseExceptionListener);
}

origin: org.jitsi/jain-sip-ri-ossonly

/**
 * Creates a TelURL based on given URI string. The  '+' should
 * not be included in the phoneNumber string argument. If scheme is not present, it will be added.
 *
 * @param uri - the new string value of the phoneNumber.
 * @throws URISyntaxException if the URI string is malformed.
 */
public javax.sip.address.TelURL createTelURL(String uri)
  throws ParseException {
  if (uri == null)
    throw new NullPointerException("null url");
  String telUrl = null;
  if(uri.startsWith("tel:"))
  {
    telUrl = uri;
  }else
  {
    telUrl = "tel:" + uri;
  }
  try {
    StringMsgParser smp = new StringMsgParser();
    TelURLImpl timp = (TelURLImpl) smp.parseUrl(telUrl);
    return (TelURL) timp;
  } catch (ParseException ex) {
    throw new ParseException(ex.getMessage(), 0);
  }
}

origin: org.jitsi/jain-sip-ri-ossonly

/**
 * Creates an Address with the new address string value. The address
 * string is parsed in order to create the new Address instance. Create
 * with a String value of "*" creates a wildcard address. The wildcard
 * can be determined if
 * <code>((SipURI)Address.getURI).getUser() == *;</code>.
 *
 * @param address - the new string value of the address.
 * @throws ParseException which signals that an error has been reached
 * unexpectedly while parsing the address value.
 */
public javax.sip.address.Address createAddress(String address)
  throws java.text.ParseException {
  if (address == null)
    throw new NullPointerException("null address");
  if (address.equals("*")) {
    AddressImpl addressImpl = new AddressImpl();
    addressImpl.setAddressType(AddressImpl.WILD_CARD);
    SipURI uri = new SipUri();
    uri.setUser("*");
    addressImpl.setURI( uri );
    return addressImpl;
  } else {
    StringMsgParser smp = new StringMsgParser();
    return smp.parseAddress(address);
  }
}
origin: org.jitsi/jain-sip-ri-ossonly

public MessageParser createMessageParser(SIPTransactionStack stack) {	
  return new StringMsgParser();
}
origin: org.mobicents.javax.sip/mobicents-jain-sip-ext

@Override
protected void processHeader(String header, SIPMessage message, ParseExceptionListener parseExceptionListener, byte[] msgBuffer)
    throws ParseException {
  String headerName = Lexer.getHeaderName(header);        
  if (headerName == null)
    throw new ParseException("The header name or value is null", 0);
  
  // logic to process headers only if they are present in the list of headers to parse from a given stack property
  if(headersToParse.contains(headerName.toLowerCase())) {
    super.processHeader(header, message, parseExceptionListener, msgBuffer);
  } else {
    ((SelectiveMessage) message).addHeaderNotParsed(headerName, header);
  }
}

origin: org.jitsi/jain-sip-ri-ossonly

    "false").equalsIgnoreCase("true");
StringMsgParser
    .setComputeContentLengthFromMessage(computeContentLength);
origin: org.jitsi/jain-sip-ri-ossonly

rxBuffer.compact();
try {
  SIPMessage m = parser.parseSIPMessage( msg, true, true, this );
  this.processMessage( m, rxTime );
  rxTime = 0;    // reset for next message
origin: org.jitsi/jain-sip-ri-ossonly

StringMsgParser smp = new StringMsgParser();
  exHandler = parseExceptionListener;
SIPMessage sipMessage = smp.parseSIPMessage(requestString.getBytes(), true, this.strict, exHandler);
origin: org.jitsi/jain-sip-ri-ossonly

StringMsgParser smp = new StringMsgParser();
SIPHeader sipHeader = smp.parseSIPHeader(headerText.trim());
if (sipHeader instanceof SIPHeaderList) {
  if (((SIPHeaderList) sipHeader).size() > 1) {
origin: sip3io/tapir

public boolean parse() {
  try {
    this.msg = new StringMsgParser().parseSIPMessage(payload.getBytes(), true, false, null);
  } catch (ParseException e) {
    return false;
  }
  if (msg == null) {
    return false;
  }
  try {
    this.callId = msg.getCallId().getCallId();
    this.caller = HeaderAddressUtil.parseUser(msg.getFromHeader());
    this.callee = HeaderAddressUtil.parseUser(msg.getToHeader());
    if (msg instanceof SIPRequest) {
      SIPRequest r = (SIPRequest) msg;
      this.method = r.getMethod();
      this.isRequest = true;
    } else {
      SIPResponse r = (SIPResponse) msg;
      this.method = String.valueOf(r.getStatusCode());
      this.isRequest = false;
    }
  } catch (Exception e) {
    return false;
  }
  return true;
}
gov.nist.javax.sip.parserStringMsgParser

Javadoc

Parse SIP message and parts of SIP messages such as URI's etc from memory and return a structure. Intended use: UDP message processing. This class is used when you have an entire SIP message or SIPHeader or SIP URL in memory and you want to generate a parsed structure from it. For SIP messages, the payload can be binary or String. If you have a binary payload, use parseSIPMessage(byte[]) else use parseSIPMessage(String) The payload is accessible from the parsed message using the getContent and getContentBytes methods provided by the SIPMessage class. If SDP parsing is enabled using the parseContent method, then the SDP body is also parsed and can be accessed from the message using the getSDPAnnounce method. Currently only eager parsing of the message is supported (i.e. the entire message is parsed in one feld swoop).

Most used methods

  • parseSIPMessage
    Parse a buffer containing a single SIP Message where the body is an array of un-interpreted bytes. T
  • <init>
  • processHeader
  • parseAddress
    Parse an address (nameaddr or address spec) and return and address structure.
  • parseSIPHeader
    Parse an individual SIP message header from a string.
  • parseSIPUrl
    Parse a SIP url from a string and return a URI structure for it.
  • parseUrl
    Parse a uri from a string and return a URI structure for it.
  • processFirstLine
  • setComputeContentLengthFromMessage
  • trimEndOfLine

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getContentResolver (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now