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,370 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { Parameters } from "./parameters";
|
|
3
|
+
|
|
4
|
+
interface URIObject {
|
|
5
|
+
scheme: string;
|
|
6
|
+
user: string | undefined;
|
|
7
|
+
host: string;
|
|
8
|
+
port: number | undefined;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* URI.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export class URI extends Parameters {
|
|
16
|
+
public headers: {[name: string]: Array<string>} = {};
|
|
17
|
+
private normal: URIObject;
|
|
18
|
+
private raw: URIObject;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Constructor
|
|
22
|
+
* @param scheme -
|
|
23
|
+
* @param user -
|
|
24
|
+
* @param host -
|
|
25
|
+
* @param port -
|
|
26
|
+
* @param parameters -
|
|
27
|
+
* @param headers -
|
|
28
|
+
*/
|
|
29
|
+
constructor(
|
|
30
|
+
scheme = "sip",
|
|
31
|
+
user: string,
|
|
32
|
+
host: string,
|
|
33
|
+
port?: number,
|
|
34
|
+
parameters?: { [name: string]: string | number | null },
|
|
35
|
+
headers?: {[name: string]: Array<string>}
|
|
36
|
+
) {
|
|
37
|
+
super(parameters || {});
|
|
38
|
+
// Checks
|
|
39
|
+
if (!host) {
|
|
40
|
+
throw new TypeError('missing or invalid "host" parameter');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
for (const header in headers) {
|
|
44
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
45
|
+
if (headers.hasOwnProperty(header)) {
|
|
46
|
+
this.setHeader(header, headers[header]);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Raw URI
|
|
51
|
+
this.raw = {
|
|
52
|
+
scheme,
|
|
53
|
+
user,
|
|
54
|
+
host,
|
|
55
|
+
port
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Normalized URI
|
|
59
|
+
this.normal = {
|
|
60
|
+
scheme: scheme.toLowerCase(),
|
|
61
|
+
user,
|
|
62
|
+
host: host.toLowerCase(),
|
|
63
|
+
port
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
get scheme(): string { return this.normal.scheme; }
|
|
68
|
+
set scheme(value: string) {
|
|
69
|
+
this.raw.scheme = value;
|
|
70
|
+
this.normal.scheme = value.toLowerCase();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get user(): string | undefined { return this.normal.user; }
|
|
74
|
+
set user(value: string | undefined) {
|
|
75
|
+
this.normal.user = this.raw.user = value;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get host(): string { return this.normal.host; }
|
|
79
|
+
set host(value: string) {
|
|
80
|
+
this.raw.host = value;
|
|
81
|
+
this.normal.host = value.toLowerCase();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
get aor(): string { return this.normal.user + "@" + this.normal.host; }
|
|
85
|
+
|
|
86
|
+
get port(): number | undefined { return this.normal.port; }
|
|
87
|
+
set port(value: number | undefined) {
|
|
88
|
+
this.normal.port = this.raw.port = value === 0 ? value : value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public setHeader(name: string, value: Array<string> | string): void {
|
|
92
|
+
this.headers[this.headerize(name)] = (value instanceof Array) ? value : [value];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public getHeader(name: string): Array<string> | undefined {
|
|
96
|
+
if (name) {
|
|
97
|
+
return this.headers[this.headerize(name)];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public hasHeader(name: string): boolean {
|
|
102
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
103
|
+
return !!name && !!this.headers.hasOwnProperty(this.headerize(name));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public deleteHeader(header: string): Array<string> | undefined {
|
|
107
|
+
header = this.headerize(header);
|
|
108
|
+
|
|
109
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
110
|
+
if (this.headers.hasOwnProperty(header)) {
|
|
111
|
+
const value = this.headers[header];
|
|
112
|
+
delete this.headers[header];
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public clearHeaders(): void {
|
|
118
|
+
this.headers = {};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public clone(): URI {
|
|
122
|
+
return new URI(
|
|
123
|
+
this._raw.scheme,
|
|
124
|
+
this._raw.user || "",
|
|
125
|
+
this._raw.host,
|
|
126
|
+
this._raw.port,
|
|
127
|
+
JSON.parse(JSON.stringify(this.parameters)),
|
|
128
|
+
JSON.parse(JSON.stringify(this.headers)));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public toRaw(): string {
|
|
132
|
+
return this._toString(this._raw);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public toString(): string {
|
|
136
|
+
return this._toString(this._normal);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private get _normal(): URIObject { return this.normal; }
|
|
140
|
+
|
|
141
|
+
private get _raw(): URIObject { return this.raw; }
|
|
142
|
+
|
|
143
|
+
private _toString(uri: any): string {
|
|
144
|
+
let uriString: string = uri.scheme + ":";
|
|
145
|
+
// add slashes if it's not a sip(s) URI
|
|
146
|
+
if (!uri.scheme.toLowerCase().match("^sips?$")) {
|
|
147
|
+
uriString += "//";
|
|
148
|
+
}
|
|
149
|
+
if (uri.user) {
|
|
150
|
+
uriString += this.escapeUser(uri.user) + "@";
|
|
151
|
+
}
|
|
152
|
+
uriString += uri.host;
|
|
153
|
+
if (uri.port || uri.port === 0) {
|
|
154
|
+
uriString += ":" + uri.port;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
for (const parameter in this.parameters) {
|
|
158
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
159
|
+
if (this.parameters.hasOwnProperty(parameter)) {
|
|
160
|
+
uriString += ";" + parameter;
|
|
161
|
+
|
|
162
|
+
if (this.parameters[parameter] !== null) {
|
|
163
|
+
uriString += "=" + this.parameters[parameter];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const headers: Array<string> = [];
|
|
169
|
+
for (const header in this.headers) {
|
|
170
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
171
|
+
if (this.headers.hasOwnProperty(header)) {
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-for-in-array
|
|
173
|
+
for (const idx in this.headers[header]) {
|
|
174
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
175
|
+
if (this.headers[header].hasOwnProperty(idx)) {
|
|
176
|
+
headers.push(header + "=" + this.headers[header][idx]);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (headers.length > 0) {
|
|
183
|
+
uriString += "?" + headers.join("&");
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return uriString;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/*
|
|
190
|
+
* Hex-escape a SIP URI user.
|
|
191
|
+
* @private
|
|
192
|
+
* @param {String} user
|
|
193
|
+
*/
|
|
194
|
+
private escapeUser(user: string): string {
|
|
195
|
+
let decodedUser: string;
|
|
196
|
+
|
|
197
|
+
// FIXME: This is called by toString above which should never throw, but
|
|
198
|
+
// decodeURIComponent can throw and I've seen one case in production where
|
|
199
|
+
// it did throw resulting in a cascading failure. This class should be
|
|
200
|
+
// fixed so that decodeURIComponent is not called at this point (in toString).
|
|
201
|
+
// The user should be decoded when the URI is constructor or some other
|
|
202
|
+
// place where we can catch the error before the URI is created or somesuch.
|
|
203
|
+
// eslint-disable-next-line no-useless-catch
|
|
204
|
+
try {
|
|
205
|
+
decodedUser = decodeURIComponent(user);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Don't hex-escape ':' (%3A), '+' (%2B), '?' (%3F"), '/' (%2F).
|
|
211
|
+
return encodeURIComponent(decodedUser)
|
|
212
|
+
.replace(/%3A/ig, ":")
|
|
213
|
+
.replace(/%2B/ig, "+")
|
|
214
|
+
.replace(/%3F/ig, "?")
|
|
215
|
+
.replace(/%2F/ig, "/");
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
private headerize(str: string): string {
|
|
219
|
+
const exceptions: any = {
|
|
220
|
+
"Call-Id": "Call-ID",
|
|
221
|
+
"Cseq": "CSeq",
|
|
222
|
+
"Min-Se": "Min-SE",
|
|
223
|
+
"Rack": "RAck",
|
|
224
|
+
"Rseq": "RSeq",
|
|
225
|
+
"Www-Authenticate": "WWW-Authenticate",
|
|
226
|
+
};
|
|
227
|
+
const name: Array<string> = str.toLowerCase().replace(/_/g, "-").split("-");
|
|
228
|
+
const parts: number = name.length;
|
|
229
|
+
let hname = "";
|
|
230
|
+
|
|
231
|
+
for (let part = 0; part < parts; part++) {
|
|
232
|
+
if (part !== 0) {
|
|
233
|
+
hname += "-";
|
|
234
|
+
}
|
|
235
|
+
hname += name[part].charAt(0).toUpperCase() + name[part].substring(1);
|
|
236
|
+
}
|
|
237
|
+
if (exceptions[hname]) {
|
|
238
|
+
hname = exceptions[hname];
|
|
239
|
+
}
|
|
240
|
+
return hname;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Returns true if URIs are equivalent per RFC 3261 Section 19.1.4.
|
|
246
|
+
* @param a URI to compare
|
|
247
|
+
* @param b URI to compare
|
|
248
|
+
*
|
|
249
|
+
* @remarks
|
|
250
|
+
* 19.1.4 URI Comparison
|
|
251
|
+
* Some operations in this specification require determining whether two
|
|
252
|
+
* SIP or SIPS URIs are equivalent.
|
|
253
|
+
*
|
|
254
|
+
* https://tools.ietf.org/html/rfc3261#section-19.1.4
|
|
255
|
+
* @internal
|
|
256
|
+
*/
|
|
257
|
+
export function equivalentURI(a: URI, b: URI): boolean {
|
|
258
|
+
|
|
259
|
+
// o A SIP and SIPS URI are never equivalent.
|
|
260
|
+
if (a.scheme !== b.scheme) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// o Comparison of the userinfo of SIP and SIPS URIs is case-
|
|
265
|
+
// sensitive. This includes userinfo containing passwords or
|
|
266
|
+
// formatted as telephone-subscribers. Comparison of all other
|
|
267
|
+
// components of the URI is case-insensitive unless explicitly
|
|
268
|
+
// defined otherwise.
|
|
269
|
+
//
|
|
270
|
+
// o The ordering of parameters and header fields is not significant
|
|
271
|
+
// in comparing SIP and SIPS URIs.
|
|
272
|
+
//
|
|
273
|
+
// o Characters other than those in the "reserved" set (see RFC 2396
|
|
274
|
+
// [5]) are equivalent to their ""%" HEX HEX" encoding.
|
|
275
|
+
//
|
|
276
|
+
// o An IP address that is the result of a DNS lookup of a host name
|
|
277
|
+
// does not match that host name.
|
|
278
|
+
//
|
|
279
|
+
// o For two URIs to be equal, the user, password, host, and port
|
|
280
|
+
// components must match.
|
|
281
|
+
//
|
|
282
|
+
// A URI omitting the user component will not match a URI that
|
|
283
|
+
// includes one. A URI omitting the password component will not
|
|
284
|
+
// match a URI that includes one.
|
|
285
|
+
//
|
|
286
|
+
// A URI omitting any component with a default value will not
|
|
287
|
+
// match a URI explicitly containing that component with its
|
|
288
|
+
// default value. For instance, a URI omitting the optional port
|
|
289
|
+
// component will not match a URI explicitly declaring port 5060.
|
|
290
|
+
// The same is true for the transport-parameter, ttl-parameter,
|
|
291
|
+
// user-parameter, and method components.
|
|
292
|
+
//
|
|
293
|
+
// Defining sip:user@host to not be equivalent to
|
|
294
|
+
// sip:user@host:5060 is a change from RFC 2543. When deriving
|
|
295
|
+
// addresses from URIs, equivalent addresses are expected from
|
|
296
|
+
// equivalent URIs. The URI sip:user@host:5060 will always
|
|
297
|
+
// resolve to port 5060. The URI sip:user@host may resolve to
|
|
298
|
+
// other ports through the DNS SRV mechanisms detailed in [4].
|
|
299
|
+
|
|
300
|
+
// FIXME: TODO:
|
|
301
|
+
// - character compared to hex encoding is not handled
|
|
302
|
+
// - password does not exist on URI currently
|
|
303
|
+
if (a.user !== b.user || a.host !== b.host || a.port !== b.port) {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// o URI uri-parameter components are compared as follows:
|
|
308
|
+
function compareParameters(a: URI, b: URI): boolean {
|
|
309
|
+
// - Any uri-parameter appearing in both URIs must match.
|
|
310
|
+
const parameterKeysA = Object.keys(a.parameters);
|
|
311
|
+
const parameterKeysB = Object.keys(b.parameters);
|
|
312
|
+
const intersection = parameterKeysA.filter(x => parameterKeysB.includes(x));
|
|
313
|
+
if (!intersection.every(key => a.parameters[key] === b.parameters[key])) {
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// - A user, ttl, or method uri-parameter appearing in only one
|
|
318
|
+
// URI never matches, even if it contains the default value.
|
|
319
|
+
if (!["user", "ttl", "method", "transport"].every(key => a.hasParam(key) && b.hasParam(key) || !a.hasParam(key) && !b.hasParam(key))) {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// - A URI that includes an maddr parameter will not match a URI
|
|
324
|
+
// that contains no maddr parameter.
|
|
325
|
+
if (!["maddr"].every(key => a.hasParam(key) && b.hasParam(key) || !a.hasParam(key) && !b.hasParam(key))) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// - All other uri-parameters appearing in only one URI are
|
|
330
|
+
// ignored when comparing the URIs.
|
|
331
|
+
return true;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (!compareParameters(a, b)) {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// o URI header components are never ignored. Any present header
|
|
339
|
+
// component MUST be present in both URIs and match for the URIs
|
|
340
|
+
// to match. The matching rules are defined for each header field
|
|
341
|
+
// in Section 20.
|
|
342
|
+
const headerKeysA = Object.keys(a.headers);
|
|
343
|
+
const headerKeysB = Object.keys(b.headers);
|
|
344
|
+
|
|
345
|
+
// No need to check if no headers
|
|
346
|
+
if (headerKeysA.length !== 0 || headerKeysB.length !== 0) {
|
|
347
|
+
|
|
348
|
+
// Must have same number of headers
|
|
349
|
+
if (headerKeysA.length !== headerKeysB.length) {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Must have same headers
|
|
354
|
+
const intersection = headerKeysA.filter(x => headerKeysB.includes(x));
|
|
355
|
+
if (intersection.length !== headerKeysB.length) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// FIXME: Not to spec. But perhaps not worth fixing?
|
|
360
|
+
// Must have same header values
|
|
361
|
+
// It seems too much to consider multiple headers with same name.
|
|
362
|
+
// It seems too much to compare two header params according to the rule of each header.
|
|
363
|
+
// We'll assume a single header and compare them string to string...
|
|
364
|
+
if (!intersection.every(key => a.headers[key].length && b.headers[key].length && a.headers[key][0] === b.headers[key][0])) {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
return true;
|
|
370
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
// @ts-ignore: Unreachable code error
|
|
12
12
|
// import { Parameters } from './grammar/parameters.js'
|
|
13
13
|
import io from "socket.io-client";
|
|
14
|
+
import WebPhoneSdk from "./webPhoneSdk";
|
|
14
15
|
import { AUDIO_FORBIDDEN, DENIED, NOT_OPEN_AUDIO } from "./config";
|
|
15
|
-
import { UeWebrtc } from "ue-webrtc";
|
|
16
16
|
|
|
17
17
|
import { Base64 } from "js-base64";
|
|
18
18
|
import md5 from "js-md5";
|
|
@@ -104,7 +104,7 @@ interface MuteOrUnMuteParams {
|
|
|
104
104
|
fail?: Function;
|
|
105
105
|
}
|
|
106
106
|
interface TransferParams {
|
|
107
|
-
|
|
107
|
+
mode: String;
|
|
108
108
|
number: String;
|
|
109
109
|
agentNumber?: String;
|
|
110
110
|
success?: Function;
|
|
@@ -158,6 +158,7 @@ interface consultParams {
|
|
|
158
158
|
fail?: Function;
|
|
159
159
|
}
|
|
160
160
|
interface cancleConsultParams {
|
|
161
|
+
agentNumber: String;
|
|
161
162
|
success?: Function;
|
|
162
163
|
fail?: Function;
|
|
163
164
|
}
|
|
@@ -166,15 +167,18 @@ interface stopConsultParams {
|
|
|
166
167
|
fail?: Function;
|
|
167
168
|
}
|
|
168
169
|
interface resumeConsultParams {
|
|
170
|
+
agentNumber: String;
|
|
169
171
|
success?: Function;
|
|
170
172
|
fail?: Function;
|
|
171
173
|
}
|
|
172
174
|
interface consultTransferParams {
|
|
175
|
+
agentNumber: String;
|
|
173
176
|
success?: Function;
|
|
174
177
|
fail?: Function;
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
interface threeWayCallParams {
|
|
181
|
+
agentNumber: String;
|
|
178
182
|
success?: Function;
|
|
179
183
|
fail?: Function;
|
|
180
184
|
}
|
|
@@ -389,7 +393,8 @@ export default class ueSoftphone {
|
|
|
389
393
|
server,
|
|
390
394
|
loginType,
|
|
391
395
|
loginInfo.data.pushServer,
|
|
392
|
-
loginInfo.data.agent
|
|
396
|
+
loginInfo.data.agent,
|
|
397
|
+
options.success
|
|
393
398
|
);
|
|
394
399
|
if (loginType === "WEBRTC") {
|
|
395
400
|
this.getWebrtcInfo(server, options);
|
|
@@ -494,7 +499,6 @@ export default class ueSoftphone {
|
|
|
494
499
|
callbacks.error = typeof callbacks.error == "function" ? callbacks.error : ueSoftphone.noop;
|
|
495
500
|
callbacks.message =
|
|
496
501
|
typeof callbacks.message == "function" ? callbacks.message : ueSoftphone.noop;
|
|
497
|
-
callbacks.event = typeof callbacks.event == "function" ? callbacks.event : ueSoftphone.noop;
|
|
498
502
|
callbacks.server =
|
|
499
503
|
callbacks.serve === null || callbacks.serve === undefined
|
|
500
504
|
? "ws://152.136.72.209:3201/phoneBarGateway"
|
|
@@ -544,13 +548,11 @@ export default class ueSoftphone {
|
|
|
544
548
|
if (event.subType === "KICK_OFF") {
|
|
545
549
|
this.Socketinstance.disconnect();
|
|
546
550
|
try {
|
|
547
|
-
|
|
551
|
+
WebPhoneSdk.disconnect();
|
|
548
552
|
} catch (error) {}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
callbacks.event({
|
|
553
|
-
message: "坐席账户在其他地方登录"
|
|
553
|
+
callbacks.error({
|
|
554
|
+
type: "accountError",
|
|
555
|
+
error: "您的账号在其他网页登录"
|
|
554
556
|
});
|
|
555
557
|
}
|
|
556
558
|
});
|
|
@@ -598,7 +600,13 @@ export default class ueSoftphone {
|
|
|
598
600
|
// }
|
|
599
601
|
// };
|
|
600
602
|
// 电话条事件回调
|
|
601
|
-
private initAttachEvent = (
|
|
603
|
+
private initAttachEvent = (
|
|
604
|
+
server: any,
|
|
605
|
+
loginType: string,
|
|
606
|
+
options: any,
|
|
607
|
+
userOptions: any,
|
|
608
|
+
success
|
|
609
|
+
) => {
|
|
602
610
|
if (this.attachEventCallbacks) {
|
|
603
611
|
// 每次创建链接的时候,要获取最新的ws token
|
|
604
612
|
ueSoftphone.request(server + "/platform/action/refreshWsToken", {
|
|
@@ -633,6 +641,7 @@ export default class ueSoftphone {
|
|
|
633
641
|
transports: ["websocket"],
|
|
634
642
|
timeout: 5000
|
|
635
643
|
};
|
|
644
|
+
this.attachEventCallbacks.success = success;
|
|
636
645
|
ueSoftphone.createEventHandle(this.attachEventCallbacks);
|
|
637
646
|
}
|
|
638
647
|
},
|
|
@@ -737,18 +746,15 @@ export default class ueSoftphone {
|
|
|
737
746
|
}
|
|
738
747
|
|
|
739
748
|
// webrtc事件回调
|
|
740
|
-
private static initWebrtcEvent =
|
|
741
|
-
ueSoftphone.webPhone = new
|
|
749
|
+
private static initWebrtcEvent = (extras: any) => {
|
|
750
|
+
ueSoftphone.webPhone = new WebPhoneSdk({
|
|
742
751
|
server: extras.wssUrl,
|
|
743
752
|
sip: extras.sip,
|
|
744
753
|
secret: extras.password
|
|
745
754
|
});
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
// Register to receive inbound calls
|
|
751
|
-
this.webPhone.register();
|
|
755
|
+
ueSoftphone.webPhone.message = (res: any) => {
|
|
756
|
+
console.log(res);
|
|
757
|
+
};
|
|
752
758
|
};
|
|
753
759
|
// 若是webrtc的模式,会检测权限,弹窗让客户授权
|
|
754
760
|
private openMediaAudio = (failMsg: string, hasAlert: boolean) => {
|
|
@@ -1112,7 +1118,7 @@ export default class ueSoftphone {
|
|
|
1112
1118
|
});
|
|
1113
1119
|
return;
|
|
1114
1120
|
}
|
|
1115
|
-
if (params.
|
|
1121
|
+
if (params.mode === null || params.mode === undefined) {
|
|
1116
1122
|
params.fail({
|
|
1117
1123
|
success: false,
|
|
1118
1124
|
message: "Parameter mode is required!"
|
|
@@ -1241,6 +1247,13 @@ export default class ueSoftphone {
|
|
|
1241
1247
|
});
|
|
1242
1248
|
return;
|
|
1243
1249
|
}
|
|
1250
|
+
if (params.agentNumber === null || params.agentNumber === undefined) {
|
|
1251
|
+
params.fail({
|
|
1252
|
+
success: false,
|
|
1253
|
+
message: "Parameter agentNumber is required!"
|
|
1254
|
+
});
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1244
1257
|
|
|
1245
1258
|
const server = ueSoftphone.initOptions.server || ueSoftphone.callApiUrl;
|
|
1246
1259
|
|
|
@@ -1339,6 +1352,13 @@ export default class ueSoftphone {
|
|
|
1339
1352
|
});
|
|
1340
1353
|
return;
|
|
1341
1354
|
}
|
|
1355
|
+
if (params.agentNumber === null || params.agentNumber === undefined) {
|
|
1356
|
+
params.fail({
|
|
1357
|
+
success: false,
|
|
1358
|
+
message: "Parameter agentNumber is required!"
|
|
1359
|
+
});
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1342
1362
|
|
|
1343
1363
|
const server = ueSoftphone.initOptions.server || ueSoftphone.callApiUrl;
|
|
1344
1364
|
|
|
@@ -1388,6 +1408,13 @@ export default class ueSoftphone {
|
|
|
1388
1408
|
});
|
|
1389
1409
|
return;
|
|
1390
1410
|
}
|
|
1411
|
+
if (params.agentNumber === null || params.agentNumber === undefined) {
|
|
1412
|
+
params.fail({
|
|
1413
|
+
success: false,
|
|
1414
|
+
message: "Parameter agentNumber is required!"
|
|
1415
|
+
});
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1391
1418
|
|
|
1392
1419
|
const server = ueSoftphone.initOptions.server || ueSoftphone.callApiUrl;
|
|
1393
1420
|
|
|
@@ -1437,6 +1464,13 @@ export default class ueSoftphone {
|
|
|
1437
1464
|
});
|
|
1438
1465
|
return;
|
|
1439
1466
|
}
|
|
1467
|
+
if (params.agentNumber === null || params.agentNumber === undefined) {
|
|
1468
|
+
params.fail({
|
|
1469
|
+
success: false,
|
|
1470
|
+
message: "Parameter agentNumber is required!"
|
|
1471
|
+
});
|
|
1472
|
+
return;
|
|
1473
|
+
}
|
|
1440
1474
|
|
|
1441
1475
|
const server = ueSoftphone.initOptions.server || ueSoftphone.callApiUrl;
|
|
1442
1476
|
|
|
@@ -1797,7 +1831,7 @@ export default class ueSoftphone {
|
|
|
1797
1831
|
if (params) {
|
|
1798
1832
|
ueSoftphone.Socketinstance.disconnect();
|
|
1799
1833
|
if (ueSoftphone.agentInfo.loginType === "WEBRTC") {
|
|
1800
|
-
|
|
1834
|
+
WebPhoneSdk.disconnect();
|
|
1801
1835
|
}
|
|
1802
1836
|
(params.success as Function)({
|
|
1803
1837
|
success: true
|
|
@@ -1993,7 +2027,7 @@ export default class ueSoftphone {
|
|
|
1993
2027
|
return {
|
|
1994
2028
|
// 接听
|
|
1995
2029
|
accept() {
|
|
1996
|
-
|
|
2030
|
+
WebPhoneSdk.accept();
|
|
1997
2031
|
},
|
|
1998
2032
|
// 注册设备,链接webrtc
|
|
1999
2033
|
connect() {
|
|
@@ -2004,16 +2038,16 @@ export default class ueSoftphone {
|
|
|
2004
2038
|
// 注销设备,跟webrtc断开链接
|
|
2005
2039
|
disconnect() {
|
|
2006
2040
|
if (ueSoftphone.webPhone && this.isConnected()) {
|
|
2007
|
-
|
|
2041
|
+
WebPhoneSdk.disconnect();
|
|
2008
2042
|
}
|
|
2009
2043
|
},
|
|
2010
2044
|
// 检测设备是否有链接上
|
|
2011
2045
|
isConnected() {
|
|
2012
|
-
return
|
|
2046
|
+
return WebPhoneSdk.isConnected();
|
|
2013
2047
|
},
|
|
2014
2048
|
// 发送DTMF 可与demo中的软电话拨号盘结合使用
|
|
2015
2049
|
sendDTMF(tone: string) {
|
|
2016
|
-
|
|
2050
|
+
WebPhoneSdk.sendDTMF(tone);
|
|
2017
2051
|
}
|
|
2018
2052
|
};
|
|
2019
2053
|
};
|
|
@@ -2022,9 +2056,6 @@ export default class ueSoftphone {
|
|
|
2022
2056
|
class ueWebsocket {
|
|
2023
2057
|
private ws: any;
|
|
2024
2058
|
constructor(server: string, proto: any) {
|
|
2025
|
-
delete proto.path;
|
|
2026
|
-
delete proto.hostname;
|
|
2027
|
-
delete proto.port;
|
|
2028
2059
|
//@ts-ignore
|
|
2029
2060
|
this.ws = io.connect(`wss://${server}`, proto);
|
|
2030
2061
|
}
|