react-sip-kit 0.2.0 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -118,7 +118,7 @@ interface SipAccountConfig {
118
118
 
119
119
  declare function reconnectTransport(userAgent?: SipUserAgent): void;
120
120
 
121
- type AudioBlobsType = Record<'Alert' | 'Ringtone' | 'speech_orig' | 'Busy_UK' | 'Busy_US' | 'CallWaiting' | 'Congestion_UK' | 'Congestion_US' | 'EarlyMedia_Australia' | 'EarlyMedia_European' | 'EarlyMedia_Japan' | 'EarlyMedia_UK' | 'EarlyMedia_US', {
121
+ type AudioBlobsType = Record<'Alert' | 'Ringtone' | 'CallWaiting', {
122
122
  file: string;
123
123
  url: string;
124
124
  blob?: string | ArrayBuffer | null;
@@ -134,13 +134,7 @@ declare class AudioBlobs {
134
134
  interface SipStoreStateType {
135
135
  configs: SipConfigs;
136
136
  userAgent?: SipUserAgent;
137
- buddies: Array<BuddyType>;
138
- selectedBuddy: Array<any>;
139
- selectedLine: Array<any>;
140
137
  lines: Array<LineType>;
141
- newLineNumber: number;
142
- SipUsername: string;
143
- SipDomain: string;
144
138
  audioBlobs: AudioBlobs['audioBlobs'];
145
139
  devicesInfo: DevicesInfoType;
146
140
  setSipStore: (state: Partial<SipStoreStateType>) => void;
@@ -148,13 +142,10 @@ interface SipStoreStateType {
148
142
  addLine: (line: LineType) => void;
149
143
  updateLine: (line: LineType) => void;
150
144
  removeLine: (lineNum: LineType['lineNumber']) => void;
151
- addBuddy: (buddy: BuddyType) => void;
152
- findBuddyByDid: (did: string) => BuddyType | null;
153
- findBuddyByIdentity: (indentity: BuddyType['identity']) => BuddyType | null;
154
145
  findLineByNumber: (lineNum: LineType['lineNumber']) => LineType | null;
155
- getSession: (did: string) => SipSessionType | null;
156
146
  getSessions: () => SipUserAgent['sessions'] | null;
157
- countSessions: (id: string) => number;
147
+ getNewLineNumber: () => number;
148
+ countIdSessions: (id: string) => number;
158
149
  }
159
150
  interface SipInvitationType extends Omit<Invitation, 'incomingInviteRequest' | 'sessionDescriptionHandler'> {
160
151
  data: Partial<SipSessionDataType>;
@@ -176,28 +167,26 @@ interface SipSessionDescriptionHandler extends SessionDescriptionHandler {
176
167
  peerConnection: RTCPeerConnection;
177
168
  peerConnectionDelegate: any;
178
169
  }
179
- interface LineType {
170
+ interface LineType<T extends object = object> {
180
171
  lineNumber: number;
181
- DisplayName: string;
182
- DisplayNumber: string;
183
- IsSelected: boolean;
184
- BuddyObj: BuddyType | null;
172
+ displayNumber: string;
173
+ metaData: Partial<T>;
185
174
  sipSession: SipInvitationType | SipInviterType | null;
186
- LocalSoundMeter: any;
187
- RemoteSoundMeter: any;
175
+ localSoundMeter: any;
176
+ remoteSoundMeter: any;
188
177
  }
189
178
  interface SipSessionType extends Session {
190
179
  data: SipSessionDataType;
191
180
  }
192
181
  interface SipSessionDataType {
193
182
  line: number;
194
- calldirection: 'inbound' | 'outbound';
195
- terminateby: string;
183
+ callDirection: 'inbound' | 'outbound';
184
+ terminateBy: string;
196
185
  src: string;
197
- buddyId: string;
186
+ metaData: LineType['metaData'];
198
187
  callstart: string;
199
188
  earlyReject: boolean;
200
- withvideo: boolean;
189
+ withVideo: boolean;
201
190
  reasonCode: number;
202
191
  reasonText: string;
203
192
  teardownComplete: boolean;
@@ -215,15 +204,15 @@ interface SipSessionDataType {
215
204
  }>;
216
205
  isMute: boolean;
217
206
  videoChannelNames: Array<Record<'mid' | 'channel', string>>;
218
- dst: string;
207
+ dialledNumber: string;
219
208
  transfer: Array<SipSessionTransferType>;
220
- AudioSourceTrack: any;
209
+ audioSourceTrack: any;
221
210
  earlyMedia: any;
222
211
  ringerObj: {
223
212
  [key: string]: any;
224
213
  } | null;
225
- ConfbridgeChannels: Array<any>;
226
- ConfbridgeEvents: Array<any>;
214
+ confBridgeChannels: Array<any>;
215
+ confBridgeEvents: Array<any>;
227
216
  videoSourceDevice: string | null;
228
217
  audioSourceDevice: string | null;
229
218
  audioOutputDevice: string | null;
@@ -241,30 +230,6 @@ interface SipSessionTransferType {
241
230
  };
242
231
  onCancle?: Function;
243
232
  }
244
- interface BuddyType {
245
- type: 'extension' | 'xmpp' | 'contact' | 'group';
246
- identity: string;
247
- CallerIDName: string;
248
- ExtNo: string;
249
- MobileNumber?: string;
250
- ContactNumber1?: string;
251
- ContactNumber2?: string;
252
- lastActivity: string;
253
- Desc: string;
254
- Email: string;
255
- jid?: string;
256
- devState: string;
257
- presence: string;
258
- missed: number;
259
- IsSelected: boolean;
260
- imageObjectURL: string;
261
- presenceText: string;
262
- EnableDuringDnd: boolean;
263
- EnableSubscribe: boolean;
264
- SubscribeUser: string;
265
- AllowAutoDelete: boolean;
266
- Pinned: boolean;
267
- }
268
233
  interface DevicesInfoType {
269
234
  hasVideoDevice: boolean;
270
235
  hasAudioDevice: boolean;
@@ -281,7 +246,7 @@ declare const useSessionMethods: () => {
281
246
  makeAudioSession: (lineObj: LineType, dialledNumber: string, extraHeaders?: Array<string>) => void;
282
247
  makeVideoSession: (lineObj: LineType, dialledNumber: string, extraHeaders?: Array<string>) => void;
283
248
  rejectCall: (lineNumber: LineType["lineNumber"]) => void;
284
- dialByLine: (type: "audio" | "video", numToDial: string, buddy?: BuddyType, CallerID?: string, extraHeaders?: Array<string>) => void;
249
+ dialByLine: (type: "audio" | "video", dialNumber: string, metaData?: object, extraHeaders?: Array<string>) => void;
285
250
  endSession: (lineNumber: LineType["lineNumber"]) => void;
286
251
  holdSession: (lineNumber: LineType["lineNumber"]) => void;
287
252
  unholdSession: (lineNumber: LineType["lineNumber"]) => void;