@voicenter-team/opensips-js 1.0.78 → 1.0.80
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/README.md +8 -0
- package/dist/index.d.ts +21 -4
- package/dist/opensips-js.cjs.js +21 -21
- package/dist/opensips-js.es.js +532 -532
- package/dist/opensips-js.iife.js +19 -19
- package/dist/opensips-js.umd.js +19 -19
- package/package.json +1 -1
- package/src/types/rtc.d.ts +6 -1
package/README.md
CHANGED
@@ -14,9 +14,17 @@ const openSIPSJS = new OpenSIPSJS({
|
|
14
14
|
configuration: {
|
15
15
|
session_timers: false,
|
16
16
|
uri: 'sip:extension_user@domain',
|
17
|
+
// --- Use password or authorization_jwt to authorize
|
17
18
|
password: 'password',
|
19
|
+
// or
|
20
|
+
authorization_jwt: 'token',
|
18
21
|
},
|
19
22
|
socketInterfaces: [ 'wss://domain' ],
|
23
|
+
pnExtraHeaders: {
|
24
|
+
'pn-provider': 'acme',
|
25
|
+
'pn-param': 'acme-param',
|
26
|
+
'pn-prid': 'ZH11Y4ZDJlMNzODE1NgKi0K>'
|
27
|
+
},
|
20
28
|
sipDomain: 'domain',
|
21
29
|
sipOptions: {
|
22
30
|
session_timers: false,
|
package/dist/index.d.ts
CHANGED
@@ -3,16 +3,22 @@ import { CallListener } from 'jssip/lib/RTCSession';
|
|
3
3
|
import { ConfirmedListener } from 'jssip/lib/RTCSession';
|
4
4
|
import { ConnectingListener } from 'jssip/lib/RTCSession';
|
5
5
|
import { DTMFListener } from 'jssip/lib/RTCSession';
|
6
|
+
import { EndEvent } from 'jssip/lib/RTCSession';
|
6
7
|
import { EndListener } from 'jssip/lib/RTCSession';
|
7
8
|
import { EventEmitter } from 'events';
|
9
|
+
import { ExtraContactParams } from 'jssip/lib/Registrator';
|
8
10
|
import { HoldListener } from 'jssip/lib/RTCSession';
|
9
11
|
import { IceCandidateListener } from 'jssip/lib/RTCSession';
|
12
|
+
import { IncomingAckEvent } from 'jssip/lib/RTCSession';
|
13
|
+
import { IncomingEvent } from 'jssip/lib/RTCSession';
|
10
14
|
import { IncomingRequest } from 'jssip/lib/SIPMessage';
|
11
15
|
import { InfoListener } from 'jssip/lib/RTCSession';
|
12
16
|
import { MediaConstraints } from 'jssip/lib/RTCSession';
|
13
17
|
import { MuteListener } from 'jssip/lib/RTCSession';
|
14
18
|
import { OnHoldResult } from 'jssip/lib/RTCSession';
|
15
19
|
import { Originator } from 'jssip/lib/RTCSession';
|
20
|
+
import { OutgoingAckEvent } from 'jssip/lib/RTCSession';
|
21
|
+
import { OutgoingEvent } from 'jssip/lib/RTCSession';
|
16
22
|
import { PeerConnectionListener } from 'jssip/lib/RTCSession';
|
17
23
|
import { ReferListener } from 'jssip/lib/RTCSession';
|
18
24
|
import { ReInviteListener } from 'jssip/lib/RTCSession';
|
@@ -278,8 +284,11 @@ declare interface IncomingMSRPSessionEvent {
|
|
278
284
|
|
279
285
|
declare type IncomingMSRPSessionListener = (event: IncomingMSRPSessionEvent) => void;
|
280
286
|
|
287
|
+
declare type IOpenSIPSConfiguration = Omit<UAConfiguration, 'sockets'>
|
288
|
+
|
281
289
|
declare interface IOpenSIPSJSOptions {
|
282
|
-
configuration:
|
290
|
+
configuration: IOpenSIPSConfiguration
|
291
|
+
pnExtraHeaders: ExtraContactParams
|
283
292
|
socketInterfaces: [ string ]
|
284
293
|
sipDomain: string
|
285
294
|
sipOptions: {
|
@@ -354,6 +363,8 @@ declare type Listener_3 = (event: unknown) => void
|
|
354
363
|
|
355
364
|
declare type ListenerCallbackFnType<T extends ListenersKeyType> = OpenSIPSEventMap[T]
|
356
365
|
|
366
|
+
declare type ListenerEventType = EndEvent | IncomingEvent | OutgoingEvent | IncomingAckEvent | OutgoingAckEvent
|
367
|
+
|
357
368
|
declare type ListenersKeyType = keyof OpenSIPSEventMap
|
358
369
|
|
359
370
|
declare const MODULES: {
|
@@ -627,9 +638,9 @@ declare interface OpenSIPSEventMap extends UAEventMap {
|
|
627
638
|
}
|
628
639
|
|
629
640
|
declare class OpenSIPSJS extends UAExtended {
|
630
|
-
|
641
|
+
initialized: boolean;
|
631
642
|
readonly options: IOpenSIPSJSOptions;
|
632
|
-
|
643
|
+
logger: CustomLoggerType;
|
633
644
|
readonly newRTCSessionEventName: ListenersKeyType;
|
634
645
|
private readonly registeredEventName;
|
635
646
|
private readonly unregisteredEventName;
|
@@ -651,7 +662,7 @@ declare class OpenSIPSJS extends UAExtended {
|
|
651
662
|
begin(): this;
|
652
663
|
subscribe(type: string, listener: (c: RTCSessionExtended) => void): void;
|
653
664
|
removeIListener(value: string): void;
|
654
|
-
|
665
|
+
triggerListener({ listenerType, session, event }: TriggerListenerOptions): void;
|
655
666
|
private setInitialized;
|
656
667
|
}
|
657
668
|
export default OpenSIPSJS;
|
@@ -731,6 +742,12 @@ declare interface StreamMediaType extends HTMLAudioElement {
|
|
731
742
|
|
732
743
|
declare type TestEventListener = (event: { test: string }) => void
|
733
744
|
|
745
|
+
declare interface TriggerListenerOptions {
|
746
|
+
listenerType: string
|
747
|
+
session: RTCSessionExtended
|
748
|
+
event?: ListenerEventType
|
749
|
+
}
|
750
|
+
|
734
751
|
declare const UAConstructor: typeof UA;
|
735
752
|
|
736
753
|
declare class UAExtended extends UAConstructor implements UAExtendedInterface {
|