Skip to content

hemantsonu20/sip-parser-antlr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sip-parser-antlr

Overview

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:hemant@github.com: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;

Examples

// to parse sip uri
SipUriInfo info = SipUtils.parseSipUri("sip:hemant@github.com:80;uriparam1=urivalue1;uriparam2?headerkey1=headerValue1");

// to parse sips uri
SipUriInfo info = SipUtils.parseSipsUri("sips:hemant@github.com:80;uriparam1=urivalue1;uriparam2?headerkey1=headerValue1");

For more examples see TestSipUtils

Maven Artifact

<dependency>
    <groupId>com.github.hemantsonu20</groupId>
    <artifactId>sip-parser-antlr</artifactId>
    <version>1.0.0</version>
</dependency>

Latest Published Version

1.0.0 published on July 13th 2016

License

Apache License 2.0