Parses SIP URL and returns user portion only
npm install parse-sip-uriThis package parses a SIP URI. Ex. sip:+12345678900@somedomain.com;transport=tcp
In some projects, it's necessary to derive information from a SIP URI. While it's easy enough to do this within the code, I wanted a package to use instead of continually rewritting the same lines.
The function returns an object with the parsed data.
No dependencies
npm i parse-sip-uri
``const parseSipUri = require('parse-sip-uri').parseSipUri;
const obj = parseSipUri("sip:1234512345@domain.com");
console.log(obj);
{
Protocol: 'sip',
User: '1234512345',
Domain: 'domain.com',
TransportProtocol: 'udp',
E164Number: '+11234512345',
encodedURIComponentNumber: '%2B11234512345'
}
``
Contributors names and contact info
Michael Herman - michael@thehermans.org
* 1.0
* Initial Release
* 1.1
* Changed to return object instead of single value