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
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SessionDialog } from "../dialogs";
|
|
2
|
-
import { C, OutgoingByeRequest, OutgoingRequestDelegate, RequestOptions } from "../messages";
|
|
3
|
-
import { NonInviteClientTransaction } from "../transactions";
|
|
4
|
-
import { UserAgentClient } from "./user-agent-client";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* BYE UAC.
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class ByeUserAgentClient extends UserAgentClient implements OutgoingByeRequest {
|
|
11
|
-
constructor(dialog: SessionDialog, delegate?: OutgoingRequestDelegate, options?: RequestOptions) {
|
|
12
|
-
const message = dialog.createOutgoingRequestMessage(C.BYE, options);
|
|
13
|
-
super(NonInviteClientTransaction, dialog.userAgentCore, message, delegate);
|
|
14
|
-
dialog.dispose();
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SessionDialog } from "../dialogs";
|
|
2
|
-
import { IncomingByeRequest, IncomingRequestDelegate, IncomingRequestMessage } from "../messages";
|
|
3
|
-
import { NonInviteServerTransaction } from "../transactions";
|
|
4
|
-
import { UserAgentServer } from "./user-agent-server";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* BYE UAS.
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class ByeUserAgentServer extends UserAgentServer implements IncomingByeRequest {
|
|
11
|
-
constructor(dialog: SessionDialog, message: IncomingRequestMessage, delegate?: IncomingRequestDelegate) {
|
|
12
|
-
super(NonInviteServerTransaction, dialog.userAgentCore, message, delegate);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OutgoingCancelRequest, OutgoingRequestDelegate, OutgoingRequestMessage } from "../messages";
|
|
2
|
-
import { NonInviteClientTransaction } from "../transactions";
|
|
3
|
-
import { UserAgentCore } from "../user-agent-core";
|
|
4
|
-
import { UserAgentClient } from "./user-agent-client";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* CANCEL UAC.
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class CancelUserAgentClient extends UserAgentClient implements OutgoingCancelRequest {
|
|
11
|
-
constructor(core: UserAgentCore, message: OutgoingRequestMessage, delegate?: OutgoingRequestDelegate) {
|
|
12
|
-
super(NonInviteClientTransaction, core, message, delegate);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export * from "./bye-user-agent-client";
|
|
2
|
-
export * from "./bye-user-agent-server";
|
|
3
|
-
export * from "./cancel-user-agent-client";
|
|
4
|
-
export * from "./info-user-agent-client";
|
|
5
|
-
export * from "./info-user-agent-server";
|
|
6
|
-
export * from "./invite-user-agent-client";
|
|
7
|
-
export * from "./invite-user-agent-server";
|
|
8
|
-
export * from "./message-user-agent-client";
|
|
9
|
-
export * from "./message-user-agent-server";
|
|
10
|
-
export * from "./notify-user-agent-client";
|
|
11
|
-
export * from "./notify-user-agent-server";
|
|
12
|
-
export * from "./publish-user-agent-client";
|
|
13
|
-
export * from "./prack-user-agent-client";
|
|
14
|
-
export * from "./prack-user-agent-server";
|
|
15
|
-
export * from "./re-invite-user-agent-client";
|
|
16
|
-
export * from "./re-invite-user-agent-server";
|
|
17
|
-
export * from "./re-subscribe-user-agent-client";
|
|
18
|
-
export * from "./re-subscribe-user-agent-server";
|
|
19
|
-
export * from "./refer-user-agent-client";
|
|
20
|
-
export * from "./refer-user-agent-server";
|
|
21
|
-
export * from "./register-user-agent-client";
|
|
22
|
-
export * from "./register-user-agent-server";
|
|
23
|
-
export * from "./subscribe-user-agent-client";
|
|
24
|
-
export * from "./subscribe-user-agent-server";
|
|
25
|
-
export * from "./user-agent-client";
|
|
26
|
-
export * from "./user-agent-server";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SessionDialog } from "../dialogs";
|
|
2
|
-
import { C, OutgoingInfoRequest, OutgoingRequestDelegate, RequestOptions } from "../messages";
|
|
3
|
-
import { NonInviteClientTransaction } from "../transactions";
|
|
4
|
-
import { UserAgentClient } from "./user-agent-client";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* INFO UAC.
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class InfoUserAgentClient extends UserAgentClient implements OutgoingInfoRequest {
|
|
11
|
-
constructor(dialog: SessionDialog, delegate?: OutgoingRequestDelegate, options?: RequestOptions) {
|
|
12
|
-
const message = dialog.createOutgoingRequestMessage(C.INFO, options);
|
|
13
|
-
super(NonInviteClientTransaction, dialog.userAgentCore, message, delegate);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SessionDialog } from "../dialogs";
|
|
2
|
-
import { IncomingInfoRequest, IncomingRequestDelegate, IncomingRequestMessage } from "../messages";
|
|
3
|
-
import { NonInviteServerTransaction } from "../transactions";
|
|
4
|
-
import { UserAgentServer } from "./user-agent-server";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* INFO UAS.
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export class InfoUserAgentServer extends UserAgentServer implements IncomingInfoRequest {
|
|
11
|
-
constructor(dialog: SessionDialog, message: IncomingRequestMessage, delegate?: IncomingRequestDelegate) {
|
|
12
|
-
super(NonInviteServerTransaction, dialog.userAgentCore, message, delegate);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
import { Dialog, SessionDialog } from "../dialogs";
|
|
2
|
-
import { TransportError } from "../exceptions";
|
|
3
|
-
import {
|
|
4
|
-
IncomingResponseMessage,
|
|
5
|
-
OutgoingAckRequest,
|
|
6
|
-
OutgoingInviteRequest,
|
|
7
|
-
OutgoingInviteRequestDelegate,
|
|
8
|
-
OutgoingPrackRequest,
|
|
9
|
-
OutgoingRequestMessage,
|
|
10
|
-
RequestOptions
|
|
11
|
-
} from "../messages";
|
|
12
|
-
import { SignalingState } from "../session";
|
|
13
|
-
import { InviteClientTransaction, TransactionState } from "../transactions";
|
|
14
|
-
import { UserAgentCore } from "../user-agent-core";
|
|
15
|
-
import { UserAgentClient } from "./user-agent-client";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* INVITE UAC.
|
|
19
|
-
* @remarks
|
|
20
|
-
* 13 Initiating a Session
|
|
21
|
-
* https://tools.ietf.org/html/rfc3261#section-13
|
|
22
|
-
* 13.1 Overview
|
|
23
|
-
* https://tools.ietf.org/html/rfc3261#section-13.1
|
|
24
|
-
* 13.2 UAC Processing
|
|
25
|
-
* https://tools.ietf.org/html/rfc3261#section-13.2
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export class InviteUserAgentClient extends UserAgentClient implements OutgoingInviteRequest {
|
|
29
|
-
public delegate: OutgoingInviteRequestDelegate | undefined;
|
|
30
|
-
|
|
31
|
-
private confirmedDialogAcks = new Map<string, OutgoingAckRequest>();
|
|
32
|
-
private confirmedDialogs = new Map<string, SessionDialog>();
|
|
33
|
-
private earlyDialogs = new Map<string, SessionDialog>();
|
|
34
|
-
|
|
35
|
-
constructor(core: UserAgentCore, message: OutgoingRequestMessage, delegate?: OutgoingInviteRequestDelegate) {
|
|
36
|
-
super(InviteClientTransaction, core, message, delegate);
|
|
37
|
-
this.delegate = delegate;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public dispose(): void {
|
|
41
|
-
// The UAC core considers the INVITE transaction completed 64*T1 seconds
|
|
42
|
-
// after the reception of the first 2xx response. At this point all the
|
|
43
|
-
// early dialogs that have not transitioned to established dialogs are
|
|
44
|
-
// terminated. Once the INVITE transaction is considered completed by
|
|
45
|
-
// the UAC core, no more new 2xx responses are expected to arrive.
|
|
46
|
-
//
|
|
47
|
-
// If, after acknowledging any 2xx response to an INVITE, the UAC does
|
|
48
|
-
// not want to continue with that dialog, then the UAC MUST terminate
|
|
49
|
-
// the dialog by sending a BYE request as described in Section 15.
|
|
50
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.4
|
|
51
|
-
this.earlyDialogs.forEach((earlyDialog) => earlyDialog.dispose());
|
|
52
|
-
this.earlyDialogs.clear();
|
|
53
|
-
super.dispose();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Special case for transport error while sending ACK.
|
|
58
|
-
* @param error - Transport error
|
|
59
|
-
*/
|
|
60
|
-
protected onTransportError(error: TransportError): void {
|
|
61
|
-
if (this.transaction.state === TransactionState.Calling) {
|
|
62
|
-
return super.onTransportError(error);
|
|
63
|
-
}
|
|
64
|
-
// If not in 'calling' state, the transport error occurred while sending an ACK.
|
|
65
|
-
this.logger.error(error.message);
|
|
66
|
-
this.logger.error("User agent client request transport error while sending ACK.");
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Once the INVITE has been passed to the INVITE client transaction, the
|
|
71
|
-
* UAC waits for responses for the INVITE.
|
|
72
|
-
* https://tools.ietf.org/html/rfc3261#section-13.2.2
|
|
73
|
-
* @param incomingResponse - Incoming response to INVITE request.
|
|
74
|
-
*/
|
|
75
|
-
protected receiveResponse(message: IncomingResponseMessage): void {
|
|
76
|
-
if (!this.authenticationGuard(message)) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const statusCode = message.statusCode ? message.statusCode.toString() : "";
|
|
81
|
-
if (!statusCode) {
|
|
82
|
-
throw new Error("Response status code undefined.");
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
switch (true) {
|
|
86
|
-
case /^100$/.test(statusCode):
|
|
87
|
-
if (this.delegate && this.delegate.onTrying) {
|
|
88
|
-
this.delegate.onTrying({ message });
|
|
89
|
-
}
|
|
90
|
-
return;
|
|
91
|
-
case /^1[0-9]{2}$/.test(statusCode):
|
|
92
|
-
// Zero, one or multiple provisional responses may arrive before one or
|
|
93
|
-
// more final responses are received. Provisional responses for an
|
|
94
|
-
// INVITE request can create "early dialogs". If a provisional response
|
|
95
|
-
// has a tag in the To field, and if the dialog ID of the response does
|
|
96
|
-
// not match an existing dialog, one is constructed using the procedures
|
|
97
|
-
// defined in Section 12.1.2.
|
|
98
|
-
//
|
|
99
|
-
// The early dialog will only be needed if the UAC needs to send a
|
|
100
|
-
// request to its peer within the dialog before the initial INVITE
|
|
101
|
-
// transaction completes. Header fields present in a provisional
|
|
102
|
-
// response are applicable as long as the dialog is in the early state
|
|
103
|
-
// (for example, an Allow header field in a provisional response
|
|
104
|
-
// contains the methods that can be used in the dialog while this is in
|
|
105
|
-
// the early state).
|
|
106
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.1
|
|
107
|
-
{
|
|
108
|
-
// Dialogs are created through the generation of non-failure responses
|
|
109
|
-
// to requests with specific methods. Within this specification, only
|
|
110
|
-
// 2xx and 101-199 responses with a To tag, where the request was
|
|
111
|
-
// INVITE, will establish a dialog. A dialog established by a non-final
|
|
112
|
-
// response to a request is in the "early" state and it is called an
|
|
113
|
-
// early dialog.
|
|
114
|
-
// https://tools.ietf.org/html/rfc3261#section-12.1
|
|
115
|
-
|
|
116
|
-
// Provisional without to tag, no dialog to create.
|
|
117
|
-
if (!message.toTag) {
|
|
118
|
-
this.logger.warn("Non-100 1xx INVITE response received without a to tag, dropping.");
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// When a UAS responds to a request with a response that establishes a
|
|
123
|
-
// dialog (such as a 2xx to INVITE), the UAS MUST copy all Record-Route
|
|
124
|
-
// header field values from the request into the response (including the
|
|
125
|
-
// URIs, URI parameters, and any Record-Route header field parameters,
|
|
126
|
-
// whether they are known or unknown to the UAS) and MUST maintain the
|
|
127
|
-
// order of those values. The UAS MUST add a Contact header field to
|
|
128
|
-
// the response.
|
|
129
|
-
// https://tools.ietf.org/html/rfc3261#section-12.1.1
|
|
130
|
-
|
|
131
|
-
// Provisional without Contact header field, malformed response.
|
|
132
|
-
const contact = message.parseHeader("contact");
|
|
133
|
-
if (!contact) {
|
|
134
|
-
this.logger.error("Non-100 1xx INVITE response received without a Contact header field, dropping.");
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Compute dialog state.
|
|
139
|
-
const dialogState = Dialog.initialDialogStateForUserAgentClient(this.message, message);
|
|
140
|
-
|
|
141
|
-
// Have existing early dialog or create a new one.
|
|
142
|
-
let earlyDialog = this.earlyDialogs.get(dialogState.id);
|
|
143
|
-
if (!earlyDialog) {
|
|
144
|
-
const transaction = this.transaction;
|
|
145
|
-
if (!(transaction instanceof InviteClientTransaction)) {
|
|
146
|
-
throw new Error("Transaction not instance of InviteClientTransaction.");
|
|
147
|
-
}
|
|
148
|
-
earlyDialog = new SessionDialog(transaction, this.core, dialogState);
|
|
149
|
-
this.earlyDialogs.set(earlyDialog.id, earlyDialog);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Guard against out of order reliable provisional responses.
|
|
153
|
-
// Note that this is where the rseq tracking is done.
|
|
154
|
-
if (!earlyDialog.reliableSequenceGuard(message)) {
|
|
155
|
-
this.logger.warn("1xx INVITE reliable response received out of order or is a retransmission, dropping.");
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// If the initial offer is in an INVITE, the answer MUST be in a
|
|
160
|
-
// reliable non-failure message from UAS back to UAC which is
|
|
161
|
-
// correlated to that INVITE. For this specification, that is
|
|
162
|
-
// only the final 2xx response to that INVITE. That same exact
|
|
163
|
-
// answer MAY also be placed in any provisional responses sent
|
|
164
|
-
// prior to the answer. The UAC MUST treat the first session
|
|
165
|
-
// description it receives as the answer, and MUST ignore any
|
|
166
|
-
// session descriptions in subsequent responses to the initial
|
|
167
|
-
// INVITE.
|
|
168
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.1
|
|
169
|
-
if (
|
|
170
|
-
earlyDialog.signalingState === SignalingState.Initial ||
|
|
171
|
-
earlyDialog.signalingState === SignalingState.HaveLocalOffer
|
|
172
|
-
) {
|
|
173
|
-
earlyDialog.signalingStateTransition(message);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Pass response to delegate.
|
|
177
|
-
const session = earlyDialog;
|
|
178
|
-
if (this.delegate && this.delegate.onProgress) {
|
|
179
|
-
this.delegate.onProgress({
|
|
180
|
-
message,
|
|
181
|
-
session,
|
|
182
|
-
prack: (options?: RequestOptions): OutgoingPrackRequest => {
|
|
183
|
-
const outgoingPrackRequest = session.prack(undefined, options);
|
|
184
|
-
return outgoingPrackRequest;
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return;
|
|
190
|
-
case /^2[0-9]{2}$/.test(statusCode):
|
|
191
|
-
// Multiple 2xx responses may arrive at the UAC for a single INVITE
|
|
192
|
-
// request due to a forking proxy. Each response is distinguished by
|
|
193
|
-
// the tag parameter in the To header field, and each represents a
|
|
194
|
-
// distinct dialog, with a distinct dialog identifier.
|
|
195
|
-
//
|
|
196
|
-
// If the dialog identifier in the 2xx response matches the dialog
|
|
197
|
-
// identifier of an existing dialog, the dialog MUST be transitioned to
|
|
198
|
-
// the "confirmed" state, and the route set for the dialog MUST be
|
|
199
|
-
// recomputed based on the 2xx response using the procedures of Section
|
|
200
|
-
// 12.2.1.2. Otherwise, a new dialog in the "confirmed" state MUST be
|
|
201
|
-
// constructed using the procedures of Section 12.1.2.
|
|
202
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.4
|
|
203
|
-
{
|
|
204
|
-
// Dialogs are created through the generation of non-failure responses
|
|
205
|
-
// to requests with specific methods. Within this specification, only
|
|
206
|
-
// 2xx and 101-199 responses with a To tag, where the request was
|
|
207
|
-
// INVITE, will establish a dialog. A dialog established by a non-final
|
|
208
|
-
// response to a request is in the "early" state and it is called an
|
|
209
|
-
// early dialog.
|
|
210
|
-
// https://tools.ietf.org/html/rfc3261#section-12.1
|
|
211
|
-
|
|
212
|
-
// Final without to tag, malformed response.
|
|
213
|
-
if (!message.toTag) {
|
|
214
|
-
this.logger.error("2xx INVITE response received without a to tag, dropping.");
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// When a UAS responds to a request with a response that establishes a
|
|
219
|
-
// dialog (such as a 2xx to INVITE), the UAS MUST copy all Record-Route
|
|
220
|
-
// header field values from the request into the response (including the
|
|
221
|
-
// URIs, URI parameters, and any Record-Route header field parameters,
|
|
222
|
-
// whether they are known or unknown to the UAS) and MUST maintain the
|
|
223
|
-
// order of those values. The UAS MUST add a Contact header field to
|
|
224
|
-
// the response.
|
|
225
|
-
// https://tools.ietf.org/html/rfc3261#section-12.1.1
|
|
226
|
-
|
|
227
|
-
// Final without Contact header field, malformed response.
|
|
228
|
-
const contact = message.parseHeader("contact");
|
|
229
|
-
if (!contact) {
|
|
230
|
-
this.logger.error("2xx INVITE response received without a Contact header field, dropping.");
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Compute dialog state.
|
|
235
|
-
const dialogState = Dialog.initialDialogStateForUserAgentClient(this.message, message);
|
|
236
|
-
|
|
237
|
-
// NOTE: Currently our transaction layer is caching the 2xx ACKs and
|
|
238
|
-
// handling retransmissions of the ACK which is an approach which is
|
|
239
|
-
// not to spec. In any event, this block is intended to provide a to
|
|
240
|
-
// spec implementation of ACK retransmissions, but it should not be
|
|
241
|
-
// hit currently.
|
|
242
|
-
let dialog = this.confirmedDialogs.get(dialogState.id);
|
|
243
|
-
if (dialog) {
|
|
244
|
-
// Once the ACK has been constructed, the procedures of [4] are used to
|
|
245
|
-
// determine the destination address, port and transport. However, the
|
|
246
|
-
// request is passed to the transport layer directly for transmission,
|
|
247
|
-
// rather than a client transaction. This is because the UAC core
|
|
248
|
-
// handles retransmissions of the ACK, not the transaction layer. The
|
|
249
|
-
// ACK MUST be passed to the client transport every time a
|
|
250
|
-
// retransmission of the 2xx final response that triggered the ACK
|
|
251
|
-
// arrives.
|
|
252
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.4
|
|
253
|
-
const outgoingAckRequest = this.confirmedDialogAcks.get(dialogState.id);
|
|
254
|
-
if (outgoingAckRequest) {
|
|
255
|
-
const transaction = this.transaction;
|
|
256
|
-
if (!(transaction instanceof InviteClientTransaction)) {
|
|
257
|
-
throw new Error("Client transaction not instance of InviteClientTransaction.");
|
|
258
|
-
}
|
|
259
|
-
transaction.ackResponse(outgoingAckRequest.message);
|
|
260
|
-
} else {
|
|
261
|
-
// If still waiting for an ACK, drop the retransmission of the 2xx final response.
|
|
262
|
-
}
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// If the dialog identifier in the 2xx response matches the dialog
|
|
267
|
-
// identifier of an existing dialog, the dialog MUST be transitioned to
|
|
268
|
-
// the "confirmed" state, and the route set for the dialog MUST be
|
|
269
|
-
// recomputed based on the 2xx response using the procedures of Section
|
|
270
|
-
// 12.2.1.2. Otherwise, a new dialog in the "confirmed" state MUST be
|
|
271
|
-
// constructed using the procedures of Section 12.1.2.
|
|
272
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.4
|
|
273
|
-
dialog = this.earlyDialogs.get(dialogState.id);
|
|
274
|
-
if (dialog) {
|
|
275
|
-
dialog.confirm();
|
|
276
|
-
dialog.recomputeRouteSet(message);
|
|
277
|
-
this.earlyDialogs.delete(dialog.id);
|
|
278
|
-
this.confirmedDialogs.set(dialog.id, dialog);
|
|
279
|
-
} else {
|
|
280
|
-
const transaction = this.transaction;
|
|
281
|
-
if (!(transaction instanceof InviteClientTransaction)) {
|
|
282
|
-
throw new Error("Transaction not instance of InviteClientTransaction.");
|
|
283
|
-
}
|
|
284
|
-
dialog = new SessionDialog(transaction, this.core, dialogState);
|
|
285
|
-
this.confirmedDialogs.set(dialog.id, dialog);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// If the initial offer is in an INVITE, the answer MUST be in a
|
|
289
|
-
// reliable non-failure message from UAS back to UAC which is
|
|
290
|
-
// correlated to that INVITE. For this specification, that is
|
|
291
|
-
// only the final 2xx response to that INVITE. That same exact
|
|
292
|
-
// answer MAY also be placed in any provisional responses sent
|
|
293
|
-
// prior to the answer. The UAC MUST treat the first session
|
|
294
|
-
// description it receives as the answer, and MUST ignore any
|
|
295
|
-
// session descriptions in subsequent responses to the initial
|
|
296
|
-
// INVITE.
|
|
297
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.1
|
|
298
|
-
if (
|
|
299
|
-
dialog.signalingState === SignalingState.Initial ||
|
|
300
|
-
dialog.signalingState === SignalingState.HaveLocalOffer
|
|
301
|
-
) {
|
|
302
|
-
dialog.signalingStateTransition(message);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// Session Initiated! :)
|
|
306
|
-
const session = dialog;
|
|
307
|
-
|
|
308
|
-
// The UAC core MUST generate an ACK request for each 2xx received from
|
|
309
|
-
// the transaction layer. The header fields of the ACK are constructed
|
|
310
|
-
// in the same way as for any request sent within a dialog (see Section
|
|
311
|
-
// 12) with the exception of the CSeq and the header fields related to
|
|
312
|
-
// authentication. The sequence number of the CSeq header field MUST be
|
|
313
|
-
// the same as the INVITE being acknowledged, but the CSeq method MUST
|
|
314
|
-
// be ACK. The ACK MUST contain the same credentials as the INVITE. If
|
|
315
|
-
// the 2xx contains an offer (based on the rules above), the ACK MUST
|
|
316
|
-
// carry an answer in its body. If the offer in the 2xx response is not
|
|
317
|
-
// acceptable, the UAC core MUST generate a valid answer in the ACK and
|
|
318
|
-
// then send a BYE immediately.
|
|
319
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.4
|
|
320
|
-
if (this.delegate && this.delegate.onAccept) {
|
|
321
|
-
this.delegate.onAccept({
|
|
322
|
-
message,
|
|
323
|
-
session,
|
|
324
|
-
ack: (options?: RequestOptions): OutgoingAckRequest => {
|
|
325
|
-
const outgoingAckRequest = session.ack(options);
|
|
326
|
-
this.confirmedDialogAcks.set(session.id, outgoingAckRequest);
|
|
327
|
-
return outgoingAckRequest;
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
} else {
|
|
331
|
-
const outgoingAckRequest = session.ack();
|
|
332
|
-
this.confirmedDialogAcks.set(session.id, outgoingAckRequest);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
return;
|
|
336
|
-
case /^3[0-9]{2}$/.test(statusCode):
|
|
337
|
-
// 12.3 Termination of a Dialog
|
|
338
|
-
//
|
|
339
|
-
// Independent of the method, if a request outside of a dialog generates
|
|
340
|
-
// a non-2xx final response, any early dialogs created through
|
|
341
|
-
// provisional responses to that request are terminated. The mechanism
|
|
342
|
-
// for terminating confirmed dialogs is method specific. In this
|
|
343
|
-
// specification, the BYE method terminates a session and the dialog
|
|
344
|
-
// associated with it. See Section 15 for details.
|
|
345
|
-
// https://tools.ietf.org/html/rfc3261#section-12.3
|
|
346
|
-
|
|
347
|
-
// All early dialogs are considered terminated upon reception of the
|
|
348
|
-
// non-2xx final response.
|
|
349
|
-
//
|
|
350
|
-
// After having received the non-2xx final response the UAC core
|
|
351
|
-
// considers the INVITE transaction completed. The INVITE client
|
|
352
|
-
// transaction handles the generation of ACKs for the response (see
|
|
353
|
-
// Section 17).
|
|
354
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.3
|
|
355
|
-
this.earlyDialogs.forEach((earlyDialog) => earlyDialog.dispose());
|
|
356
|
-
this.earlyDialogs.clear();
|
|
357
|
-
|
|
358
|
-
// A 3xx response may contain one or more Contact header field values
|
|
359
|
-
// providing new addresses where the callee might be reachable.
|
|
360
|
-
// Depending on the status code of the 3xx response (see Section 21.3),
|
|
361
|
-
// the UAC MAY choose to try those new addresses.
|
|
362
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.2
|
|
363
|
-
if (this.delegate && this.delegate.onRedirect) {
|
|
364
|
-
this.delegate.onRedirect({ message });
|
|
365
|
-
}
|
|
366
|
-
return;
|
|
367
|
-
case /^[4-6][0-9]{2}$/.test(statusCode):
|
|
368
|
-
// 12.3 Termination of a Dialog
|
|
369
|
-
//
|
|
370
|
-
// Independent of the method, if a request outside of a dialog generates
|
|
371
|
-
// a non-2xx final response, any early dialogs created through
|
|
372
|
-
// provisional responses to that request are terminated. The mechanism
|
|
373
|
-
// for terminating confirmed dialogs is method specific. In this
|
|
374
|
-
// specification, the BYE method terminates a session and the dialog
|
|
375
|
-
// associated with it. See Section 15 for details.
|
|
376
|
-
// https://tools.ietf.org/html/rfc3261#section-12.3
|
|
377
|
-
|
|
378
|
-
// All early dialogs are considered terminated upon reception of the
|
|
379
|
-
// non-2xx final response.
|
|
380
|
-
//
|
|
381
|
-
// After having received the non-2xx final response the UAC core
|
|
382
|
-
// considers the INVITE transaction completed. The INVITE client
|
|
383
|
-
// transaction handles the generation of ACKs for the response (see
|
|
384
|
-
// Section 17).
|
|
385
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.3
|
|
386
|
-
this.earlyDialogs.forEach((earlyDialog) => earlyDialog.dispose());
|
|
387
|
-
this.earlyDialogs.clear();
|
|
388
|
-
|
|
389
|
-
// A single non-2xx final response may be received for the INVITE. 4xx,
|
|
390
|
-
// 5xx and 6xx responses may contain a Contact header field value
|
|
391
|
-
// indicating the location where additional information about the error
|
|
392
|
-
// can be found. Subsequent final responses (which would only arrive
|
|
393
|
-
// under error conditions) MUST be ignored.
|
|
394
|
-
// https://tools.ietf.org/html/rfc3261#section-13.2.2.3
|
|
395
|
-
if (this.delegate && this.delegate.onReject) {
|
|
396
|
-
this.delegate.onReject({ message });
|
|
397
|
-
}
|
|
398
|
-
return;
|
|
399
|
-
default:
|
|
400
|
-
throw new Error(`Invalid status code ${statusCode}`);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
throw new Error(`Executing what should be an unreachable code path receiving ${statusCode} response.`);
|
|
404
|
-
}
|
|
405
|
-
}
|