A sip uri parser written with using antlr
The grammar of the sip uri is based on the RFC-3261 with some minor exceptions.
A typical sip-uri takes up the form
sip:[email protected]:80;uriparam1=urivalue1;uriparam2?headerkey1=headerValue1
The library parses this sip uri and returns a java class SipUriInfo. It has following fields.
private boolean isSips;
private String userInfo;
private String host;
private int port = -1;
private Map<String, String> uriParameters;
private Map<String, String> headers;
// to parse sip uri
SipUriInfo info = SipUtils.parseSipUri("sip:[email protected]:80;uriparam1=urivalue1;uriparam2?headerkey1=headerValue1");
// to parse sips uri
SipUriInfo info = SipUtils.parseSipsUri("sips:[email protected]:80;uriparam1=urivalue1;uriparam2?headerkey1=headerValue1");
For more examples see TestSipUtils
<dependency>
<groupId>com.github.hemantsonu20</groupId>
<artifactId>sip-parser-antlr</artifactId>
<version>1.0.0</version>
</dependency>
1.0.0 published on July 13th 2016