This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

sip-client

0.0.2 • Public • Published

A very incomplete SIP Client for Node.js

Given I actually have no idea whether this is a "Client" or a "User-agent" (reading the RFCs drove me a bit mad), take the name with a grain of salt.

Installation

npm install sip-client

Usage

var SIPClient = require('sip-client');
var util = require('util');
 
// I suppose these are pretty self explanatory
var opts = {
    user: 'myUsername',
    password: 'password',
    host: 'some.sip.host.com',
    debug: false //unless you want to see HARDCORE SIP ACTION!
};
 
var client = new SIPClient(opts);
 
var uri = {
    schema: 'sip',
    host: opts.host,
    user: opts.user
};
var headers = {
    contact: "<sip:"+opts.host+":5060>",
    from: {
        name: 'A SIP User',
        uri: uri
    },
    to: {
        name: 'A SIP User',
        uri: uri
    }
};
 
var message = client.message('register', {host: opts.host}, headers);
message.send();
 
message.on('success', function(msg) {
    // You've been authenticated!
    client.on('invite', function(msg){
        // Now call your number, and magic happens
        var from = client.sip.parseUri(msg.headers.from.uri);
        util.log("The most handsome dude(ette), "+from.name+" at "+from.user);
        // outputs "The most handsome dude(ette), Some User at 31415926535"
    });
});
 

License

What the fuck Public License

As usual, licensed under the WTFPL.

Readme

Keywords

none

Package Sidebar

Install

npm i sip-client

Weekly Downloads

1

Version

0.0.2

License

WTFPL

Last publish

Collaborators

  • unrob