@babblevoice/babble-drachtio-callmanager 2.2.4 → 2.2.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
@@ -116,6 +116,8 @@ class call {
116
116
  */
117
117
  this.type = "uac"
118
118
 
119
+ this.privacy = false
120
+
119
121
  /**
120
122
  @typedef { Object } callstate
121
123
  @property { boolean } trying
@@ -429,7 +431,7 @@ class call {
429
431
  "uri": this._entity.uri,
430
432
  "user": this._entity.username,
431
433
  "host": this._entity.realm,
432
- "privacy": false,
434
+ "privacy": this.privacy,
433
435
  "type": "calledid"
434
436
  }
435
437
  }
@@ -441,7 +443,7 @@ class call {
441
443
  "uri": this.options.contact,
442
444
  "user": parseduri.user,
443
445
  "host": parseduri.host,
444
- "privacy": false,
446
+ "privacy": this.privacy,
445
447
  "type": "calledid"
446
448
  }
447
449
  }
@@ -452,7 +454,7 @@ class call {
452
454
  "uri": "",
453
455
  "user": "0000000000",
454
456
  "host": "localhost.localdomain",
455
- "privacy": false,
457
+ "privacy": this.privacy,
456
458
  "type": "calledid"
457
459
  }
458
460
  }
@@ -892,6 +894,9 @@ class call {
892
894
  other.parent = this
893
895
  this.children.add( other )
894
896
 
897
+ /* maintain privacy */
898
+ other.privacy = this.privacy
899
+
895
900
  if( mix ) {
896
901
  this.channels.audio.mix( other.channels.audio )
897
902
 
@@ -2730,6 +2735,7 @@ class call {
2730
2735
  @param { object } [ options.uactimeout ] - override the deault timeout
2731
2736
  @param { boolean | number } [ options.autoanswer ] - if true add call-info to auto answer, if number delay to add
2732
2737
  @param { boolean } [ options.late ] - late negotiation
2738
+ @param { boolean } [ options.privacy ] - sets the privacy
2733
2739
  @param { entity } [ options.entity ] - used to store this call against and look up a contact string if not supplied.
2734
2740
  @param { string } [ options.entity.username ]
2735
2741
  @param { string } [ options.entity.realm ]
@@ -2769,6 +2775,8 @@ class call {
2769
2775
  callstore.set( newcall )
2770
2776
  }
2771
2777
 
2778
+ if( options.privacy ) this.privacy = true
2779
+
2772
2780
  const u = newcall.#configcalleridfornewuac( options )
2773
2781
  newcall.#configautoanswerfornewuac( options, u )
2774
2782
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/test/unit/call.js CHANGED
@@ -27,6 +27,6 @@ describe( "call.js", function() {
27
27
  expect( newcallcalled ).to.be.true
28
28
 
29
29
  await call.hangup()
30
- } )
30
+ } )
31
31
 
32
32
  } )