Comparing version
@@ -20,3 +20,11 @@ const debug = require('debug') ('sipware:router') | ||
// relaying | ||
// incoming | ||
this.$ins = []; | ||
this.ins = this.createChain([() => {}]); | ||
// outgoing | ||
this.$outs = []; | ||
this.outs = this.createChain([() => {}]); | ||
// relay | ||
this.$relays = []; | ||
@@ -141,3 +149,16 @@ this.relays = this.createChain([() => {}]); | ||
// relay is separate chain | ||
in(ins) { | ||
var chain = this.$ins; | ||
this.$ins.push(ins.bind(this)); | ||
this.ins = this.createChain(chain); | ||
} | ||
out(out) { | ||
var chain = this.$outs; | ||
this.$outs.push(out.bind(this)); | ||
this.outs = this.createChain(chain); | ||
} | ||
relay(relay) { | ||
@@ -144,0 +165,0 @@ var chain = this.$relays; |
@@ -67,3 +67,3 @@ { | ||
"optionalDependencies": {}, | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"directories": { | ||
@@ -70,0 +70,0 @@ "lib": "lib" |
126487
0.3%3091
0.49%