Giter Club home page Giter Club logo

drachtio-mw-registration-parser's Introduction

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]"
    }
   */
}) ;

drachtio-mw-registration-parser's People

Contributors

davehorton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.