This is a simple SIP implementation with WebSocket as available transport. This project is a fork from sip.js
- Clone this project.
git clone git://github.com/bokuwakyuu/sip-websocket.git
- Install dependencies.
npm install
By putting http server to initialization option will enable sip server to listen to websocket request on port defined by http server.
var http = require('http');
var sip = require('sip-websocket');
var server = http.createServer(function(request, response) {
console.log((new Date()) + ' Received request for ' + request.url);
response.writeHead(404);
response.end();
});
server.listen(8080, function() {
console.log((new Date()) + ' Server is listening on port 8080');
});
sip.start({ websocket : server }, function(request) {});
You could also use express framework.
var express = require('express');
var app = express.createServer();
app.listen(8080, , function() {
console.log((new Date()) + ' Server is listening on port 8080');
});
sip.start({ websocket : server }, function(request) {});
See LICENSE