ue-softphone-sdk 2.2.4 → 2.2.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/{index.d.ts → types/index.d.ts} +3 -7
- package/dist/ue-softphone-sdk.js +7 -2
- package/package.json +5 -6
- package/{new-rollup.config.mjs → rollup-new.config.mjs} +1 -1
- package/rollup.config.js +14 -15
- package/src/index.ts +28 -53
- package/tsconfig.json +10 -26
- package/dist/api/bye.d.ts +0 -16
- package/dist/api/dtmf.d.ts +0 -15
- package/dist/api/emitter.d.ts +0 -88
- package/dist/api/exceptions/content-type-unsupported.d.ts +0 -8
- package/dist/api/exceptions/index.d.ts +0 -5
- package/dist/api/exceptions/request-pending.d.ts +0 -9
- package/dist/api/exceptions/session-description-handler.d.ts +0 -8
- package/dist/api/exceptions/session-terminated.d.ts +0 -8
- package/dist/api/exceptions/state-transition.d.ts +0 -8
- package/dist/api/index.d.ts +0 -58
- package/dist/api/info.d.ts +0 -16
- package/dist/api/invitation-accept-options.d.ts +0 -19
- package/dist/api/invitation-progress-options.d.ts +0 -38
- package/dist/api/invitation-reject-options.d.ts +0 -25
- package/dist/api/invitation.d.ts +0 -179
- package/dist/api/inviter-cancel-options.d.ts +0 -9
- package/dist/api/inviter-invite-options.d.ts +0 -28
- package/dist/api/inviter-options.d.ts +0 -43
- package/dist/api/inviter.d.ts +0 -236
- package/dist/api/message.d.ts +0 -16
- package/dist/api/messager-message-options.d.ts +0 -11
- package/dist/api/messager-options.d.ts +0 -17
- package/dist/api/messager.d.ts +0 -26
- package/dist/api/notification.d.ts +0 -16
- package/dist/api/notifier.d.ts +0 -8
- package/dist/api/publisher-options.d.ts +0 -33
- package/dist/api/publisher-publish-options.d.ts +0 -6
- package/dist/api/publisher-state.d.ts +0 -21
- package/dist/api/publisher-unpublish-options.d.ts +0 -6
- package/dist/api/publisher.d.ts +0 -65
- package/dist/api/referral.d.ts +0 -38
- package/dist/api/registerer-options.d.ts +0 -46
- package/dist/api/registerer-register-options.d.ts +0 -11
- package/dist/api/registerer-state.d.ts +0 -21
- package/dist/api/registerer-unregister-options.d.ts +0 -16
- package/dist/api/registerer.d.ts +0 -144
- package/dist/api/session-bye-options.d.ts +0 -11
- package/dist/api/session-delegate.d.ts +0 -73
- package/dist/api/session-description-handler-factory.d.ts +0 -15
- package/dist/api/session-description-handler.d.ts +0 -74
- package/dist/api/session-info-options.d.ts +0 -11
- package/dist/api/session-invite-options.d.ts +0 -28
- package/dist/api/session-message-options.d.ts +0 -11
- package/dist/api/session-options.d.ts +0 -8
- package/dist/api/session-refer-options.d.ts +0 -14
- package/dist/api/session-state.d.ts +0 -45
- package/dist/api/session.d.ts +0 -359
- package/dist/api/subscriber-options.d.ts +0 -11
- package/dist/api/subscriber-subscribe-options.d.ts +0 -6
- package/dist/api/subscriber.d.ts +0 -94
- package/dist/api/subscription-delegate.d.ts +0 -12
- package/dist/api/subscription-options.d.ts +0 -8
- package/dist/api/subscription-state.d.ts +0 -19
- package/dist/api/subscription-subscribe-options.d.ts +0 -6
- package/dist/api/subscription-unsubscribe-options.d.ts +0 -6
- package/dist/api/subscription.d.ts +0 -84
- package/dist/api/transport-state.d.ts +0 -37
- package/dist/api/transport.d.ts +0 -159
- package/dist/api/user-agent-delegate.d.ts +0 -84
- package/dist/api/user-agent-options.d.ts +0 -253
- package/dist/api/user-agent-state.d.ts +0 -14
- package/dist/api/user-agent.d.ts +0 -200
- package/dist/core/dialogs/dialog-state.d.ts +0 -34
- package/dist/core/dialogs/dialog.d.ts +0 -161
- package/dist/core/dialogs/index.d.ts +0 -4
- package/dist/core/dialogs/session-dialog.d.ts +0 -196
- package/dist/core/dialogs/subscription-dialog.d.ts +0 -120
- package/dist/core/exceptions/exception.d.ts +0 -8
- package/dist/core/exceptions/index.d.ts +0 -3
- package/dist/core/exceptions/transaction-state-error.d.ts +0 -8
- package/dist/core/exceptions/transport-error.d.ts +0 -8
- package/dist/core/index.d.ts +0 -15
- package/dist/core/log/index.d.ts +0 -3
- package/dist/core/log/levels.d.ts +0 -10
- package/dist/core/log/logger-factory.d.ts +0 -21
- package/dist/core/log/logger.d.ts +0 -19
- package/dist/core/messages/body.d.ts +0 -64
- package/dist/core/messages/digest-authentication.d.ts +0 -51
- package/dist/core/messages/incoming-message.d.ts +0 -79
- package/dist/core/messages/incoming-request-message.d.ts +0 -10
- package/dist/core/messages/incoming-request.d.ts +0 -67
- package/dist/core/messages/incoming-response-message.d.ts +0 -10
- package/dist/core/messages/incoming-response.d.ts +0 -12
- package/dist/core/messages/index.d.ts +0 -13
- package/dist/core/messages/md5.d.ts +0 -32
- package/dist/core/messages/methods/ack.d.ts +0 -18
- package/dist/core/messages/methods/bye.d.ts +0 -21
- package/dist/core/messages/methods/cancel.d.ts +0 -21
- package/dist/core/messages/methods/constants.d.ts +0 -20
- package/dist/core/messages/methods/index.d.ts +0 -13
- package/dist/core/messages/methods/info.d.ts +0 -21
- package/dist/core/messages/methods/invite.d.ts +0 -86
- package/dist/core/messages/methods/message.d.ts +0 -21
- package/dist/core/messages/methods/notify.d.ts +0 -21
- package/dist/core/messages/methods/prack.d.ts +0 -21
- package/dist/core/messages/methods/publish.d.ts +0 -21
- package/dist/core/messages/methods/refer.d.ts +0 -21
- package/dist/core/messages/methods/register.d.ts +0 -21
- package/dist/core/messages/methods/subscribe.d.ts +0 -54
- package/dist/core/messages/outgoing-request-message.d.ts +0 -94
- package/dist/core/messages/outgoing-request.d.ts +0 -67
- package/dist/core/messages/outgoing-response.d.ts +0 -42
- package/dist/core/messages/parser.d.ts +0 -14
- package/dist/core/messages/utils.d.ts +0 -24
- package/dist/core/session/index.d.ts +0 -2
- package/dist/core/session/session-delegate.d.ts +0 -70
- package/dist/core/session/session.d.ts +0 -134
- package/dist/core/subscription/index.d.ts +0 -2
- package/dist/core/subscription/subscription-delegate.d.ts +0 -27
- package/dist/core/subscription/subscription.d.ts +0 -55
- package/dist/core/timers.d.ts +0 -20
- package/dist/core/transactions/client-transaction.d.ts +0 -45
- package/dist/core/transactions/index.d.ts +0 -10
- package/dist/core/transactions/invite-client-transaction.d.ts +0 -116
- package/dist/core/transactions/invite-server-transaction.d.ts +0 -127
- package/dist/core/transactions/non-invite-client-transaction.d.ts +0 -69
- package/dist/core/transactions/non-invite-server-transaction.d.ts +0 -57
- package/dist/core/transactions/server-transaction.d.ts +0 -35
- package/dist/core/transactions/transaction-state.d.ts +0 -13
- package/dist/core/transactions/transaction-user.d.ts +0 -72
- package/dist/core/transactions/transaction.d.ts +0 -79
- package/dist/core/transport.d.ts +0 -31
- package/dist/core/user-agent-core/allowed-methods.d.ts +0 -4
- package/dist/core/user-agent-core/index.d.ts +0 -3
- package/dist/core/user-agent-core/user-agent-core-configuration.d.ts +0 -99
- package/dist/core/user-agent-core/user-agent-core-delegate.d.ts +0 -37
- package/dist/core/user-agent-core/user-agent-core.d.ts +0 -179
- package/dist/core/user-agents/bye-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/bye-user-agent-server.d.ts +0 -10
- package/dist/core/user-agents/cancel-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/index.d.ts +0 -26
- package/dist/core/user-agents/info-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/info-user-agent-server.d.ts +0 -10
- package/dist/core/user-agents/invite-user-agent-client.d.ts +0 -35
- package/dist/core/user-agents/invite-user-agent-server.d.ts +0 -77
- package/dist/core/user-agents/message-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/message-user-agent-server.d.ts +0 -10
- package/dist/core/user-agents/notify-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/notify-user-agent-server.d.ts +0 -16
- package/dist/core/user-agents/prack-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/prack-user-agent-server.d.ts +0 -16
- package/dist/core/user-agents/publish-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/re-invite-user-agent-client.d.ts +0 -18
- package/dist/core/user-agents/re-invite-user-agent-server.d.ts +0 -41
- package/dist/core/user-agents/re-subscribe-user-agent-client.d.ts +0 -17
- package/dist/core/user-agents/re-subscribe-user-agent-server.d.ts +0 -10
- package/dist/core/user-agents/refer-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/refer-user-agent-server.d.ts +0 -16
- package/dist/core/user-agents/register-user-agent-client.d.ts +0 -10
- package/dist/core/user-agents/register-user-agent-server.d.ts +0 -11
- package/dist/core/user-agents/subscribe-user-agent-client.d.ts +0 -65
- package/dist/core/user-agents/subscribe-user-agent-server.d.ts +0 -11
- package/dist/core/user-agents/user-agent-client.d.ts +0 -103
- package/dist/core/user-agents/user-agent-server.d.ts +0 -79
- package/dist/grammar/grammar.d.ts +0 -26
- package/dist/grammar/index.d.ts +0 -4
- package/dist/grammar/name-addr-header.d.ts +0 -24
- package/dist/grammar/parameters.d.ts +0 -16
- package/dist/grammar/pegjs/dist/grammar.d.ts +0 -50
- package/dist/grammar/uri.d.ts +0 -62
- package/dist/main.d.ts +0 -9
- package/dist/new-index.d.ts +0 -199
- package/dist/platform/web/index.d.ts +0 -4
- package/dist/platform/web/modifiers/index.d.ts +0 -5
- package/dist/platform/web/modifiers/modifiers.d.ts +0 -41
- package/dist/platform/web/session-description-handler/index.d.ts +0 -14
- package/dist/platform/web/session-description-handler/media-stream-factory-default.d.ts +0 -6
- package/dist/platform/web/session-description-handler/media-stream-factory.d.ts +0 -6
- package/dist/platform/web/session-description-handler/peer-connection-configuration-default.d.ts +0 -5
- package/dist/platform/web/session-description-handler/peer-connection-delegate.d.ts +0 -63
- package/dist/platform/web/session-description-handler/session-description-handler-configuration.d.ts +0 -16
- package/dist/platform/web/session-description-handler/session-description-handler-factory-default.d.ts +0 -11
- package/dist/platform/web/session-description-handler/session-description-handler-factory-options.d.ts +0 -9
- package/dist/platform/web/session-description-handler/session-description-handler-factory.d.ts +0 -16
- package/dist/platform/web/session-description-handler/session-description-handler-options.d.ts +0 -47
- package/dist/platform/web/session-description-handler/session-description-handler.d.ts +0 -212
- package/dist/platform/web/simple-user/index.d.ts +0 -7
- package/dist/platform/web/simple-user/simple-user-delegate.d.ts +0 -72
- package/dist/platform/web/simple-user/simple-user-options.d.ts +0 -90
- package/dist/platform/web/simple-user/simple-user.d.ts +0 -226
- package/dist/platform/web/transport/index.d.ts +0 -6
- package/dist/platform/web/transport/transport-options.d.ts +0 -30
- package/dist/platform/web/transport/transport.d.ts +0 -125
- package/dist/ue-softphone-sdk.js.map +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/webPhoneSdk.d.ts +0 -24
- package/dist/webrtc.d.ts +0 -17
- package/src/api/api-extractor.json +0 -358
- package/src/api/bye.ts +0 -27
- package/src/api/dtmf.ts +0 -27
- package/src/api/emitter.ts +0 -110
- package/src/api/exceptions/content-type-unsupported.ts +0 -11
- package/src/api/exceptions/index.ts +0 -5
- package/src/api/exceptions/request-pending.ts +0 -12
- package/src/api/exceptions/session-description-handler.ts +0 -11
- package/src/api/exceptions/session-terminated.ts +0 -11
- package/src/api/exceptions/state-transition.ts +0 -11
- package/src/api/index.ts +0 -58
- package/src/api/info.ts +0 -27
- package/src/api/invitation-accept-options.ts +0 -20
- package/src/api/invitation-progress-options.ts +0 -36
- package/src/api/invitation-reject-options.ts +0 -22
- package/src/api/invitation.ts +0 -816
- package/src/api/inviter-cancel-options.ts +0 -9
- package/src/api/inviter-invite-options.ts +0 -29
- package/src/api/inviter-options.ts +0 -44
- package/src/api/inviter.ts +0 -1126
- package/src/api/message.ts +0 -27
- package/src/api/messager-message-options.ts +0 -12
- package/src/api/messager-options.ts +0 -18
- package/src/api/messager.ts +0 -89
- package/src/api/notification.ts +0 -27
- package/src/api/notifier.ts +0 -7
- package/src/api/publisher-options.ts +0 -34
- package/src/api/publisher-publish-options.ts +0 -6
- package/src/api/publisher-state.ts +0 -21
- package/src/api/publisher-unpublish-options.ts +0 -6
- package/src/api/publisher.ts +0 -418
- package/src/api/referral.ts +0 -89
- package/src/api/registerer-options.ts +0 -55
- package/src/api/registerer-register-options.ts +0 -12
- package/src/api/registerer-state.ts +0 -21
- package/src/api/registerer-unregister-options.ts +0 -17
- package/src/api/registerer.ts +0 -814
- package/src/api/session-bye-options.ts +0 -12
- package/src/api/session-delegate.ts +0 -80
- package/src/api/session-description-handler-factory.ts +0 -16
- package/src/api/session-description-handler.ts +0 -89
- package/src/api/session-info-options.ts +0 -12
- package/src/api/session-invite-options.ts +0 -29
- package/src/api/session-message-options.ts +0 -12
- package/src/api/session-options.ts +0 -8
- package/src/api/session-refer-options.ts +0 -15
- package/src/api/session-state.ts +0 -45
- package/src/api/session.ts +0 -1448
- package/src/api/subscriber-options.ts +0 -12
- package/src/api/subscriber-subscribe-options.ts +0 -6
- package/src/api/subscriber.ts +0 -536
- package/src/api/subscription-delegate.ts +0 -13
- package/src/api/subscription-options.ts +0 -8
- package/src/api/subscription-state.ts +0 -19
- package/src/api/subscription-subscribe-options.ts +0 -6
- package/src/api/subscription-unsubscribe-options.ts +0 -6
- package/src/api/subscription.ts +0 -161
- package/src/api/transport-state.ts +0 -37
- package/src/api/transport.ts +0 -169
- package/src/api/user-agent-delegate.ts +0 -95
- package/src/api/user-agent-options.ts +0 -322
- package/src/api/user-agent-state.ts +0 -14
- package/src/api/user-agent.ts +0 -1014
- package/src/core/api-extractor.json +0 -358
- package/src/core/dialogs/dialog-state.ts +0 -35
- package/src/core/dialogs/dialog.ts +0 -605
- package/src/core/dialogs/index.ts +0 -4
- package/src/core/dialogs/session-dialog.ts +0 -996
- package/src/core/dialogs/subscription-dialog.ts +0 -557
- package/src/core/exceptions/exception.ts +0 -11
- package/src/core/exceptions/index.ts +0 -3
- package/src/core/exceptions/transaction-state-error.ts +0 -11
- package/src/core/exceptions/transport-error.ts +0 -11
- package/src/core/index.ts +0 -19
- package/src/core/log/index.ts +0 -3
- package/src/core/log/levels.ts +0 -10
- package/src/core/log/logger-factory.ts +0 -119
- package/src/core/log/logger.ts +0 -42
- package/src/core/messages/body.ts +0 -171
- package/src/core/messages/digest-authentication.ts +0 -190
- package/src/core/messages/incoming-message.ts +0 -152
- package/src/core/messages/incoming-request-message.ts +0 -14
- package/src/core/messages/incoming-request.ts +0 -75
- package/src/core/messages/incoming-response-message.ts +0 -14
- package/src/core/messages/incoming-response.ts +0 -13
- package/src/core/messages/index.ts +0 -18
- package/src/core/messages/md5.ts +0 -437
- package/src/core/messages/methods/ack.ts +0 -22
- package/src/core/messages/methods/bye.ts +0 -22
- package/src/core/messages/methods/cancel.ts +0 -22
- package/src/core/messages/methods/constants.ts +0 -21
- package/src/core/messages/methods/index.ts +0 -13
- package/src/core/messages/methods/info.ts +0 -22
- package/src/core/messages/methods/invite.ts +0 -104
- package/src/core/messages/methods/message.ts +0 -22
- package/src/core/messages/methods/notify.ts +0 -22
- package/src/core/messages/methods/prack.ts +0 -22
- package/src/core/messages/methods/publish.ts +0 -22
- package/src/core/messages/methods/refer.ts +0 -22
- package/src/core/messages/methods/register.ts +0 -22
- package/src/core/messages/methods/subscribe.ts +0 -59
- package/src/core/messages/outgoing-request-message.ts +0 -299
- package/src/core/messages/outgoing-request.ts +0 -77
- package/src/core/messages/outgoing-response.ts +0 -174
- package/src/core/messages/parser.ts +0 -265
- package/src/core/messages/utils.ts +0 -144
- package/src/core/session/index.ts +0 -2
- package/src/core/session/session-delegate.ts +0 -88
- package/src/core/session/session.ts +0 -158
- package/src/core/subscription/index.ts +0 -2
- package/src/core/subscription/subscription-delegate.ts +0 -30
- package/src/core/subscription/subscription.ts +0 -61
- package/src/core/timers.ts +0 -24
- package/src/core/transactions/client-transaction.ts +0 -78
- package/src/core/transactions/index.ts +0 -10
- package/src/core/transactions/invite-client-transaction.ts +0 -504
- package/src/core/transactions/invite-server-transaction.ts +0 -432
- package/src/core/transactions/non-invite-client-transaction.ts +0 -257
- package/src/core/transactions/non-invite-server-transaction.ts +0 -241
- package/src/core/transactions/server-transaction.ts +0 -47
- package/src/core/transactions/transaction-state.ts +0 -13
- package/src/core/transactions/transaction-user.ts +0 -82
- package/src/core/transactions/transaction.ts +0 -149
- package/src/core/transport.ts +0 -32
- package/src/core/user-agent-core/allowed-methods.ts +0 -19
- package/src/core/user-agent-core/index.ts +0 -3
- package/src/core/user-agent-core/user-agent-core-configuration.ts +0 -111
- package/src/core/user-agent-core/user-agent-core-delegate.ts +0 -50
- package/src/core/user-agent-core/user-agent-core.ts +0 -905
- package/src/core/user-agents/bye-user-agent-client.ts +0 -16
- package/src/core/user-agents/bye-user-agent-server.ts +0 -14
- package/src/core/user-agents/cancel-user-agent-client.ts +0 -14
- package/src/core/user-agents/index.ts +0 -26
- package/src/core/user-agents/info-user-agent-client.ts +0 -15
- package/src/core/user-agents/info-user-agent-server.ts +0 -14
- package/src/core/user-agents/invite-user-agent-client.ts +0 -405
- package/src/core/user-agents/invite-user-agent-server.ts +0 -269
- package/src/core/user-agents/message-user-agent-client.ts +0 -14
- package/src/core/user-agents/message-user-agent-server.ts +0 -14
- package/src/core/user-agents/notify-user-agent-client.ts +0 -15
- package/src/core/user-agents/notify-user-agent-server.ts +0 -30
- package/src/core/user-agents/prack-user-agent-client.ts +0 -16
- package/src/core/user-agents/prack-user-agent-server.ts +0 -37
- package/src/core/user-agents/publish-user-agent-client.ts +0 -14
- package/src/core/user-agents/re-invite-user-agent-client.ts +0 -127
- package/src/core/user-agents/re-invite-user-agent-server.ts +0 -109
- package/src/core/user-agents/re-subscribe-user-agent-client.ts +0 -78
- package/src/core/user-agents/re-subscribe-user-agent-server.ts +0 -14
- package/src/core/user-agents/refer-user-agent-client.ts +0 -15
- package/src/core/user-agents/refer-user-agent-server.ts +0 -30
- package/src/core/user-agents/register-user-agent-client.ts +0 -14
- package/src/core/user-agents/register-user-agent-server.ts +0 -14
- package/src/core/user-agents/subscribe-user-agent-client.ts +0 -341
- package/src/core/user-agents/subscribe-user-agent-server.ts +0 -14
- package/src/core/user-agents/user-agent-client.ts +0 -378
- package/src/core/user-agents/user-agent-server.ts +0 -276
- package/src/grammar/grammar.ts +0 -55
- package/src/grammar/index.ts +0 -4
- package/src/grammar/name-addr-header.ts +0 -58
- package/src/grammar/parameters.ts +0 -45
- package/src/grammar/pegjs/README.md +0 -9
- package/src/grammar/pegjs/dist/grammar.ts +0 -1557
- package/src/grammar/pegjs/src/grammar.pegjs +0 -1009
- package/src/grammar/uri.ts +0 -370
- package/src/main.ts +0 -26
- package/src/new-index.ts +0 -2478
- package/src/platform/react/README.md +0 -1
- package/src/platform/web/index.ts +0 -4
- package/src/platform/web/modifiers/index.ts +0 -5
- package/src/platform/web/modifiers/modifiers.ts +0 -180
- package/src/platform/web/session-description-handler/api-extractor.json +0 -358
- package/src/platform/web/session-description-handler/index.ts +0 -14
- package/src/platform/web/session-description-handler/media-stream-factory-default.ts +0 -22
- package/src/platform/web/session-description-handler/media-stream-factory.ts +0 -10
- package/src/platform/web/session-description-handler/peer-connection-configuration-default.ts +0 -17
- package/src/platform/web/session-description-handler/peer-connection-delegate.ts +0 -72
- package/src/platform/web/session-description-handler/session-description-handler-configuration.ts +0 -17
- package/src/platform/web/session-description-handler/session-description-handler-factory-default.ts +0 -45
- package/src/platform/web/session-description-handler/session-description-handler-factory-options.ts +0 -10
- package/src/platform/web/session-description-handler/session-description-handler-factory.ts +0 -17
- package/src/platform/web/session-description-handler/session-description-handler-options.ts +0 -56
- package/src/platform/web/session-description-handler/session-description-handler.ts +0 -938
- package/src/platform/web/simple-user/api-extractor.json +0 -358
- package/src/platform/web/simple-user/index.ts +0 -7
- package/src/platform/web/simple-user/simple-user-delegate.ts +0 -82
- package/src/platform/web/simple-user/simple-user-options.ts +0 -102
- package/src/platform/web/simple-user/simple-user.ts +0 -1099
- package/src/platform/web/transport/api-extractor.json +0 -358
- package/src/platform/web/transport/index.ts +0 -6
- package/src/platform/web/transport/transport-options.ts +0 -34
- package/src/platform/web/transport/transport.ts +0 -742
- package/src/version.ts +0 -8
- package/src/webPhoneSdk.ts +0 -67
- package/src/webrtc.ts +0 -318
- /package/dist/{config.d.ts → types/config.d.ts} +0 -0
package/src/version.ts
DELETED
package/src/webPhoneSdk.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: LiuJing
|
|
3
|
-
* @Date: 2022-03-10 09:45:34
|
|
4
|
-
* @LastEditors: cuixuecheng
|
|
5
|
-
* @LastEditTime: 2023-04-19 14:47:05
|
|
6
|
-
*/
|
|
7
|
-
import UEInitWebRtc from './webrtc'
|
|
8
|
-
interface Options {
|
|
9
|
-
server: string,
|
|
10
|
-
sip: string,
|
|
11
|
-
secret: string,
|
|
12
|
-
onmessage?(event: string): void
|
|
13
|
-
error?(error: string): void
|
|
14
|
-
}
|
|
15
|
-
interface CallConfig {
|
|
16
|
-
autoAnswer: boolean
|
|
17
|
-
}
|
|
18
|
-
export default class WebPhoneSdk {
|
|
19
|
-
private options: Options | undefined
|
|
20
|
-
private static WebrtcObj: any
|
|
21
|
-
public static CallConfig: CallConfig = {
|
|
22
|
-
autoAnswer: false
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public static message: ((arg0: any) => void | undefined) | undefined
|
|
26
|
-
|
|
27
|
-
constructor (options: Options) {
|
|
28
|
-
this.options = options
|
|
29
|
-
WebPhoneSdk.WebrtcObj = new UEInitWebRtc(options)
|
|
30
|
-
WebPhoneSdk.WebrtcObj.message = (message: any) => {
|
|
31
|
-
if (WebPhoneSdk.message) {
|
|
32
|
-
WebPhoneSdk.message(message)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public static accept () {
|
|
38
|
-
if (WebPhoneSdk.WebrtcObj) {
|
|
39
|
-
WebPhoneSdk.WebrtcObj.accept()
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public static sendDTMF (tone: string) {
|
|
44
|
-
if (WebPhoneSdk.WebrtcObj) {
|
|
45
|
-
WebPhoneSdk.WebrtcObj.sendDTMF(tone)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public static unregister () {
|
|
50
|
-
if (WebPhoneSdk.WebrtcObj) {
|
|
51
|
-
WebPhoneSdk.WebrtcObj.ueUnregisterWebrtc()
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public static disconnect(): Promise<void> {
|
|
56
|
-
return WebPhoneSdk.WebrtcObj.disconnect()
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
public static connect () {
|
|
61
|
-
return WebPhoneSdk.WebrtcObj.connect()
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public static isConnected(): boolean {
|
|
65
|
-
return WebPhoneSdk.WebrtcObj.isConnected();
|
|
66
|
-
}
|
|
67
|
-
}
|
package/src/webrtc.ts
DELETED
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Invitation,
|
|
3
|
-
Inviter,
|
|
4
|
-
Referral,
|
|
5
|
-
Registerer,
|
|
6
|
-
RegistererOptions,
|
|
7
|
-
Session,
|
|
8
|
-
SessionState,
|
|
9
|
-
UserAgent,
|
|
10
|
-
UserAgentOptions,
|
|
11
|
-
UserAgentDelegate,
|
|
12
|
-
Core,
|
|
13
|
-
Web,
|
|
14
|
-
RegistererRegisterOptions,
|
|
15
|
-
InvitationAcceptOptions,
|
|
16
|
-
UserAgentState
|
|
17
|
-
} from './main'
|
|
18
|
-
|
|
19
|
-
interface Options {
|
|
20
|
-
server: string,
|
|
21
|
-
sip: string,
|
|
22
|
-
secret: string,
|
|
23
|
-
onmessage?(event: string): void
|
|
24
|
-
error?(error: string): void
|
|
25
|
-
}
|
|
26
|
-
// let registerer: any = {}
|
|
27
|
-
// let currentConfig: any = {}
|
|
28
|
-
// let Ginvitation: Invitation
|
|
29
|
-
export default class UEWebrtc {
|
|
30
|
-
private config: Options | undefined
|
|
31
|
-
private registerer: any
|
|
32
|
-
private userAgent: UserAgent | undefined
|
|
33
|
-
public message: ((arg0: any) => void | undefined) | undefined
|
|
34
|
-
private Ginvitation: Invitation | undefined
|
|
35
|
-
constructor (options: any) {
|
|
36
|
-
this.init(options)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
private init (config: Options) {
|
|
40
|
-
// 获取HTMLElement
|
|
41
|
-
this.config = config
|
|
42
|
-
const audioElement = getAudio('ueremoteAudio')
|
|
43
|
-
// HTMLElement to 获取HTMLElement
|
|
44
|
-
function getAudio (id: string): HTMLAudioElement {
|
|
45
|
-
const el = document.getElementById(id)
|
|
46
|
-
if (!(el instanceof HTMLAudioElement)) { // 没有音频dom,重新创建一个
|
|
47
|
-
// throw new Error(`Element '${id}' not found or not an audio element.`)
|
|
48
|
-
const audio = new Audio()
|
|
49
|
-
audio.controls = true
|
|
50
|
-
audio.autoplay = true
|
|
51
|
-
audio.id = 'ueremoteAudio'
|
|
52
|
-
audio.style.display = 'none'
|
|
53
|
-
document.body.appendChild(audio)
|
|
54
|
-
return document.getElementById(id) as HTMLAudioElement
|
|
55
|
-
} else {
|
|
56
|
-
return el
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// Assign a MediaStream to an HTMLMediaElement and update if tracks change.
|
|
60
|
-
// 媒体流绑定标签
|
|
61
|
-
function assignStream (stream: MediaStream, element: HTMLMediaElement): void {
|
|
62
|
-
// Set element source.
|
|
63
|
-
element.autoplay = true; // Safari does not allow calling .play() from a non user action
|
|
64
|
-
element.srcObject = stream;
|
|
65
|
-
|
|
66
|
-
// Load and start playback of media.
|
|
67
|
-
element.play().catch((error: Error) => {
|
|
68
|
-
console.error('Failed to play media');
|
|
69
|
-
console.error(error);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
// If a track is added, load and restart playback of media.
|
|
73
|
-
stream.onaddtrack = (): void => {
|
|
74
|
-
element.load(); // Safari does not work otheriwse
|
|
75
|
-
element.play().catch((error: Error) => {
|
|
76
|
-
console.error('Failed to play remote media on add track');
|
|
77
|
-
console.error(error);
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// If a track is removed, load and restart playback of media.
|
|
82
|
-
stream.onremovetrack = (): void => {
|
|
83
|
-
element.load(); // Safari does not work otheriwse
|
|
84
|
-
element.play().catch((error: Error) => {
|
|
85
|
-
console.error('Failed to play remote media on remove track');
|
|
86
|
-
console.error(error);
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/*
|
|
91
|
-
* Create a user agent
|
|
92
|
-
* 创建用户代理
|
|
93
|
-
*/
|
|
94
|
-
const transportOptions = {
|
|
95
|
-
server: 'wss://' + config.server
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const userAgentDelegate: UserAgentDelegate = {
|
|
99
|
-
onInvite: (invitation: Invitation): void => {
|
|
100
|
-
// console.log('userAgent invitation', invitation)
|
|
101
|
-
this.Ginvitation = invitation
|
|
102
|
-
// An Invitation is a Session
|
|
103
|
-
const incomingSession: Session = invitation
|
|
104
|
-
// Setup incoming session delegate
|
|
105
|
-
incomingSession.delegate = {
|
|
106
|
-
// Handle incoming REFER request.
|
|
107
|
-
onRefer (referral: Referral): void {
|
|
108
|
-
// console.log(referral)
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
this.sendMessage('incomingcall')
|
|
112
|
-
this.Ginvitation._onCancel = (message: any): void => {
|
|
113
|
-
this.sendMessage('cancel')
|
|
114
|
-
}
|
|
115
|
-
// Handle incoming session state changes.
|
|
116
|
-
incomingSession.stateChange.addListener((state: SessionState) => {
|
|
117
|
-
switch (state) {
|
|
118
|
-
case SessionState.Initial:
|
|
119
|
-
break;
|
|
120
|
-
// 会话建立
|
|
121
|
-
case SessionState.Establishing:
|
|
122
|
-
break;
|
|
123
|
-
// 会话已经建立
|
|
124
|
-
case SessionState.Established:
|
|
125
|
-
// eslint-disable-next-line no-case-declarations
|
|
126
|
-
const sessionDescriptionHandler = incomingSession.sessionDescriptionHandler
|
|
127
|
-
if (!sessionDescriptionHandler || !(sessionDescriptionHandler instanceof Web.SessionDescriptionHandler)) {
|
|
128
|
-
throw new Error('Invalid session description handler.');
|
|
129
|
-
}
|
|
130
|
-
if (audioElement) {
|
|
131
|
-
assignStream(sessionDescriptionHandler.remoteMediaStream, audioElement)
|
|
132
|
-
}
|
|
133
|
-
break;
|
|
134
|
-
case SessionState.Terminating:
|
|
135
|
-
break;
|
|
136
|
-
case SessionState.Terminated:
|
|
137
|
-
break;
|
|
138
|
-
default:
|
|
139
|
-
throw new Error('Unknown session state.');
|
|
140
|
-
}
|
|
141
|
-
})
|
|
142
|
-
const constrainsDefault: MediaStreamConstraints = {
|
|
143
|
-
audio: true,
|
|
144
|
-
video: false
|
|
145
|
-
}
|
|
146
|
-
const options: InvitationAcceptOptions = {
|
|
147
|
-
sessionDescriptionHandlerOptions: {
|
|
148
|
-
constraints: constrainsDefault
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
const calltype = this.Ginvitation.incomingInviteRequest.message.headers['X-Calltype'][0].raw
|
|
152
|
-
if (calltype === 'callout') {
|
|
153
|
-
invitation.accept(options)
|
|
154
|
-
.then(() => {
|
|
155
|
-
console.log("接听成功");
|
|
156
|
-
}).catch((error: Error) => {
|
|
157
|
-
console.log("接听失败");
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
onConnect: () => {
|
|
162
|
-
// console.log('onConnect==============')
|
|
163
|
-
},
|
|
164
|
-
onDisconnect: () => {
|
|
165
|
-
// console.log('onDISCONNECT===============')
|
|
166
|
-
},
|
|
167
|
-
onRegisterRequest: () => {
|
|
168
|
-
// console.log('onRegisterRequest===============')
|
|
169
|
-
},
|
|
170
|
-
onRegister: () => {
|
|
171
|
-
// console.log('onRegister=============')
|
|
172
|
-
},
|
|
173
|
-
onMessage: (message: any) => {
|
|
174
|
-
// console.log('onMessage===============')
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const uri = UserAgent.makeURI('sip:' + config.sip + '@' + config.server);
|
|
179
|
-
if (!uri) {
|
|
180
|
-
throw new Error('Failed to create URI');
|
|
181
|
-
}
|
|
182
|
-
const userAgentOptions: UserAgentOptions = {
|
|
183
|
-
logBuiltinEnabled: false,
|
|
184
|
-
delegate: userAgentDelegate,
|
|
185
|
-
displayName: 'webrtc',
|
|
186
|
-
uri,
|
|
187
|
-
transportOptions,
|
|
188
|
-
authorizationUsername: config.sip,
|
|
189
|
-
authorizationHa1: config.secret
|
|
190
|
-
/* ... */
|
|
191
|
-
};
|
|
192
|
-
this.userAgent = new UserAgent(userAgentOptions);
|
|
193
|
-
// console.log(this.userAgent, 'this.userAgent=====')
|
|
194
|
-
const registererOptions: RegistererOptions = {
|
|
195
|
-
expires: 10
|
|
196
|
-
}
|
|
197
|
-
this.registerer = new Registerer(this.userAgent, registererOptions);
|
|
198
|
-
|
|
199
|
-
/***
|
|
200
|
-
* 注册的状态
|
|
201
|
-
*/
|
|
202
|
-
const requestDelegate: Core.OutgoingRequestDelegate = {
|
|
203
|
-
onAccept: (response: Core.IncomingResponse): void => {
|
|
204
|
-
// console.log('onAccept.....', response)
|
|
205
|
-
},
|
|
206
|
-
onProgress: (response: Core.IncomingResponse): void => {
|
|
207
|
-
// console.log('onProgress.....', response)
|
|
208
|
-
},
|
|
209
|
-
onRedirect: (response: Core.IncomingResponse): void => {
|
|
210
|
-
// console.log('onRedirect.....', response)
|
|
211
|
-
},
|
|
212
|
-
onReject: (response: Core.IncomingResponse): void => {
|
|
213
|
-
// console.log('onReject.....', response)
|
|
214
|
-
},
|
|
215
|
-
onTrying: (response: Core.IncomingResponse): void => {
|
|
216
|
-
// console.log('onTrying.....', response)
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
const registererRegisterOptions: RegistererRegisterOptions = {
|
|
221
|
-
requestDelegate
|
|
222
|
-
}
|
|
223
|
-
// console.log(registererRegisterOptions, 'registererRegisterOptions===')
|
|
224
|
-
this.registerHandle(registererRegisterOptions)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
private async registerHandle (registererRegisterOptions: RegistererRegisterOptions) {
|
|
228
|
-
await (this.userAgent as UserAgent).start();
|
|
229
|
-
// 注册
|
|
230
|
-
await this.registerer.register(registererRegisterOptions);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
public accept = async (): Promise<void> => {
|
|
234
|
-
const constrainsDefault: MediaStreamConstraints = {
|
|
235
|
-
audio: true,
|
|
236
|
-
video: false
|
|
237
|
-
}
|
|
238
|
-
const options: InvitationAcceptOptions = {
|
|
239
|
-
sessionDescriptionHandlerOptions: {
|
|
240
|
-
constraints: constrainsDefault
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return (this.Ginvitation as Invitation).accept(options)
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
public ueUnregisterWebrtc = async (): Promise<boolean | void> => { // 取消注册
|
|
247
|
-
if (!this.registerer) {
|
|
248
|
-
return false
|
|
249
|
-
}
|
|
250
|
-
return this.registerer.unregister({ all: true }).then((res: any) => {
|
|
251
|
-
}).catch((e: any) => {
|
|
252
|
-
})
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
private sendMessage (message: string) {
|
|
256
|
-
if (this.message) {
|
|
257
|
-
this.message(message)
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
public sendDTMF(tone: string): Promise<void> {
|
|
262
|
-
|
|
263
|
-
// As RFC 6086 states, sending DTMF via INFO is not standardized...
|
|
264
|
-
//
|
|
265
|
-
// Companies have been using INFO messages in order to transport
|
|
266
|
-
// Dual-Tone Multi-Frequency (DTMF) tones. All mechanisms are
|
|
267
|
-
// proprietary and have not been standardized.
|
|
268
|
-
// https://tools.ietf.org/html/rfc6086#section-2
|
|
269
|
-
//
|
|
270
|
-
// It is however widely supported based on this draft:
|
|
271
|
-
// https://tools.ietf.org/html/draft-kaplan-dispatch-info-dtmf-package-00
|
|
272
|
-
|
|
273
|
-
// Validate tone
|
|
274
|
-
if (!/^[0-9A-D#*,]$/.exec(tone)) {
|
|
275
|
-
return Promise.reject(new Error("Invalid DTMF tone."));
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
if (!this.Ginvitation) {
|
|
279
|
-
return Promise.reject(new Error("Session does not exist."));
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// The UA MUST populate the "application/dtmf-relay" body, as defined
|
|
283
|
-
// earlier, with the button pressed and the duration it was pressed
|
|
284
|
-
// for. Technically, this actually requires the INFO to be generated
|
|
285
|
-
// when the user *releases* the button, however if the user has still
|
|
286
|
-
// not released a button after 5 seconds, which is the maximum duration
|
|
287
|
-
// supported by this mechanism, the UA should generate the INFO at that
|
|
288
|
-
// time.
|
|
289
|
-
// https://tools.ietf.org/html/draft-kaplan-dispatch-info-dtmf-package-00#section-5.3
|
|
290
|
-
const dtmf = tone;
|
|
291
|
-
const duration = 2000;
|
|
292
|
-
const body = {
|
|
293
|
-
contentDisposition: "render",
|
|
294
|
-
contentType: "application/dtmf-relay",
|
|
295
|
-
content: "Signal=" + dtmf + "\r\nDuration=" + duration
|
|
296
|
-
};
|
|
297
|
-
const requestOptions = { body };
|
|
298
|
-
|
|
299
|
-
return this.Ginvitation.info({ requestOptions }).then(() => {
|
|
300
|
-
return;
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
public disconnect() {
|
|
305
|
-
return (this.userAgent as UserAgent).stop()
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
public connect () {
|
|
309
|
-
if ((this.userAgent as UserAgent).state !== UserAgentState.Started) {
|
|
310
|
-
return (this.userAgent as UserAgent).start();
|
|
311
|
-
}
|
|
312
|
-
return (this.userAgent as UserAgent).reconnect();
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
public isConnected(): boolean {
|
|
316
|
-
return (this.userAgent as UserAgent).isConnected();
|
|
317
|
-
}
|
|
318
|
-
}
|
|
File without changes
|