@babblevoice/babble-drachtio-callmanager 1.6.5 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/call.js CHANGED
@@ -1181,9 +1181,13 @@ class call {
1181
1181
  let authorization = this._auth.parseauthheaders( this._req )
1182
1182
 
1183
1183
  if( undefined === callmanager.options.userlookup ) {
1184
- this._promises.reject.auth( "no userlookup function provided")
1184
+ console.trace( "no userlookup function provided" )
1185
+ this._promises.reject.auth()
1185
1186
  this._promises.resolve.auth = false
1186
1187
  this._promises.reject.auth = false
1188
+ if( this._timers.auth ) clearTimeout( this._timers.auth )
1189
+ this._timers.auth = false
1190
+
1187
1191
  return
1188
1192
  }
1189
1193
 
@@ -1922,6 +1926,7 @@ class call {
1922
1926
 
1923
1927
  this.detach()
1924
1928
  if( this.channels.audio ) this.channels.audio.unmix()
1929
+ if( othercall.channels.audio ) othercall.channels.audio.unmix()
1925
1930
  if( othercall.channels.audio && this.moh ) othercall.channels.audio.play( this.moh )
1926
1931
 
1927
1932
  res.send( 202 )
@@ -69,13 +69,15 @@ class callmanager {
69
69
 
70
70
  /**
71
71
  Register callback to handle newcall events.
72
- @param {string} event - the event type - only "call" supported
72
+ @param {string} event - the event type - only "call.in" supported
73
73
  @param {oncallCallback} cb
74
74
  */
75
75
  on( event, cb ) {
76
- if( "call" === event ) {
76
+ if( "call" === event || "call.in" === event /* prefered - more descriptive */ ) {
77
77
  this.onnewcall = cb
78
+ return
78
79
  }
80
+ this.options.em.on( event, cb )
79
81
  }
80
82
 
81
83
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {