@babblevoice/babble-drachtio-callmanager 3.6.18 → 3.7.1

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.
Files changed (2) hide show
  1. package/lib/call.js +13 -2
  2. package/package.json +1 -1
package/lib/call.js CHANGED
@@ -199,6 +199,10 @@ class call {
199
199
  "picked": false
200
200
  }
201
201
 
202
+ this.counters = {
203
+ "newuac": 0
204
+ }
205
+
202
206
  /**
203
207
  * Protected for this module
204
208
  */
@@ -1452,15 +1456,21 @@ class call {
1452
1456
  return
1453
1457
  }
1454
1458
 
1459
+ const authtimeoutms = 10000
1455
1460
  this._timers.auth = setTimeout( () => {
1456
- this._promises.reject.auth( new SipError( hangupcodes.REQUEST_TIMEOUT, "Auth timed out" ) )
1461
+ /* something has overtaken events and cleaned us up already */
1462
+ if( !this._promises.reject ) return
1463
+ if( !this._promises.reject.auth ) return
1464
+
1465
+ const rej = this._promises.reject.auth
1457
1466
  this._promises.resolve.auth = undefined
1458
1467
  this._promises.reject.auth = undefined
1459
1468
  this._timers.auth = undefined
1460
1469
 
1470
+ rej( new SipError( hangupcodes.REQUEST_TIMEOUT, "Auth timed out" ) )
1461
1471
  this.hangup( hangupcodes.REQUEST_TIMEOUT )
1462
1472
 
1463
- }, 50000 )
1473
+ }, authtimeoutms )
1464
1474
 
1465
1475
  const authpromise = new Promise( ( resolve, reject ) => {
1466
1476
  this._promises.resolve.auth = resolve
@@ -3751,6 +3761,7 @@ class call {
3751
3761
  newcall.type = "uac"
3752
3762
 
3753
3763
  if( options.parent ) {
3764
+ options.parent.counters.newuac += 1
3754
3765
  options.parent.adopt( newcall )
3755
3766
  }
3756
3767
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "3.6.18",
3
+ "version": "3.7.1",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {