@babblevoice/babble-drachtio-callmanager 3.6.17 → 3.6.18

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 +14 -6
  2. package/package.json +1 -1
package/lib/call.js CHANGED
@@ -1437,12 +1437,20 @@ class call {
1437
1437
  /* we have been requested to auth - so set our state to unauthed */
1438
1438
  this.state.authed = false
1439
1439
 
1440
- /* this will never work as if we get here we will never have sent out a nonce and we don't
1441
- share between registrar and call processing, leave out so we send an auth request */
1442
- //if( this._auth.has( this._req ) ) {
1443
- /* If the client has included an auth header check it immediatly */
1444
- // if( this._onauth( this._req, this._res ) ) return
1445
- //}
1440
+ /* if we are supplied with an auth header that means it is getting the auth nonce elsewhere - our registrar. */
1441
+ if( this._auth.has( this._req ) ) {
1442
+ /* if the client has supplied the header */
1443
+ if( callmanager.options.registrar && !this._auth.equal( sipauth.parseauthheaders( this._req ) ) ) {
1444
+ const auth = callmanager.options.registrar.getauth( this._req )
1445
+ if( auth ) {
1446
+ this._auth = auth
1447
+ }
1448
+ }
1449
+
1450
+ /* whatever the outcome above, we must immediatly check */
1451
+ await this._onauth( this._req, this._res )
1452
+ return
1453
+ }
1446
1454
 
1447
1455
  this._timers.auth = setTimeout( () => {
1448
1456
  this._promises.reject.auth( new SipError( hangupcodes.REQUEST_TIMEOUT, "Auth timed out" ) )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "3.6.17",
3
+ "version": "3.6.18",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {