@babblevoice/babble-drachtio-callmanager 3.7.0 → 3.7.2

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 +30 -25
  2. package/package.json +1 -1
package/lib/call.js CHANGED
@@ -543,6 +543,10 @@ class call {
543
543
  return "uas"==this.type?"inbound":"outbound"
544
544
  }
545
545
 
546
+ /**
547
+ *
548
+ * @param { object } startingpoint
549
+ */
546
550
  #overridecallerid( startingpoint ) {
547
551
 
548
552
  if( this.options.callerid ) {
@@ -552,6 +556,10 @@ class call {
552
556
  }
553
557
  }
554
558
 
559
+ /**
560
+ *
561
+ * @param { object } startingpoint
562
+ */
555
563
  #overridecalledid( startingpoint ) {
556
564
  startingpoint.privacy = this.options.privacy
557
565
 
@@ -653,6 +661,10 @@ class call {
653
661
  this.#fromremoteheaders( startingpoint )
654
662
  }
655
663
 
664
+ /**
665
+ *
666
+ * @returns { object }
667
+ */
656
668
  #callerid() {
657
669
  const startingpoint = {
658
670
  "name": "",
@@ -699,6 +711,10 @@ class call {
699
711
  return this.#callerid()
700
712
  }
701
713
 
714
+ /**
715
+ *
716
+ * @returns { object }
717
+ */
702
718
  #calledid() {
703
719
  const startingpoint = {
704
720
  "name": "",
@@ -710,24 +726,7 @@ class call {
710
726
  }
711
727
 
712
728
  if( "uas" == this.type ) this.#calledidforuas( startingpoint )
713
- else {
714
- if( !this.options.partycalled ) this.#calledidforuac( startingpoint )
715
-
716
- const other = this.other
717
-
718
- if( other ) {
719
- if( "uas" == other.type ) {
720
- if( this.options.partycalled ) {
721
- other.#calleridforuas( startingpoint )
722
- } else {
723
- other.#calledidforuas( startingpoint )
724
- }
725
- } else {
726
- other.#calledidforuac( startingpoint )
727
- }
728
- other.#overridecalledid( startingpoint )
729
- }
730
- }
729
+ else if( !this.options.partycalled ) this.#calledidforuac( startingpoint )
731
730
 
732
731
  this.#overridecalledid( startingpoint )
733
732
 
@@ -735,11 +734,11 @@ class call {
735
734
  }
736
735
 
737
736
  /**
738
- * Returns the called object. i.e.
739
- * If we are inbound then this is the destination
740
- * If we are outbound then this is the entity we are calling
741
- * @returns { remoteid }
742
- */
737
+ * Returns the called object. i.e.
738
+ * If we are inbound then this is the destination
739
+ * If we are outbound then this is the entity we are calling
740
+ * @returns { remoteid }
741
+ */
743
742
  get calledid() {
744
743
  return this.#calledid()
745
744
  }
@@ -1456,15 +1455,21 @@ class call {
1456
1455
  return
1457
1456
  }
1458
1457
 
1458
+ const authtimeoutms = 10000
1459
1459
  this._timers.auth = setTimeout( () => {
1460
- this._promises.reject.auth( new SipError( hangupcodes.REQUEST_TIMEOUT, "Auth timed out" ) )
1460
+ /* something has overtaken events and cleaned us up already */
1461
+ if( !this._promises.reject ) return
1462
+ if( !this._promises.reject.auth ) return
1463
+
1464
+ const rej = this._promises.reject.auth
1461
1465
  this._promises.resolve.auth = undefined
1462
1466
  this._promises.reject.auth = undefined
1463
1467
  this._timers.auth = undefined
1464
1468
 
1469
+ rej( new SipError( hangupcodes.REQUEST_TIMEOUT, "Auth timed out" ) )
1465
1470
  this.hangup( hangupcodes.REQUEST_TIMEOUT )
1466
1471
 
1467
- }, 50000 )
1472
+ }, authtimeoutms )
1468
1473
 
1469
1474
  const authpromise = new Promise( ( resolve, reject ) => {
1470
1475
  this._promises.resolve.auth = resolve
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "3.7.0",
3
+ "version": "3.7.2",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {