ue-softphone-sdk 2.2.2 → 2.2.4
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/api/bye.d.ts +16 -0
- package/dist/api/dtmf.d.ts +15 -0
- package/dist/api/emitter.d.ts +88 -0
- package/dist/api/exceptions/content-type-unsupported.d.ts +8 -0
- package/dist/api/exceptions/index.d.ts +5 -0
- package/dist/api/exceptions/request-pending.d.ts +9 -0
- package/dist/api/exceptions/session-description-handler.d.ts +8 -0
- package/dist/api/exceptions/session-terminated.d.ts +8 -0
- package/dist/api/exceptions/state-transition.d.ts +8 -0
- package/dist/api/index.d.ts +58 -0
- package/dist/api/info.d.ts +16 -0
- package/dist/api/invitation-accept-options.d.ts +19 -0
- package/dist/api/invitation-progress-options.d.ts +38 -0
- package/dist/api/invitation-reject-options.d.ts +25 -0
- package/dist/api/invitation.d.ts +179 -0
- package/dist/api/inviter-cancel-options.d.ts +9 -0
- package/dist/api/inviter-invite-options.d.ts +28 -0
- package/dist/api/inviter-options.d.ts +43 -0
- package/dist/api/inviter.d.ts +236 -0
- package/dist/api/message.d.ts +16 -0
- package/dist/api/messager-message-options.d.ts +11 -0
- package/dist/api/messager-options.d.ts +17 -0
- package/dist/api/messager.d.ts +26 -0
- package/dist/api/notification.d.ts +16 -0
- package/dist/api/notifier.d.ts +8 -0
- package/dist/api/publisher-options.d.ts +33 -0
- package/dist/api/publisher-publish-options.d.ts +6 -0
- package/dist/api/publisher-state.d.ts +21 -0
- package/dist/api/publisher-unpublish-options.d.ts +6 -0
- package/dist/api/publisher.d.ts +65 -0
- package/dist/api/referral.d.ts +38 -0
- package/dist/api/registerer-options.d.ts +46 -0
- package/dist/api/registerer-register-options.d.ts +11 -0
- package/dist/api/registerer-state.d.ts +21 -0
- package/dist/api/registerer-unregister-options.d.ts +16 -0
- package/dist/api/registerer.d.ts +144 -0
- package/dist/api/session-bye-options.d.ts +11 -0
- package/dist/api/session-delegate.d.ts +73 -0
- package/dist/api/session-description-handler-factory.d.ts +15 -0
- package/dist/api/session-description-handler.d.ts +74 -0
- package/dist/api/session-info-options.d.ts +11 -0
- package/dist/api/session-invite-options.d.ts +28 -0
- package/dist/api/session-message-options.d.ts +11 -0
- package/dist/api/session-options.d.ts +8 -0
- package/dist/api/session-refer-options.d.ts +14 -0
- package/dist/api/session-state.d.ts +45 -0
- package/dist/api/session.d.ts +359 -0
- package/dist/api/subscriber-options.d.ts +11 -0
- package/dist/api/subscriber-subscribe-options.d.ts +6 -0
- package/dist/api/subscriber.d.ts +94 -0
- package/dist/api/subscription-delegate.d.ts +12 -0
- package/dist/api/subscription-options.d.ts +8 -0
- package/dist/api/subscription-state.d.ts +19 -0
- package/dist/api/subscription-subscribe-options.d.ts +6 -0
- package/dist/api/subscription-unsubscribe-options.d.ts +6 -0
- package/dist/api/subscription.d.ts +84 -0
- package/dist/api/transport-state.d.ts +37 -0
- package/dist/api/transport.d.ts +159 -0
- package/dist/api/user-agent-delegate.d.ts +84 -0
- package/dist/api/user-agent-options.d.ts +253 -0
- package/dist/api/user-agent-state.d.ts +14 -0
- package/dist/api/user-agent.d.ts +200 -0
- package/dist/core/dialogs/dialog-state.d.ts +34 -0
- package/dist/core/dialogs/dialog.d.ts +161 -0
- package/dist/core/dialogs/index.d.ts +4 -0
- package/dist/core/dialogs/session-dialog.d.ts +196 -0
- package/dist/core/dialogs/subscription-dialog.d.ts +120 -0
- package/dist/core/exceptions/exception.d.ts +8 -0
- package/dist/core/exceptions/index.d.ts +3 -0
- package/dist/core/exceptions/transaction-state-error.d.ts +8 -0
- package/dist/core/exceptions/transport-error.d.ts +8 -0
- package/dist/core/index.d.ts +15 -0
- package/dist/core/log/index.d.ts +3 -0
- package/dist/core/log/levels.d.ts +10 -0
- package/dist/core/log/logger-factory.d.ts +21 -0
- package/dist/core/log/logger.d.ts +19 -0
- package/dist/core/messages/body.d.ts +64 -0
- package/dist/core/messages/digest-authentication.d.ts +51 -0
- package/dist/core/messages/incoming-message.d.ts +79 -0
- package/dist/core/messages/incoming-request-message.d.ts +10 -0
- package/dist/core/messages/incoming-request.d.ts +67 -0
- package/dist/core/messages/incoming-response-message.d.ts +10 -0
- package/dist/core/messages/incoming-response.d.ts +12 -0
- package/dist/core/messages/index.d.ts +13 -0
- package/dist/core/messages/md5.d.ts +32 -0
- package/dist/core/messages/methods/ack.d.ts +18 -0
- package/dist/core/messages/methods/bye.d.ts +21 -0
- package/dist/core/messages/methods/cancel.d.ts +21 -0
- package/dist/core/messages/methods/constants.d.ts +20 -0
- package/dist/core/messages/methods/index.d.ts +13 -0
- package/dist/core/messages/methods/info.d.ts +21 -0
- package/dist/core/messages/methods/invite.d.ts +86 -0
- package/dist/core/messages/methods/message.d.ts +21 -0
- package/dist/core/messages/methods/notify.d.ts +21 -0
- package/dist/core/messages/methods/prack.d.ts +21 -0
- package/dist/core/messages/methods/publish.d.ts +21 -0
- package/dist/core/messages/methods/refer.d.ts +21 -0
- package/dist/core/messages/methods/register.d.ts +21 -0
- package/dist/core/messages/methods/subscribe.d.ts +54 -0
- package/dist/core/messages/outgoing-request-message.d.ts +94 -0
- package/dist/core/messages/outgoing-request.d.ts +67 -0
- package/dist/core/messages/outgoing-response.d.ts +42 -0
- package/dist/core/messages/parser.d.ts +14 -0
- package/dist/core/messages/utils.d.ts +24 -0
- package/dist/core/session/index.d.ts +2 -0
- package/dist/core/session/session-delegate.d.ts +70 -0
- package/dist/core/session/session.d.ts +134 -0
- package/dist/core/subscription/index.d.ts +2 -0
- package/dist/core/subscription/subscription-delegate.d.ts +27 -0
- package/dist/core/subscription/subscription.d.ts +55 -0
- package/dist/core/timers.d.ts +20 -0
- package/dist/core/transactions/client-transaction.d.ts +45 -0
- package/dist/core/transactions/index.d.ts +10 -0
- package/dist/core/transactions/invite-client-transaction.d.ts +116 -0
- package/dist/core/transactions/invite-server-transaction.d.ts +127 -0
- package/dist/core/transactions/non-invite-client-transaction.d.ts +69 -0
- package/dist/core/transactions/non-invite-server-transaction.d.ts +57 -0
- package/dist/core/transactions/server-transaction.d.ts +35 -0
- package/dist/core/transactions/transaction-state.d.ts +13 -0
- package/dist/core/transactions/transaction-user.d.ts +72 -0
- package/dist/core/transactions/transaction.d.ts +79 -0
- package/dist/core/transport.d.ts +31 -0
- package/dist/core/user-agent-core/allowed-methods.d.ts +4 -0
- package/dist/core/user-agent-core/index.d.ts +3 -0
- package/dist/core/user-agent-core/user-agent-core-configuration.d.ts +99 -0
- package/dist/core/user-agent-core/user-agent-core-delegate.d.ts +37 -0
- package/dist/core/user-agent-core/user-agent-core.d.ts +179 -0
- package/dist/core/user-agents/bye-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/bye-user-agent-server.d.ts +10 -0
- package/dist/core/user-agents/cancel-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/index.d.ts +26 -0
- package/dist/core/user-agents/info-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/info-user-agent-server.d.ts +10 -0
- package/dist/core/user-agents/invite-user-agent-client.d.ts +35 -0
- package/dist/core/user-agents/invite-user-agent-server.d.ts +77 -0
- package/dist/core/user-agents/message-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/message-user-agent-server.d.ts +10 -0
- package/dist/core/user-agents/notify-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/notify-user-agent-server.d.ts +16 -0
- package/dist/core/user-agents/prack-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/prack-user-agent-server.d.ts +16 -0
- package/dist/core/user-agents/publish-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/re-invite-user-agent-client.d.ts +18 -0
- package/dist/core/user-agents/re-invite-user-agent-server.d.ts +41 -0
- package/dist/core/user-agents/re-subscribe-user-agent-client.d.ts +17 -0
- package/dist/core/user-agents/re-subscribe-user-agent-server.d.ts +10 -0
- package/dist/core/user-agents/refer-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/refer-user-agent-server.d.ts +16 -0
- package/dist/core/user-agents/register-user-agent-client.d.ts +10 -0
- package/dist/core/user-agents/register-user-agent-server.d.ts +11 -0
- package/dist/core/user-agents/subscribe-user-agent-client.d.ts +65 -0
- package/dist/core/user-agents/subscribe-user-agent-server.d.ts +11 -0
- package/dist/core/user-agents/user-agent-client.d.ts +103 -0
- package/dist/core/user-agents/user-agent-server.d.ts +79 -0
- package/dist/grammar/grammar.d.ts +26 -0
- package/dist/grammar/index.d.ts +4 -0
- package/dist/grammar/name-addr-header.d.ts +24 -0
- package/dist/grammar/parameters.d.ts +16 -0
- package/dist/grammar/pegjs/dist/grammar.d.ts +50 -0
- package/dist/grammar/uri.d.ts +62 -0
- package/dist/{types/index.d.ts → index.d.ts} +7 -3
- package/dist/main.d.ts +9 -0
- package/dist/new-index.d.ts +199 -0
- package/dist/platform/web/index.d.ts +4 -0
- package/dist/platform/web/modifiers/index.d.ts +5 -0
- package/dist/platform/web/modifiers/modifiers.d.ts +41 -0
- package/dist/platform/web/session-description-handler/index.d.ts +14 -0
- package/dist/platform/web/session-description-handler/media-stream-factory-default.d.ts +6 -0
- package/dist/platform/web/session-description-handler/media-stream-factory.d.ts +6 -0
- package/dist/platform/web/session-description-handler/peer-connection-configuration-default.d.ts +5 -0
- package/dist/platform/web/session-description-handler/peer-connection-delegate.d.ts +63 -0
- package/dist/platform/web/session-description-handler/session-description-handler-configuration.d.ts +16 -0
- package/dist/platform/web/session-description-handler/session-description-handler-factory-default.d.ts +11 -0
- package/dist/platform/web/session-description-handler/session-description-handler-factory-options.d.ts +9 -0
- package/dist/platform/web/session-description-handler/session-description-handler-factory.d.ts +16 -0
- package/dist/platform/web/session-description-handler/session-description-handler-options.d.ts +47 -0
- package/dist/platform/web/session-description-handler/session-description-handler.d.ts +212 -0
- package/dist/platform/web/simple-user/index.d.ts +7 -0
- package/dist/platform/web/simple-user/simple-user-delegate.d.ts +72 -0
- package/dist/platform/web/simple-user/simple-user-options.d.ts +90 -0
- package/dist/platform/web/simple-user/simple-user.d.ts +226 -0
- package/dist/platform/web/transport/index.d.ts +6 -0
- package/dist/platform/web/transport/transport-options.d.ts +30 -0
- package/dist/platform/web/transport/transport.d.ts +125 -0
- package/dist/ue-softphone-sdk.js +2 -1
- package/dist/ue-softphone-sdk.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/webPhoneSdk.d.ts +24 -0
- package/dist/webrtc.d.ts +17 -0
- package/{rollup-new.config.mjs → new-rollup.config.mjs} +1 -1
- package/package.json +6 -6
- package/rollup.config.js +15 -14
- package/src/api/api-extractor.json +358 -0
- package/src/api/bye.ts +27 -0
- package/src/api/dtmf.ts +27 -0
- package/src/api/emitter.ts +110 -0
- package/src/api/exceptions/content-type-unsupported.ts +11 -0
- package/src/api/exceptions/index.ts +5 -0
- package/src/api/exceptions/request-pending.ts +12 -0
- package/src/api/exceptions/session-description-handler.ts +11 -0
- package/src/api/exceptions/session-terminated.ts +11 -0
- package/src/api/exceptions/state-transition.ts +11 -0
- package/src/api/index.ts +58 -0
- package/src/api/info.ts +27 -0
- package/src/api/invitation-accept-options.ts +20 -0
- package/src/api/invitation-progress-options.ts +36 -0
- package/src/api/invitation-reject-options.ts +22 -0
- package/src/api/invitation.ts +816 -0
- package/src/api/inviter-cancel-options.ts +9 -0
- package/src/api/inviter-invite-options.ts +29 -0
- package/src/api/inviter-options.ts +44 -0
- package/src/api/inviter.ts +1126 -0
- package/src/api/message.ts +27 -0
- package/src/api/messager-message-options.ts +12 -0
- package/src/api/messager-options.ts +18 -0
- package/src/api/messager.ts +89 -0
- package/src/api/notification.ts +27 -0
- package/src/api/notifier.ts +7 -0
- package/src/api/publisher-options.ts +34 -0
- package/src/api/publisher-publish-options.ts +6 -0
- package/src/api/publisher-state.ts +21 -0
- package/src/api/publisher-unpublish-options.ts +6 -0
- package/src/api/publisher.ts +418 -0
- package/src/api/referral.ts +89 -0
- package/src/api/registerer-options.ts +55 -0
- package/src/api/registerer-register-options.ts +12 -0
- package/src/api/registerer-state.ts +21 -0
- package/src/api/registerer-unregister-options.ts +17 -0
- package/src/api/registerer.ts +814 -0
- package/src/api/session-bye-options.ts +12 -0
- package/src/api/session-delegate.ts +80 -0
- package/src/api/session-description-handler-factory.ts +16 -0
- package/src/api/session-description-handler.ts +89 -0
- package/src/api/session-info-options.ts +12 -0
- package/src/api/session-invite-options.ts +29 -0
- package/src/api/session-message-options.ts +12 -0
- package/src/api/session-options.ts +8 -0
- package/src/api/session-refer-options.ts +15 -0
- package/src/api/session-state.ts +45 -0
- package/src/api/session.ts +1448 -0
- package/src/api/subscriber-options.ts +12 -0
- package/src/api/subscriber-subscribe-options.ts +6 -0
- package/src/api/subscriber.ts +536 -0
- package/src/api/subscription-delegate.ts +13 -0
- package/src/api/subscription-options.ts +8 -0
- package/src/api/subscription-state.ts +19 -0
- package/src/api/subscription-subscribe-options.ts +6 -0
- package/src/api/subscription-unsubscribe-options.ts +6 -0
- package/src/api/subscription.ts +161 -0
- package/src/api/transport-state.ts +37 -0
- package/src/api/transport.ts +169 -0
- package/src/api/user-agent-delegate.ts +95 -0
- package/src/api/user-agent-options.ts +322 -0
- package/src/api/user-agent-state.ts +14 -0
- package/src/api/user-agent.ts +1014 -0
- package/src/core/api-extractor.json +358 -0
- package/src/core/dialogs/dialog-state.ts +35 -0
- package/src/core/dialogs/dialog.ts +605 -0
- package/src/core/dialogs/index.ts +4 -0
- package/src/core/dialogs/session-dialog.ts +996 -0
- package/src/core/dialogs/subscription-dialog.ts +557 -0
- package/src/core/exceptions/exception.ts +11 -0
- package/src/core/exceptions/index.ts +3 -0
- package/src/core/exceptions/transaction-state-error.ts +11 -0
- package/src/core/exceptions/transport-error.ts +11 -0
- package/src/core/index.ts +19 -0
- package/src/core/log/index.ts +3 -0
- package/src/core/log/levels.ts +10 -0
- package/src/core/log/logger-factory.ts +119 -0
- package/src/core/log/logger.ts +42 -0
- package/src/core/messages/body.ts +171 -0
- package/src/core/messages/digest-authentication.ts +190 -0
- package/src/core/messages/incoming-message.ts +152 -0
- package/src/core/messages/incoming-request-message.ts +14 -0
- package/src/core/messages/incoming-request.ts +75 -0
- package/src/core/messages/incoming-response-message.ts +14 -0
- package/src/core/messages/incoming-response.ts +13 -0
- package/src/core/messages/index.ts +18 -0
- package/src/core/messages/md5.ts +437 -0
- package/src/core/messages/methods/ack.ts +22 -0
- package/src/core/messages/methods/bye.ts +22 -0
- package/src/core/messages/methods/cancel.ts +22 -0
- package/src/core/messages/methods/constants.ts +21 -0
- package/src/core/messages/methods/index.ts +13 -0
- package/src/core/messages/methods/info.ts +22 -0
- package/src/core/messages/methods/invite.ts +104 -0
- package/src/core/messages/methods/message.ts +22 -0
- package/src/core/messages/methods/notify.ts +22 -0
- package/src/core/messages/methods/prack.ts +22 -0
- package/src/core/messages/methods/publish.ts +22 -0
- package/src/core/messages/methods/refer.ts +22 -0
- package/src/core/messages/methods/register.ts +22 -0
- package/src/core/messages/methods/subscribe.ts +59 -0
- package/src/core/messages/outgoing-request-message.ts +299 -0
- package/src/core/messages/outgoing-request.ts +77 -0
- package/src/core/messages/outgoing-response.ts +174 -0
- package/src/core/messages/parser.ts +265 -0
- package/src/core/messages/utils.ts +144 -0
- package/src/core/session/index.ts +2 -0
- package/src/core/session/session-delegate.ts +88 -0
- package/src/core/session/session.ts +158 -0
- package/src/core/subscription/index.ts +2 -0
- package/src/core/subscription/subscription-delegate.ts +30 -0
- package/src/core/subscription/subscription.ts +61 -0
- package/src/core/timers.ts +24 -0
- package/src/core/transactions/client-transaction.ts +78 -0
- package/src/core/transactions/index.ts +10 -0
- package/src/core/transactions/invite-client-transaction.ts +504 -0
- package/src/core/transactions/invite-server-transaction.ts +432 -0
- package/src/core/transactions/non-invite-client-transaction.ts +257 -0
- package/src/core/transactions/non-invite-server-transaction.ts +241 -0
- package/src/core/transactions/server-transaction.ts +47 -0
- package/src/core/transactions/transaction-state.ts +13 -0
- package/src/core/transactions/transaction-user.ts +82 -0
- package/src/core/transactions/transaction.ts +149 -0
- package/src/core/transport.ts +32 -0
- package/src/core/user-agent-core/allowed-methods.ts +19 -0
- package/src/core/user-agent-core/index.ts +3 -0
- package/src/core/user-agent-core/user-agent-core-configuration.ts +111 -0
- package/src/core/user-agent-core/user-agent-core-delegate.ts +50 -0
- package/src/core/user-agent-core/user-agent-core.ts +905 -0
- package/src/core/user-agents/bye-user-agent-client.ts +16 -0
- package/src/core/user-agents/bye-user-agent-server.ts +14 -0
- package/src/core/user-agents/cancel-user-agent-client.ts +14 -0
- package/src/core/user-agents/index.ts +26 -0
- package/src/core/user-agents/info-user-agent-client.ts +15 -0
- package/src/core/user-agents/info-user-agent-server.ts +14 -0
- package/src/core/user-agents/invite-user-agent-client.ts +405 -0
- package/src/core/user-agents/invite-user-agent-server.ts +269 -0
- package/src/core/user-agents/message-user-agent-client.ts +14 -0
- package/src/core/user-agents/message-user-agent-server.ts +14 -0
- package/src/core/user-agents/notify-user-agent-client.ts +15 -0
- package/src/core/user-agents/notify-user-agent-server.ts +30 -0
- package/src/core/user-agents/prack-user-agent-client.ts +16 -0
- package/src/core/user-agents/prack-user-agent-server.ts +37 -0
- package/src/core/user-agents/publish-user-agent-client.ts +14 -0
- package/src/core/user-agents/re-invite-user-agent-client.ts +127 -0
- package/src/core/user-agents/re-invite-user-agent-server.ts +109 -0
- package/src/core/user-agents/re-subscribe-user-agent-client.ts +78 -0
- package/src/core/user-agents/re-subscribe-user-agent-server.ts +14 -0
- package/src/core/user-agents/refer-user-agent-client.ts +15 -0
- package/src/core/user-agents/refer-user-agent-server.ts +30 -0
- package/src/core/user-agents/register-user-agent-client.ts +14 -0
- package/src/core/user-agents/register-user-agent-server.ts +14 -0
- package/src/core/user-agents/subscribe-user-agent-client.ts +341 -0
- package/src/core/user-agents/subscribe-user-agent-server.ts +14 -0
- package/src/core/user-agents/user-agent-client.ts +378 -0
- package/src/core/user-agents/user-agent-server.ts +276 -0
- package/src/grammar/grammar.ts +55 -0
- package/src/grammar/index.ts +4 -0
- package/src/grammar/name-addr-header.ts +58 -0
- package/src/grammar/parameters.ts +45 -0
- package/src/grammar/pegjs/README.md +9 -0
- package/src/grammar/pegjs/dist/grammar.ts +1557 -0
- package/src/grammar/pegjs/src/grammar.pegjs +1009 -0
- package/src/grammar/uri.ts +370 -0
- package/src/index.ts +59 -28
- package/src/lib/socket.io.esm.min.js +7 -0
- package/src/main.ts +26 -0
- package/src/new-index.ts +2478 -0
- package/src/platform/react/README.md +1 -0
- package/src/platform/web/index.ts +4 -0
- package/src/platform/web/modifiers/index.ts +5 -0
- package/src/platform/web/modifiers/modifiers.ts +180 -0
- package/src/platform/web/session-description-handler/api-extractor.json +358 -0
- package/src/platform/web/session-description-handler/index.ts +14 -0
- package/src/platform/web/session-description-handler/media-stream-factory-default.ts +22 -0
- package/src/platform/web/session-description-handler/media-stream-factory.ts +10 -0
- package/src/platform/web/session-description-handler/peer-connection-configuration-default.ts +17 -0
- package/src/platform/web/session-description-handler/peer-connection-delegate.ts +72 -0
- package/src/platform/web/session-description-handler/session-description-handler-configuration.ts +17 -0
- package/src/platform/web/session-description-handler/session-description-handler-factory-default.ts +45 -0
- package/src/platform/web/session-description-handler/session-description-handler-factory-options.ts +10 -0
- package/src/platform/web/session-description-handler/session-description-handler-factory.ts +17 -0
- package/src/platform/web/session-description-handler/session-description-handler-options.ts +56 -0
- package/src/platform/web/session-description-handler/session-description-handler.ts +938 -0
- package/src/platform/web/simple-user/api-extractor.json +358 -0
- package/src/platform/web/simple-user/index.ts +7 -0
- package/src/platform/web/simple-user/simple-user-delegate.ts +82 -0
- package/src/platform/web/simple-user/simple-user-options.ts +102 -0
- package/src/platform/web/simple-user/simple-user.ts +1099 -0
- package/src/platform/web/transport/api-extractor.json +358 -0
- package/src/platform/web/transport/index.ts +6 -0
- package/src/platform/web/transport/transport-options.ts +34 -0
- package/src/platform/web/transport/transport.ts +742 -0
- package/src/version.ts +8 -0
- package/src/webPhoneSdk.ts +67 -0
- package/src/webrtc.ts +318 -0
- package/tsconfig.json +26 -10
- /package/dist/{types/config.d.ts → config.d.ts} +0 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Logger, Subscription as SubscriptionDialog } from "../core";
|
|
2
|
+
import { Emitter, EmitterImpl } from "./emitter";
|
|
3
|
+
import { SubscriptionDelegate } from "./subscription-delegate";
|
|
4
|
+
import { SubscriptionOptions } from "./subscription-options";
|
|
5
|
+
import { SubscriptionState } from "./subscription-state";
|
|
6
|
+
import { SubscriptionSubscribeOptions } from "./subscription-subscribe-options";
|
|
7
|
+
import { SubscriptionUnsubscribeOptions } from "./subscription-unsubscribe-options";
|
|
8
|
+
import { UserAgent } from "./user-agent";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A subscription provides {@link Notification} of events.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* See {@link Subscriber} for details on establishing a subscription.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export abstract class Subscription {
|
|
19
|
+
/**
|
|
20
|
+
* Property reserved for use by instance owner.
|
|
21
|
+
* @defaultValue `undefined`
|
|
22
|
+
*/
|
|
23
|
+
public data: unknown;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Subscription delegate. See {@link SubscriptionDelegate} for details.
|
|
27
|
+
* @defaultValue `undefined`
|
|
28
|
+
*/
|
|
29
|
+
public delegate: SubscriptionDelegate | undefined;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* If the subscription state is SubscriptionState.Subscribed, the associated subscription dialog. Otherwise undefined.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
protected _dialog: SubscriptionDialog | undefined;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Our user agent.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
protected _userAgent: UserAgent;
|
|
42
|
+
|
|
43
|
+
private _disposed = false;
|
|
44
|
+
private _logger: Logger;
|
|
45
|
+
private _state: SubscriptionState = SubscriptionState.Initial;
|
|
46
|
+
private _stateEventEmitter: EmitterImpl<SubscriptionState>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Constructor.
|
|
50
|
+
* @param userAgent - User agent. See {@link UserAgent} for details.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
protected constructor(userAgent: UserAgent, options: SubscriptionOptions = {}) {
|
|
54
|
+
this._logger = userAgent.getLogger("sip.Subscription");
|
|
55
|
+
this._stateEventEmitter = new EmitterImpl<SubscriptionState>();
|
|
56
|
+
this._userAgent = userAgent;
|
|
57
|
+
this.delegate = options.delegate;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Destructor.
|
|
62
|
+
*/
|
|
63
|
+
public dispose(): Promise<void> {
|
|
64
|
+
if (this._disposed) {
|
|
65
|
+
return Promise.resolve();
|
|
66
|
+
}
|
|
67
|
+
this._disposed = true;
|
|
68
|
+
this._stateEventEmitter.removeAllListeners();
|
|
69
|
+
return Promise.resolve();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The subscribed subscription dialog.
|
|
74
|
+
*/
|
|
75
|
+
public get dialog(): SubscriptionDialog | undefined {
|
|
76
|
+
return this._dialog;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* True if disposed.
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
public get disposed(): boolean {
|
|
84
|
+
return this._disposed;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Subscription state. See {@link SubscriptionState} for details.
|
|
89
|
+
*/
|
|
90
|
+
public get state(): SubscriptionState {
|
|
91
|
+
return this._state;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Emits when the subscription `state` property changes.
|
|
96
|
+
*/
|
|
97
|
+
public get stateChange(): Emitter<SubscriptionState> {
|
|
98
|
+
return this._stateEventEmitter;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** @internal */
|
|
102
|
+
protected stateTransition(newState: SubscriptionState): void {
|
|
103
|
+
const invalidTransition = (): void => {
|
|
104
|
+
throw new Error(`Invalid state transition from ${this._state} to ${newState}`);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// Validate transition
|
|
108
|
+
switch (this._state) {
|
|
109
|
+
case SubscriptionState.Initial:
|
|
110
|
+
if (newState !== SubscriptionState.NotifyWait && newState !== SubscriptionState.Terminated) {
|
|
111
|
+
invalidTransition();
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
case SubscriptionState.NotifyWait:
|
|
115
|
+
if (newState !== SubscriptionState.Subscribed && newState !== SubscriptionState.Terminated) {
|
|
116
|
+
invalidTransition();
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
case SubscriptionState.Subscribed:
|
|
120
|
+
if (newState !== SubscriptionState.Terminated) {
|
|
121
|
+
invalidTransition();
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
case SubscriptionState.Terminated:
|
|
125
|
+
invalidTransition();
|
|
126
|
+
break;
|
|
127
|
+
default:
|
|
128
|
+
throw new Error("Unrecognized state.");
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Guard against duplicate transition
|
|
132
|
+
if (this._state === newState) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Transition
|
|
137
|
+
this._state = newState;
|
|
138
|
+
this._logger.log(`Subscription ${this._dialog ? this._dialog.id : undefined} transitioned to ${this._state}`);
|
|
139
|
+
this._stateEventEmitter.emit(this._state);
|
|
140
|
+
|
|
141
|
+
// Dispose
|
|
142
|
+
if (newState === SubscriptionState.Terminated) {
|
|
143
|
+
this.dispose();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Sends a re-SUBSCRIBE request if the subscription is "active".
|
|
149
|
+
*/
|
|
150
|
+
public abstract subscribe(options?: SubscriptionSubscribeOptions): Promise<void>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Unsubscribe from event notifications.
|
|
154
|
+
*
|
|
155
|
+
* @remarks
|
|
156
|
+
* If the subscription state is SubscriptionState.Subscribed, sends an in dialog SUBSCRIBE request
|
|
157
|
+
* with expires time of zero (an un-subscribe) and terminates the subscription.
|
|
158
|
+
* Otherwise a noop.
|
|
159
|
+
*/
|
|
160
|
+
public abstract unsubscribe(options?: SubscriptionUnsubscribeOptions): Promise<void>;
|
|
161
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {@link Transport} state.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The {@link Transport} behaves in a deterministic manner according to the following
|
|
6
|
+
* Finite State Machine (FSM).
|
|
7
|
+
* ```txt
|
|
8
|
+
* ______________________________
|
|
9
|
+
* | ____________ |
|
|
10
|
+
* Transport v v | |
|
|
11
|
+
* Constructed -> Disconnected -> Connecting -> Connected -> Disconnecting
|
|
12
|
+
* ^ ^ |_____________________^ | |
|
|
13
|
+
* | |_____________________________| |
|
|
14
|
+
* |_____________________________________________|
|
|
15
|
+
* ```
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export enum TransportState {
|
|
19
|
+
/**
|
|
20
|
+
* The `connect()` method was called.
|
|
21
|
+
*/
|
|
22
|
+
Connecting = "Connecting",
|
|
23
|
+
/**
|
|
24
|
+
* The `connect()` method resolved.
|
|
25
|
+
*/
|
|
26
|
+
Connected = "Connected",
|
|
27
|
+
/**
|
|
28
|
+
* The `disconnect()` method was called.
|
|
29
|
+
*/
|
|
30
|
+
Disconnecting = "Disconnecting",
|
|
31
|
+
/**
|
|
32
|
+
* The `connect()` method was rejected, or
|
|
33
|
+
* the `disconnect()` method completed, or
|
|
34
|
+
* network connectivity was lost.
|
|
35
|
+
*/
|
|
36
|
+
Disconnected = "Disconnected"
|
|
37
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Transport as CoreTransport } from "../core";
|
|
2
|
+
import { Emitter } from "./emitter";
|
|
3
|
+
import { TransportState } from "./transport-state";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Transport layer interface expected by the `UserAgent`.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* The transport behaves in a deterministic manner according to the
|
|
10
|
+
* the state defined in {@link TransportState}.
|
|
11
|
+
*
|
|
12
|
+
* The "Connecting" state is ONLY entered in response to the user calling `connect()`.
|
|
13
|
+
* The "Disconnecting" state is ONLY entered in response to the user calling `disconnect()`.
|
|
14
|
+
* The `onConnect` callback is ALWAYS called upon transitioning to the "Connected" state.
|
|
15
|
+
* The `onDisconnect` callback is ALWAYS called upon transitioning from the "Connected" state.
|
|
16
|
+
*
|
|
17
|
+
* Adherence to the state machine by the transport implementation is critical as the
|
|
18
|
+
* UserAgent depends on this behavior. Furthermore it is critical that the transport
|
|
19
|
+
* transition to the "Disconnected" state in all instances where network connectivity
|
|
20
|
+
* is lost as the UserAgent, API, and application layer more generally depend on knowing
|
|
21
|
+
* network was lost. For example, from a practical standpoint registrations and subscriptions are invalidated
|
|
22
|
+
* when network is lost - particularly in the case of connection oriented transport
|
|
23
|
+
* protocols such as a secure WebSocket transport.
|
|
24
|
+
*
|
|
25
|
+
* Proper handling the application level protocol recovery must be left to the application layer,
|
|
26
|
+
* thus the transport MUST NOT attempt to "auto-recover" from or otherwise hide loss of network.
|
|
27
|
+
* Note that callbacks and emitters such as `onConnect` and `onDisconnect` MUST NOT call methods
|
|
28
|
+
* `connect()` and `direct()` synchronously (state change handlers must not loop back). They may
|
|
29
|
+
* however do so asynchronously using a Promise resolution, `setTimeout`, or some other method.
|
|
30
|
+
* For example...
|
|
31
|
+
* ```ts
|
|
32
|
+
* transport.onDisconnect = () => {
|
|
33
|
+
* Promise.resolve().then(() => transport.connect());
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export interface Transport extends CoreTransport {
|
|
39
|
+
/**
|
|
40
|
+
* Transport state.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* The initial Transport state MUST be "disconnected" (after calling constructor).
|
|
44
|
+
*/
|
|
45
|
+
readonly state: TransportState;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Transport state change emitter.
|
|
49
|
+
*/
|
|
50
|
+
readonly stateChange: Emitter<TransportState>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Callback on state transition to "Connected".
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* When the `UserAgent` is constructed, this property is set.
|
|
57
|
+
* ```txt
|
|
58
|
+
* - The `state` MUST be "Connected" when called.
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
onConnect: (() => void) | undefined;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Callback on state transition from "Connected".
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* When the `UserAgent` is constructed, this property is set.
|
|
68
|
+
* ```txt
|
|
69
|
+
* - The `state` MUST NOT "Connected" when called.
|
|
70
|
+
* - If prior `state` is "Connecting" or "Connected", `error` MUST be defined.
|
|
71
|
+
* - If prior `state` is "Disconnecting", `error` MUST NOT be undefined.
|
|
72
|
+
* ```
|
|
73
|
+
* If the transition from "Connected" occurs because the transport
|
|
74
|
+
* user requested it by calling `disconnect`, then `error` will be undefined.
|
|
75
|
+
* Otherwise `error` will be defined to provide an indication that the
|
|
76
|
+
* transport initiated the transition from "Connected" - for example,
|
|
77
|
+
* perhaps network connectivity was lost.
|
|
78
|
+
*/
|
|
79
|
+
onDisconnect: ((error?: Error) => void) | undefined;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Callback on receipt of a message.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* When the `UserAgent` is constructed, this property is set.
|
|
86
|
+
* The `state` MUST be "Connected" when this is called.
|
|
87
|
+
*/
|
|
88
|
+
onMessage: ((message: string) => void) | undefined;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Connect to network.
|
|
92
|
+
*
|
|
93
|
+
* @remarks
|
|
94
|
+
* ```txt
|
|
95
|
+
* - If `state` is "Connecting", `state` MUST NOT transition before returning.
|
|
96
|
+
* - If `state` is "Connected", `state` MUST NOT transition before returning.
|
|
97
|
+
* - If `state` is "Disconnecting", `state` MUST transition to "Connecting" before returning.
|
|
98
|
+
* - If `state` is "Disconnected" `state` MUST transition to "Connecting" before returning.
|
|
99
|
+
* - The `state` MUST transition to "Connected" before resolving (assuming `state` is not already "Connected").
|
|
100
|
+
* - The `state` MUST transition to "Disconnecting" or "Disconnected" before rejecting and MUST reject with an Error.
|
|
101
|
+
* ```
|
|
102
|
+
* Resolves when the transport connects. Rejects if transport fails to connect.
|
|
103
|
+
* Rejects with {@link StateTransitionError} if a loop is detected.
|
|
104
|
+
* In particular, callbacks and emitters MUST NOT call this method synchronously.
|
|
105
|
+
*/
|
|
106
|
+
connect(): Promise<void>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Disconnect from network.
|
|
110
|
+
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* ```txt
|
|
113
|
+
* - If `state` is "Connecting", `state` MUST transition to "Disconnecting" before returning.
|
|
114
|
+
* - If `state` is "Connected", `state` MUST transition to "Disconnecting" before returning.
|
|
115
|
+
* - If `state` is "Disconnecting", `state` MUST NOT transition before returning.
|
|
116
|
+
* - If `state` is "Disconnected", `state` MUST NOT transition before returning.
|
|
117
|
+
* - The `state` MUST transition to "Disconnected" before resolving (assuming `state` is not already "Disconnected").
|
|
118
|
+
* - The `state` MUST transition to "Connecting" or "Connected" before rejecting and MUST reject with an Error.
|
|
119
|
+
* ```
|
|
120
|
+
* Resolves when the transport disconnects. Rejects if transport fails to disconnect.
|
|
121
|
+
* Rejects with {@link StateTransitionError} if a loop is detected.
|
|
122
|
+
* In particular, callbacks and emitters MUST NOT call this method synchronously.
|
|
123
|
+
*/
|
|
124
|
+
disconnect(): Promise<void>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Dispose.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* When the `UserAgent` is disposed or stopped, this method is called.
|
|
131
|
+
* The `UserAgent` MUST NOT continue to utilize the instance after calling this method.
|
|
132
|
+
*/
|
|
133
|
+
dispose(): Promise<void>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Returns true if the `state` equals "Connected".
|
|
137
|
+
*
|
|
138
|
+
* @remarks
|
|
139
|
+
* This is equivalent to `state === TransportState.Connected`.
|
|
140
|
+
* It is convenient. A common paradigm is, for example...
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* // Monitor transport connectivity
|
|
145
|
+
* userAgent.transport.stateChange.addListener(() => {
|
|
146
|
+
* if (userAgent.transport.isConnected()) {
|
|
147
|
+
* // handle transport connect
|
|
148
|
+
* } else {
|
|
149
|
+
* // handle transport disconnect
|
|
150
|
+
* }
|
|
151
|
+
* });
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
isConnected(): boolean;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Send a message.
|
|
158
|
+
*
|
|
159
|
+
* @remarks
|
|
160
|
+
* ```txt
|
|
161
|
+
* - If `state` is "Connecting", rejects with an Error.
|
|
162
|
+
* - If `state` is "Connected", resolves when the message is sent otherwise rejects with an Error.
|
|
163
|
+
* - If `state` is "Disconnecting", rejects with an Error.
|
|
164
|
+
* - If `state` is "Disconnected", rejects with an Error.
|
|
165
|
+
* ```
|
|
166
|
+
* @param message - Message to send.
|
|
167
|
+
*/
|
|
168
|
+
send(message: string): Promise<void>;
|
|
169
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { IncomingReferRequest, IncomingRegisterRequest, IncomingSubscribeRequest } from "../core";
|
|
2
|
+
import { Invitation } from "./invitation";
|
|
3
|
+
import { Message } from "./message";
|
|
4
|
+
import { Notification } from "./notification";
|
|
5
|
+
import { Referral } from "./referral";
|
|
6
|
+
import { Subscription } from "./subscription";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Delegate for {@link UserAgent}.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface UserAgentDelegate {
|
|
13
|
+
/**
|
|
14
|
+
* Called upon transport transitioning to connected state.
|
|
15
|
+
*/
|
|
16
|
+
onConnect?(): void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Called upon transport transitioning from connected state.
|
|
20
|
+
* @param error - An error if disconnect triggered by transport. Otherwise undefined.
|
|
21
|
+
*/
|
|
22
|
+
onDisconnect?(error?: Error): void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Called upon receipt of an invitation.
|
|
26
|
+
* @remarks
|
|
27
|
+
* Handler for incoming out of dialog INVITE requests.
|
|
28
|
+
* @param invitation - The invitation.
|
|
29
|
+
*/
|
|
30
|
+
onInvite?(invitation: Invitation): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Called upon receipt of a message.
|
|
34
|
+
* @remarks
|
|
35
|
+
* Handler for incoming out of dialog MESSAGE requests.
|
|
36
|
+
* @param message - The message.
|
|
37
|
+
*/
|
|
38
|
+
onMessage?(message: Message): void;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Called upon receipt of a notification.
|
|
42
|
+
* @remarks
|
|
43
|
+
* Handler for incoming out of dialog NOTIFY requests.
|
|
44
|
+
* @param notification - The notification.
|
|
45
|
+
*/
|
|
46
|
+
onNotify?(notification: Notification): void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @alpha
|
|
50
|
+
* Called upon receipt of a referral.
|
|
51
|
+
* @remarks
|
|
52
|
+
* Handler for incoming out of dialog REFER requests.
|
|
53
|
+
* @param referral - The referral.
|
|
54
|
+
*/
|
|
55
|
+
onRefer?(referral: Referral): void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @alpha
|
|
59
|
+
* Called upon receipt of a registration.
|
|
60
|
+
* @remarks
|
|
61
|
+
* Handler for incoming out of dialog REGISTER requests.
|
|
62
|
+
* @param registration - The registration.
|
|
63
|
+
*/
|
|
64
|
+
onRegister?(registration: unknown /* TODO: Registration */): void;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @alpha
|
|
68
|
+
* Called upon receipt of a subscription.
|
|
69
|
+
* @remarks
|
|
70
|
+
* Handler for incoming out of dialog SUBSCRIBE requests.
|
|
71
|
+
* @param subscription - The subscription.
|
|
72
|
+
*/
|
|
73
|
+
onSubscribe?(subscription: Subscription): void;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
* Called upon receipt of an out of dialog REFER. Used by test suite.
|
|
78
|
+
* @param request - The request.
|
|
79
|
+
*/
|
|
80
|
+
onReferRequest?(request: IncomingReferRequest): void;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
* Called upon receipt of a REGISTER request. Used by test suite.
|
|
85
|
+
* @param request - The request.
|
|
86
|
+
*/
|
|
87
|
+
onRegisterRequest?(request: IncomingRegisterRequest): void;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
* Called upon receipt of an out of dialog SUBSCRIBE request. Used by test suite.
|
|
92
|
+
* @param request - The request.
|
|
93
|
+
*/
|
|
94
|
+
onSubscribeRequest?(request: IncomingSubscribeRequest): void;
|
|
95
|
+
}
|