@voicenter-team/opensips-js 1.0.19 → 1.0.21

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.
@@ -23,7 +23,8 @@ const CALL_KEYS_TO_INCLUDE = [
23
23
  //'audioQuality',
24
24
  'isOnHold',
25
25
  //'originalStream',
26
- 'localMuted'
26
+ 'localMuted',
27
+ 'autoAnswer'
27
28
  ];
28
29
  function simplifyCallObject(call) {
29
30
  const simplified = {};
package/build/index.js CHANGED
@@ -701,10 +701,11 @@ class OpenSIPSJS extends UA_1.default {
701
701
  this._startCallTimer(session.id);
702
702
  }
703
703
  const call = session;
704
- call.roomId = roomId;
705
- call.localMuted = false;
706
704
  const autoAnswerByHeaders = this.hasAutoAnswerHeaders(event);
707
705
  const doAutoAnswer = call.direction === 'incoming' && !this.hasActiveCalls && (autoAnswerByHeaders || this.autoAnswer);
706
+ call.roomId = roomId;
707
+ call.localMuted = false;
708
+ call.autoAnswer = doAutoAnswer;
708
709
  if (doAutoAnswer) {
709
710
  this._addCall(call, false);
710
711
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicenter-team/opensips-js",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "The JS package for opensips",
5
5
  "default": "src/index.ts",
6
6
  "main": "build/index.js",
@@ -75,6 +75,7 @@ export interface ICall extends RTCSessionExtended {
75
75
  localMuted?: boolean
76
76
  localHold?: boolean
77
77
  audioTag?: StreamMediaType
78
+ autoAnswer?: boolean
78
79
  }
79
80
 
80
81
  export type RoomChangeEmitType = {
@@ -137,4 +138,4 @@ export interface CallOptionsExtended extends AnswerOptionsExtended {
137
138
  anonymous?: boolean;
138
139
  fromUserName?: string;
139
140
  fromDisplayName?: string;
140
- }
141
+ }