npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

drachtio-mw-registration-parser

v0.1.0

Published

drachtio middleware for parsing SIP Authorization header

Downloads

591

Readme

drachtio-mw-registration-parser Build Status NPM version

drachtio middleware for parsing SIP registration messages. This middleware no affect on SIP requests other than REGISTER; for incoming REGISTER messages it will augment the passed req object by attaching a registration property containing useful details about the register (or unregister) request.

Usage

const Srf = require('drachtio-srf');
const srf = new Srf();
const regParser = require('drachtio-mw-registration-parser') ;

srf.connect({...}) ;

srf.use(regParser) ;

srf.register((req, res) => {
  console.log(req.registration) ;
  /*
    REGISTER sip:drachtio.org SIP/2.0
    Via: SIP/2.0/UDP 10.128.77.170:5060;branch=z9hG4bK1sansay2357115221rdb9676
    To: <sip:[email protected]>
    From: "503" <sip:[email protected]>;tag=sansay2357115221rdb9676
    Call-ID: [email protected]
    CSeq: 1 REGISTER
    Contact: <sip:[email protected]:5060;transport=udp;jtr=5882-1>;expires=3600
    Authorization: Digest username="167356",realm="sip.drachtio.org",nonce="4fe61e6b-ccb8-47c8-8302-27be8f0b80fd",uri="sip:72.1.46.10:5061",algorithm=MD5,response="9a75860d5f13d8e1067a1e5f5c24e261",qop=auth,nc=000003e9,cnonce="cf1bb785"
    User-Agent: Cisco/SPA525G2-7.6.1(ES_RC01)
    Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
    Max-Forwards: 69
    Content-Length: 0
    
    console.log =>
    {
      type":"register",
      "expires":3600,
      "contact":[
        {
          "uri":"sip:[email protected]:5060;transport=udp;jtr=5882-1",
          "params":{"expires":"3600"}
        }
      ],
      "aor":"sip:[email protected]"
    }
   */
}) ;