ue-softphone-sdk 4.0.4 → 4.0.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/dist/lib/types/lib/sip.js/api/ack.d.ts +12 -0
- package/dist/lib/types/lib/sip.js/api/bye.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/api/dtmf.d.ts +15 -0
- package/dist/lib/types/lib/sip.js/api/emitter.d.ts +88 -0
- package/dist/lib/types/lib/sip.js/api/exceptions/content-type-unsupported.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/api/exceptions/index.d.ts +5 -0
- package/dist/lib/types/lib/sip.js/api/exceptions/request-pending.d.ts +9 -0
- package/dist/lib/types/lib/sip.js/api/exceptions/session-description-handler.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/api/exceptions/session-terminated.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/api/exceptions/state-transition.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/api/index.d.ts +59 -0
- package/dist/lib/types/lib/sip.js/api/info.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/api/invitation-accept-options.d.ts +19 -0
- package/dist/lib/types/lib/sip.js/api/invitation-progress-options.d.ts +38 -0
- package/dist/lib/types/lib/sip.js/api/invitation-reject-options.d.ts +25 -0
- package/dist/lib/types/lib/sip.js/api/invitation.d.ts +179 -0
- package/dist/lib/types/lib/sip.js/api/inviter-cancel-options.d.ts +9 -0
- package/dist/lib/types/lib/sip.js/api/inviter-invite-options.d.ts +28 -0
- package/dist/lib/types/lib/sip.js/api/inviter-options.d.ts +43 -0
- package/dist/lib/types/lib/sip.js/api/inviter.d.ts +236 -0
- package/dist/lib/types/lib/sip.js/api/message.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/api/messager-message-options.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/api/messager-options.d.ts +17 -0
- package/dist/lib/types/lib/sip.js/api/messager.d.ts +26 -0
- package/dist/lib/types/lib/sip.js/api/notification.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/api/notifier.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/api/publisher-options.d.ts +33 -0
- package/dist/lib/types/lib/sip.js/api/publisher-publish-options.d.ts +6 -0
- package/dist/lib/types/lib/sip.js/api/publisher-state.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/api/publisher-unpublish-options.d.ts +6 -0
- package/dist/lib/types/lib/sip.js/api/publisher.d.ts +65 -0
- package/dist/lib/types/lib/sip.js/api/referral.d.ts +38 -0
- package/dist/lib/types/lib/sip.js/api/registerer-options.d.ts +46 -0
- package/dist/lib/types/lib/sip.js/api/registerer-register-options.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/api/registerer-state.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/api/registerer-unregister-options.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/api/registerer.d.ts +144 -0
- package/dist/lib/types/lib/sip.js/api/session-bye-options.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/api/session-delegate.d.ts +79 -0
- package/dist/lib/types/lib/sip.js/api/session-description-handler-factory.d.ts +15 -0
- package/dist/lib/types/lib/sip.js/api/session-description-handler.d.ts +74 -0
- package/dist/lib/types/lib/sip.js/api/session-info-options.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/api/session-invite-options.d.ts +28 -0
- package/dist/lib/types/lib/sip.js/api/session-message-options.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/api/session-options.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/api/session-refer-options.d.ts +14 -0
- package/dist/lib/types/lib/sip.js/api/session-state.d.ts +45 -0
- package/dist/lib/types/lib/sip.js/api/session.d.ts +359 -0
- package/dist/lib/types/lib/sip.js/api/subscriber-options.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/api/subscriber-subscribe-options.d.ts +6 -0
- package/dist/lib/types/lib/sip.js/api/subscriber.d.ts +94 -0
- package/dist/lib/types/lib/sip.js/api/subscription-delegate.d.ts +12 -0
- package/dist/lib/types/lib/sip.js/api/subscription-options.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/api/subscription-state.d.ts +19 -0
- package/dist/lib/types/lib/sip.js/api/subscription-subscribe-options.d.ts +6 -0
- package/dist/lib/types/lib/sip.js/api/subscription-unsubscribe-options.d.ts +6 -0
- package/dist/lib/types/lib/sip.js/api/subscription.d.ts +84 -0
- package/dist/lib/types/lib/sip.js/api/transport-state.d.ts +37 -0
- package/dist/lib/types/lib/sip.js/api/transport.d.ts +159 -0
- package/dist/lib/types/lib/sip.js/api/user-agent-delegate.d.ts +84 -0
- package/dist/lib/types/lib/sip.js/api/user-agent-options.d.ts +253 -0
- package/dist/lib/types/lib/sip.js/api/user-agent-state.d.ts +14 -0
- package/dist/lib/types/lib/sip.js/api/user-agent.d.ts +200 -0
- package/dist/lib/types/lib/sip.js/core/dialogs/dialog-state.d.ts +34 -0
- package/dist/lib/types/lib/sip.js/core/dialogs/dialog.d.ts +161 -0
- package/dist/lib/types/lib/sip.js/core/dialogs/index.d.ts +4 -0
- package/dist/lib/types/lib/sip.js/core/dialogs/session-dialog.d.ts +196 -0
- package/dist/lib/types/lib/sip.js/core/dialogs/subscription-dialog.d.ts +120 -0
- package/dist/lib/types/lib/sip.js/core/exceptions/exception.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/core/exceptions/index.d.ts +3 -0
- package/dist/lib/types/lib/sip.js/core/exceptions/transaction-state-error.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/core/exceptions/transport-error.d.ts +8 -0
- package/dist/lib/types/lib/sip.js/core/index.d.ts +15 -0
- package/dist/lib/types/lib/sip.js/core/log/index.d.ts +3 -0
- package/dist/lib/types/lib/sip.js/core/log/levels.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/log/logger-factory.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/log/logger.d.ts +19 -0
- package/dist/lib/types/lib/sip.js/core/messages/body.d.ts +64 -0
- package/dist/lib/types/lib/sip.js/core/messages/digest-authentication.d.ts +51 -0
- package/dist/lib/types/lib/sip.js/core/messages/incoming-message.d.ts +79 -0
- package/dist/lib/types/lib/sip.js/core/messages/incoming-request-message.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/messages/incoming-request.d.ts +67 -0
- package/dist/lib/types/lib/sip.js/core/messages/incoming-response-message.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/messages/incoming-response.d.ts +12 -0
- package/dist/lib/types/lib/sip.js/core/messages/index.d.ts +13 -0
- package/dist/lib/types/lib/sip.js/core/messages/md5.d.ts +32 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/ack.d.ts +18 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/bye.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/cancel.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/constants.d.ts +20 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/index.d.ts +13 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/info.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/invite.d.ts +86 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/message.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/notify.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/prack.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/publish.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/refer.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/register.d.ts +21 -0
- package/dist/lib/types/lib/sip.js/core/messages/methods/subscribe.d.ts +54 -0
- package/dist/lib/types/lib/sip.js/core/messages/outgoing-request-message.d.ts +94 -0
- package/dist/lib/types/lib/sip.js/core/messages/outgoing-request.d.ts +67 -0
- package/dist/lib/types/lib/sip.js/core/messages/outgoing-response.d.ts +42 -0
- package/dist/lib/types/lib/sip.js/core/messages/parser.d.ts +14 -0
- package/dist/lib/types/lib/sip.js/core/messages/utils.d.ts +24 -0
- package/dist/lib/types/lib/sip.js/core/session/index.d.ts +2 -0
- package/dist/lib/types/lib/sip.js/core/session/session-delegate.d.ts +70 -0
- package/dist/lib/types/lib/sip.js/core/session/session.d.ts +134 -0
- package/dist/lib/types/lib/sip.js/core/subscription/index.d.ts +2 -0
- package/dist/lib/types/lib/sip.js/core/subscription/subscription-delegate.d.ts +27 -0
- package/dist/lib/types/lib/sip.js/core/subscription/subscription.d.ts +55 -0
- package/dist/lib/types/lib/sip.js/core/timers.d.ts +20 -0
- package/dist/lib/types/lib/sip.js/core/transactions/client-transaction.d.ts +45 -0
- package/dist/lib/types/lib/sip.js/core/transactions/index.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/transactions/invite-client-transaction.d.ts +116 -0
- package/dist/lib/types/lib/sip.js/core/transactions/invite-server-transaction.d.ts +127 -0
- package/dist/lib/types/lib/sip.js/core/transactions/non-invite-client-transaction.d.ts +69 -0
- package/dist/lib/types/lib/sip.js/core/transactions/non-invite-server-transaction.d.ts +57 -0
- package/dist/lib/types/lib/sip.js/core/transactions/server-transaction.d.ts +35 -0
- package/dist/lib/types/lib/sip.js/core/transactions/transaction-state.d.ts +13 -0
- package/dist/lib/types/lib/sip.js/core/transactions/transaction-user.d.ts +72 -0
- package/dist/lib/types/lib/sip.js/core/transactions/transaction.d.ts +79 -0
- package/dist/lib/types/lib/sip.js/core/transport.d.ts +31 -0
- package/dist/lib/types/lib/sip.js/core/user-agent-core/allowed-methods.d.ts +4 -0
- package/dist/lib/types/lib/sip.js/core/user-agent-core/index.d.ts +3 -0
- package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core-configuration.d.ts +99 -0
- package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core-delegate.d.ts +37 -0
- package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core.d.ts +179 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/bye-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/bye-user-agent-server.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/cancel-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/index.d.ts +26 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/info-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/info-user-agent-server.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/invite-user-agent-client.d.ts +35 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/invite-user-agent-server.d.ts +77 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/message-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/message-user-agent-server.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/notify-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/notify-user-agent-server.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/prack-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/prack-user-agent-server.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/publish-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/re-invite-user-agent-client.d.ts +18 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/re-invite-user-agent-server.d.ts +41 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/re-subscribe-user-agent-client.d.ts +17 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/re-subscribe-user-agent-server.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/refer-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/refer-user-agent-server.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/register-user-agent-client.d.ts +10 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/register-user-agent-server.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/subscribe-user-agent-client.d.ts +65 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/subscribe-user-agent-server.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/user-agent-client.d.ts +103 -0
- package/dist/lib/types/lib/sip.js/core/user-agents/user-agent-server.d.ts +79 -0
- package/dist/lib/types/lib/sip.js/grammar/grammar.d.ts +26 -0
- package/dist/lib/types/lib/sip.js/grammar/index.d.ts +4 -0
- package/dist/lib/types/lib/sip.js/grammar/name-addr-header.d.ts +24 -0
- package/dist/lib/types/lib/sip.js/grammar/parameters.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/grammar/pegjs/dist/grammar.d.ts +50 -0
- package/dist/lib/types/lib/sip.js/grammar/uri.d.ts +62 -0
- package/dist/lib/types/lib/sip.js/index.d.ts +9 -0
- package/dist/lib/types/lib/sip.js/platform/web/index.d.ts +4 -0
- package/dist/lib/types/lib/sip.js/platform/web/modifiers/index.d.ts +5 -0
- package/dist/lib/types/lib/sip.js/platform/web/modifiers/modifiers.d.ts +41 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/index.d.ts +14 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/media-stream-factory-default.d.ts +6 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/media-stream-factory.d.ts +6 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/peer-connection-configuration-default.d.ts +5 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/peer-connection-delegate.d.ts +63 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-configuration.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-default.d.ts +11 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-options.d.ts +9 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory.d.ts +16 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-options.d.ts +47 -0
- package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler.d.ts +212 -0
- package/dist/lib/types/lib/sip.js/platform/web/simple-user/index.d.ts +7 -0
- package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user-delegate.d.ts +72 -0
- package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user-options.d.ts +90 -0
- package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user.d.ts +226 -0
- package/dist/lib/types/lib/sip.js/platform/web/transport/index.d.ts +6 -0
- package/dist/lib/types/lib/sip.js/platform/web/transport/transport-options.d.ts +30 -0
- package/dist/lib/types/lib/sip.js/platform/web/transport/transport.d.ts +125 -0
- package/dist/lib/types/lib/sip.js/version.d.ts +1 -0
- package/dist/lib/types/webrtc/webrtc-method.d.ts +2 -0
- package/dist/lib/types/webrtc/webrtc.d.ts +38 -0
- package/dist/lib/ue-soft-phone.min.js +1 -1
- package/dist/ue-softphone-sdk.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { OutgoingRegisterRequest } from '../core';
|
|
2
|
+
import { Emitter } from './emitter';
|
|
3
|
+
import { RegistererOptions } from './registerer-options';
|
|
4
|
+
import { RegistererRegisterOptions } from './registerer-register-options';
|
|
5
|
+
import { RegistererState } from './registerer-state';
|
|
6
|
+
import { RegistererUnregisterOptions } from './registerer-unregister-options';
|
|
7
|
+
import { UserAgent } from './user-agent';
|
|
8
|
+
/**
|
|
9
|
+
* A registerer registers a contact for an address of record (outgoing REGISTER).
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare class Registerer {
|
|
13
|
+
private static readonly defaultExpires;
|
|
14
|
+
private static readonly defaultRefreshFrequency;
|
|
15
|
+
private disposed;
|
|
16
|
+
private id;
|
|
17
|
+
private expires;
|
|
18
|
+
private refreshFrequency;
|
|
19
|
+
private logger;
|
|
20
|
+
private options;
|
|
21
|
+
private request;
|
|
22
|
+
private userAgent;
|
|
23
|
+
private registrationExpiredTimer;
|
|
24
|
+
private registrationTimer;
|
|
25
|
+
/** The contacts returned from the most recent accepted REGISTER request. */
|
|
26
|
+
private _contacts;
|
|
27
|
+
/** The number of seconds to wait before retrying to register. */
|
|
28
|
+
private _retryAfter;
|
|
29
|
+
/** The registration state. */
|
|
30
|
+
private _state;
|
|
31
|
+
/** Emits when the registration state changes. */
|
|
32
|
+
private _stateEventEmitter;
|
|
33
|
+
/** True is waiting for final response to outstanding REGISTER request. */
|
|
34
|
+
private _waiting;
|
|
35
|
+
/** Emits when waiting changes. */
|
|
36
|
+
private _waitingEventEmitter;
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new instance of the `Registerer` class.
|
|
39
|
+
* @param userAgent - User agent. See {@link UserAgent} for details.
|
|
40
|
+
* @param options - Options bucket. See {@link RegistererOptions} for details.
|
|
41
|
+
*/
|
|
42
|
+
constructor(userAgent: UserAgent, options?: RegistererOptions);
|
|
43
|
+
/** Default registerer options. */
|
|
44
|
+
private static defaultOptions;
|
|
45
|
+
private static newUUID;
|
|
46
|
+
/**
|
|
47
|
+
* Strip properties with undefined values from options.
|
|
48
|
+
* This is a work around while waiting for missing vs undefined to be addressed (or not)...
|
|
49
|
+
* https://github.com/Microsoft/TypeScript/issues/13195
|
|
50
|
+
* @param options - Options to reduce
|
|
51
|
+
*/
|
|
52
|
+
private static stripUndefinedProperties;
|
|
53
|
+
/** The registered contacts. */
|
|
54
|
+
get contacts(): Array<string>;
|
|
55
|
+
/**
|
|
56
|
+
* The number of seconds to wait before retrying to register.
|
|
57
|
+
* @defaultValue `undefined`
|
|
58
|
+
* @remarks
|
|
59
|
+
* When the server rejects a registration request, if it provides a suggested
|
|
60
|
+
* duration to wait before retrying, that value is available here when and if
|
|
61
|
+
* the state transitions to `Unsubscribed`. It is also available during the
|
|
62
|
+
* callback to `onReject` after a call to `register`. (Note that if the state
|
|
63
|
+
* if already `Unsubscribed`, a rejected request created by `register` will
|
|
64
|
+
* not cause the state to transition to `Unsubscribed`. One way to avoid this
|
|
65
|
+
* case is to dispose of `Registerer` when unregistered and create a new
|
|
66
|
+
* `Registerer` for any attempts to retry registering.)
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* // Checking for retry after on state change
|
|
70
|
+
* registerer.stateChange.addListener((newState) => {
|
|
71
|
+
* switch (newState) {
|
|
72
|
+
* case RegistererState.Unregistered:
|
|
73
|
+
* const retryAfter = registerer.retryAfter;
|
|
74
|
+
* break;
|
|
75
|
+
* }
|
|
76
|
+
* });
|
|
77
|
+
*
|
|
78
|
+
* // Checking for retry after on request rejection
|
|
79
|
+
* registerer.register({
|
|
80
|
+
* requestDelegate: {
|
|
81
|
+
* onReject: () => {
|
|
82
|
+
* const retryAfter = registerer.retryAfter;
|
|
83
|
+
* }
|
|
84
|
+
* }
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
get retryAfter(): number | undefined;
|
|
89
|
+
/** The registration state. */
|
|
90
|
+
get state(): RegistererState;
|
|
91
|
+
/** Emits when the registerer state changes. */
|
|
92
|
+
get stateChange(): Emitter<RegistererState>;
|
|
93
|
+
/** Destructor. */
|
|
94
|
+
dispose(): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Sends the REGISTER request.
|
|
97
|
+
* @remarks
|
|
98
|
+
* If successful, sends re-REGISTER requests prior to registration expiration until `unsubscribe()` is called.
|
|
99
|
+
* Rejects with `RequestPendingError` if a REGISTER request is already in progress.
|
|
100
|
+
*/
|
|
101
|
+
register(options?: RegistererRegisterOptions): Promise<OutgoingRegisterRequest>;
|
|
102
|
+
/**
|
|
103
|
+
* Sends the REGISTER request with expires equal to zero.
|
|
104
|
+
* @remarks
|
|
105
|
+
* Rejects with `RequestPendingError` if a REGISTER request is already in progress.
|
|
106
|
+
*/
|
|
107
|
+
unregister(options?: RegistererUnregisterOptions): Promise<OutgoingRegisterRequest>;
|
|
108
|
+
/**
|
|
109
|
+
* Clear registration timers.
|
|
110
|
+
*/
|
|
111
|
+
private clearTimers;
|
|
112
|
+
/**
|
|
113
|
+
* Generate Contact Header
|
|
114
|
+
*/
|
|
115
|
+
private generateContactHeader;
|
|
116
|
+
/**
|
|
117
|
+
* Helper function, called when registered.
|
|
118
|
+
*/
|
|
119
|
+
private registered;
|
|
120
|
+
/**
|
|
121
|
+
* Helper function, called when unregistered.
|
|
122
|
+
*/
|
|
123
|
+
private unregistered;
|
|
124
|
+
/**
|
|
125
|
+
* Helper function, called when terminated.
|
|
126
|
+
*/
|
|
127
|
+
private terminated;
|
|
128
|
+
/**
|
|
129
|
+
* Transition registration state.
|
|
130
|
+
*/
|
|
131
|
+
private stateTransition;
|
|
132
|
+
/** True if the registerer is currently waiting for final response to a REGISTER request. */
|
|
133
|
+
private get waiting();
|
|
134
|
+
/** Emits when the registerer waiting state changes. */
|
|
135
|
+
private get waitingChange();
|
|
136
|
+
/**
|
|
137
|
+
* Toggle waiting.
|
|
138
|
+
*/
|
|
139
|
+
private waitingToggle;
|
|
140
|
+
/** Hopefully helpful as the standard behavior has been found to be unexpected. */
|
|
141
|
+
private waitingWarning;
|
|
142
|
+
/** Hopefully helpful as the standard behavior has been found to be unexpected. */
|
|
143
|
+
private stateError;
|
|
144
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OutgoingRequestDelegate, RequestOptions } from "../core";
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link Session.bye}.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface SessionByeOptions {
|
|
7
|
+
/** See `core` API. */
|
|
8
|
+
requestDelegate?: OutgoingRequestDelegate;
|
|
9
|
+
/** See `core` API. */
|
|
10
|
+
requestOptions?: RequestOptions;
|
|
11
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { IncomingRequestMessage } from "../core";
|
|
2
|
+
import { Ack } from "./ack";
|
|
3
|
+
import { Bye } from "./bye";
|
|
4
|
+
import { Info } from "./info";
|
|
5
|
+
import { Message } from "./message";
|
|
6
|
+
import { Notification } from "./notification";
|
|
7
|
+
import { Referral } from "./referral";
|
|
8
|
+
import { SessionDescriptionHandler } from "./session-description-handler";
|
|
9
|
+
/**
|
|
10
|
+
* Delegate for {@link Session}.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface SessionDelegate {
|
|
14
|
+
/**
|
|
15
|
+
* Called upon receiving an incoming in dialog ACK request.
|
|
16
|
+
* @param ack - The ack.
|
|
17
|
+
*/
|
|
18
|
+
onAck?(ack: Ack): void;
|
|
19
|
+
/**
|
|
20
|
+
* Called upon receiving an incoming in dialog BYE request.
|
|
21
|
+
* @param bye - The bye.
|
|
22
|
+
*/
|
|
23
|
+
onBye?(bye: Bye): void;
|
|
24
|
+
/**
|
|
25
|
+
* Called upon receiving an incoming in dialog INFO request.
|
|
26
|
+
* @param info - The info.
|
|
27
|
+
*/
|
|
28
|
+
onInfo?(info: Info): void;
|
|
29
|
+
/**
|
|
30
|
+
* Called upon receiving an incoming in dialog INVITE request.
|
|
31
|
+
* @param invite - The invite.
|
|
32
|
+
*/
|
|
33
|
+
onInvite?(request: IncomingRequestMessage, response: string, statusCode: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Called upon receiving an incoming in dialog MESSAGE request.
|
|
36
|
+
* @param message - The message.
|
|
37
|
+
*/
|
|
38
|
+
onMessage?(message: Message): void;
|
|
39
|
+
/**
|
|
40
|
+
* Called upon receiving an incoming in dialog NOTIFY request.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* If a refer is in progress notifications are delivered to the referrers delegate.
|
|
44
|
+
*
|
|
45
|
+
* @param notification - The notification.
|
|
46
|
+
*/
|
|
47
|
+
onNotify?(notification: Notification): void;
|
|
48
|
+
/**
|
|
49
|
+
* Called upon receiving an incoming in dialog REFER request.
|
|
50
|
+
* @param referral - The referral.
|
|
51
|
+
*/
|
|
52
|
+
onRefer?(referral: Referral): void;
|
|
53
|
+
/**
|
|
54
|
+
* Called upon creating a SessionDescriptionHandler.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* It's recommended that the SessionDescriptionHandler be accessed via the `Session.sessionDescriptionHandler` property.
|
|
58
|
+
* However there are use cases where one needs access immediately after it is constructed and before it is utilized.
|
|
59
|
+
* Thus this callback.
|
|
60
|
+
*
|
|
61
|
+
* In most scenarios a single SessionDescriptionHandler will be created per Session
|
|
62
|
+
* in which case this callback will be called at most once and `provisional` will be `false`.
|
|
63
|
+
*
|
|
64
|
+
* However if reliable provisional responses are being supported and an INVITE is sent without SDP,
|
|
65
|
+
* one or more session description handlers will be created if remote offers are received in reliable provisional responses.
|
|
66
|
+
* When remote offers are received in reliable provisional responses, the `provisional` parameter will be `true`.
|
|
67
|
+
* When the `provisional` paramter is `true`, this callback may (or may not) be called again.
|
|
68
|
+
* If the session is ultimately established using a SessionDescriptionHandler which was not created provisionally,
|
|
69
|
+
* this callback will be called again and the `provisional` parameter will be `false`.
|
|
70
|
+
* If the session is ultimately established using a SessionDescriptionHandler which was created provisionally,
|
|
71
|
+
* this callback will not be called again.
|
|
72
|
+
* Note that if the session is ultimately established using a SessionDescriptionHandler which was created provisionally,
|
|
73
|
+
* the provisional SessionDescriptionHandler being utilized will be available via the `Session.sessionDescriptionHandler` property.
|
|
74
|
+
*
|
|
75
|
+
* @param sessionDescriptionHandler - The handler.
|
|
76
|
+
* @param provisional - True if created provisionally.
|
|
77
|
+
*/
|
|
78
|
+
onSessionDescriptionHandler?(sessionDescriptionHandler: SessionDescriptionHandler, provisional: boolean): void;
|
|
79
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Session } from "./session";
|
|
2
|
+
import { SessionDescriptionHandler } from "./session-description-handler";
|
|
3
|
+
/**
|
|
4
|
+
* Factory for {@link SessionDescriptionHandler}.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface SessionDescriptionHandlerFactory {
|
|
8
|
+
/**
|
|
9
|
+
* SessionDescriptionHandler factory function.
|
|
10
|
+
* @remarks
|
|
11
|
+
* The `options` are provided as part of the UserAgent configuration
|
|
12
|
+
* and passed through on every call to SessionDescriptionHandlerFactory's constructor.
|
|
13
|
+
*/
|
|
14
|
+
(session: Session, options?: object): SessionDescriptionHandler;
|
|
15
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delegate for {@link Session} offer/answer exchange.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export interface SessionDescriptionHandler {
|
|
6
|
+
/**
|
|
7
|
+
* Destructor.
|
|
8
|
+
*/
|
|
9
|
+
close(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the local description from the underlying media implementation.
|
|
12
|
+
* @param options - Options object to be used by getDescription.
|
|
13
|
+
* @param modifiers - Array with one time use description modifiers.
|
|
14
|
+
* @returns Promise that resolves with the local description to be used for the session.
|
|
15
|
+
* Rejects with `ClosedSessionDescriptionHandlerError` when this method
|
|
16
|
+
* is called after close or when close occurs before complete.
|
|
17
|
+
*/
|
|
18
|
+
getDescription(options?: SessionDescriptionHandlerOptions, modifiers?: Array<SessionDescriptionHandlerModifier>): Promise<BodyAndContentType>;
|
|
19
|
+
/**
|
|
20
|
+
* Returns true if the Session Description Handler can handle the Content-Type described by a SIP message.
|
|
21
|
+
* @param contentType - The content type that is in the SIP Message.
|
|
22
|
+
* @returns True if the content type is handled by this session description handler. False otherwise.
|
|
23
|
+
*/
|
|
24
|
+
hasDescription(contentType: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Rolls back the current local/remote offer to the prior stable state.
|
|
27
|
+
*/
|
|
28
|
+
rollbackDescription?(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the remote description to the underlying media implementation.
|
|
31
|
+
* @param sessionDescription - The description provided by a SIP message to be set on the media implementation.
|
|
32
|
+
* @param options - Options object to be used by setDescription.
|
|
33
|
+
* @param modifiers - Array with one time use description modifiers.
|
|
34
|
+
* @returns Promise that resolves once the description is set.
|
|
35
|
+
* Rejects with `ClosedSessionDescriptionHandlerError` when this method
|
|
36
|
+
* is called after close or when close occurs before complete.
|
|
37
|
+
*/
|
|
38
|
+
setDescription(sdp: string, options?: SessionDescriptionHandlerOptions, modifiers?: Array<SessionDescriptionHandlerModifier>): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Send DTMF via RTP (RFC 4733).
|
|
41
|
+
* Returns true if DTMF send is successful, false otherwise.
|
|
42
|
+
* @param tones - A string containing DTMF digits.
|
|
43
|
+
* @param options - Options object to be used by sendDtmf.
|
|
44
|
+
* @returns True if DTMF send is successful, false otherwise.
|
|
45
|
+
*/
|
|
46
|
+
sendDtmf(tones: string, options?: unknown): boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Modifier for {@link SessionDescriptionHandler} offer/answer.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export interface SessionDescriptionHandlerModifier {
|
|
53
|
+
(sessionDescription: RTCSessionDescriptionInit): Promise<RTCSessionDescriptionInit>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Options for {@link SessionDescriptionHandler} methods.
|
|
57
|
+
* @remarks
|
|
58
|
+
* These options are provided to various UserAgent methods (invite() for example)
|
|
59
|
+
* and passed through on calls to getDescription() and setDescription().
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export interface SessionDescriptionHandlerOptions {
|
|
63
|
+
constraints?: object;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Message body content and type.
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export interface BodyAndContentType {
|
|
70
|
+
/** Message body content. */
|
|
71
|
+
body: string;
|
|
72
|
+
/** Message body content type. */
|
|
73
|
+
contentType: string;
|
|
74
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OutgoingRequestDelegate, RequestOptions } from "../core";
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link Session.info}.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface SessionInfoOptions {
|
|
7
|
+
/** See `core` API. */
|
|
8
|
+
requestDelegate?: OutgoingRequestDelegate;
|
|
9
|
+
/** See `core` API. */
|
|
10
|
+
requestOptions?: RequestOptions;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OutgoingRequestDelegate, RequestOptions } from "../core";
|
|
2
|
+
import { SessionDescriptionHandlerModifier, SessionDescriptionHandlerOptions } from "./session-description-handler";
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link Session.invite}.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface SessionInviteOptions {
|
|
8
|
+
/**
|
|
9
|
+
* See `core` API.
|
|
10
|
+
*/
|
|
11
|
+
requestDelegate?: OutgoingRequestDelegate;
|
|
12
|
+
/**
|
|
13
|
+
* See `core` API.
|
|
14
|
+
*/
|
|
15
|
+
requestOptions?: RequestOptions;
|
|
16
|
+
/**
|
|
17
|
+
* Modifiers to pass to SessionDescriptionHandler during re-INVITE transaction.
|
|
18
|
+
*/
|
|
19
|
+
sessionDescriptionHandlerModifiers?: Array<SessionDescriptionHandlerModifier>;
|
|
20
|
+
/**
|
|
21
|
+
* Options to pass to SessionDescriptionHandler during re-INVITE transaction.
|
|
22
|
+
*/
|
|
23
|
+
sessionDescriptionHandlerOptions?: SessionDescriptionHandlerOptions;
|
|
24
|
+
/**
|
|
25
|
+
* If true, send INVITE without SDP. Default is false.
|
|
26
|
+
*/
|
|
27
|
+
withoutSdp?: boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OutgoingRequestDelegate, RequestOptions } from "../core";
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link Session.message}.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface SessionMessageOptions {
|
|
7
|
+
/** See `core` API. */
|
|
8
|
+
requestDelegate?: OutgoingRequestDelegate;
|
|
9
|
+
/** See `core` API. */
|
|
10
|
+
requestOptions?: RequestOptions;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OutgoingRequestDelegate, RequestOptions } from "../core";
|
|
2
|
+
import { Notification } from "./notification";
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link Session.refer}.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface SessionReferOptions {
|
|
8
|
+
/** Called upon receiving an incoming NOTIFY associated with a REFER. */
|
|
9
|
+
onNotify?: (notification: Notification) => void;
|
|
10
|
+
/** See `core` API. */
|
|
11
|
+
requestDelegate?: OutgoingRequestDelegate;
|
|
12
|
+
/** See `core` API. */
|
|
13
|
+
requestOptions?: RequestOptions;
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {@link Session} state.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The {@link Session} behaves in a deterministic manner according to the following
|
|
6
|
+
* Finite State Machine (FSM).
|
|
7
|
+
* ```txt
|
|
8
|
+
* ___________________________________________________________
|
|
9
|
+
* | ____________________________________________ |
|
|
10
|
+
* | | ____________________________ | |
|
|
11
|
+
* Session | | | v v v
|
|
12
|
+
* Constructed -> Initial -> Establishing -> Established -> Terminating -> Terminated
|
|
13
|
+
* | |___________________________^ ^
|
|
14
|
+
* |_______________________________________________|
|
|
15
|
+
* ```
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export declare enum SessionState {
|
|
19
|
+
/**
|
|
20
|
+
* If `Inviter`, INVITE not sent yet.
|
|
21
|
+
* If `Invitation`, received INVITE (but no final response sent yet).
|
|
22
|
+
*/
|
|
23
|
+
Initial = "Initial",
|
|
24
|
+
/**
|
|
25
|
+
* If `Inviter`, sent INVITE and waiting for a final response.
|
|
26
|
+
* If `Invitation`, received INVITE and attempting to send 200 final response (but has not sent it yet).
|
|
27
|
+
*/
|
|
28
|
+
Establishing = "Establishing",
|
|
29
|
+
/**
|
|
30
|
+
* If `Inviter`, sent INVITE and received 200 final response and sent ACK.
|
|
31
|
+
* If `Invitation`, received INVITE and sent 200 final response.
|
|
32
|
+
*/
|
|
33
|
+
Established = "Established",
|
|
34
|
+
/**
|
|
35
|
+
* If `Inviter`, sent INVITE, sent CANCEL and now waiting for 487 final response to ACK (or 200 to ACK & BYE).
|
|
36
|
+
* If `Invitation`, received INVITE, sent 200 final response and now waiting on ACK and upon receipt will attempt BYE
|
|
37
|
+
* (as the protocol specification requires, before sending a BYE we must receive the ACK - so we are waiting).
|
|
38
|
+
*/
|
|
39
|
+
Terminating = "Terminating",
|
|
40
|
+
/**
|
|
41
|
+
* If `Inviter`, sent INVITE and received non-200 final response (or sent/received BYE after receiving 200).
|
|
42
|
+
* If `Invitation`, received INVITE and sent non-200 final response (or sent/received BYE after sending 200).
|
|
43
|
+
*/
|
|
44
|
+
Terminated = "Terminated"
|
|
45
|
+
}
|