ue-softphone-sdk 4.0.0 → 4.0.2

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.
Files changed (394) hide show
  1. package/dist/lib/ue-soft-phone.min.js +2 -2
  2. package/dist/ue-softphone-sdk.js +2 -2
  3. package/package.json +4 -1
  4. package/.babelrc +0 -12
  5. package/.gitlab-ci.yml +0 -3
  6. package/Dockerfile +0 -17
  7. package/dist/lib/types/lib/sip.js/api/ack.d.ts +0 -12
  8. package/dist/lib/types/lib/sip.js/api/bye.d.ts +0 -16
  9. package/dist/lib/types/lib/sip.js/api/dtmf.d.ts +0 -15
  10. package/dist/lib/types/lib/sip.js/api/emitter.d.ts +0 -88
  11. package/dist/lib/types/lib/sip.js/api/exceptions/content-type-unsupported.d.ts +0 -8
  12. package/dist/lib/types/lib/sip.js/api/exceptions/index.d.ts +0 -5
  13. package/dist/lib/types/lib/sip.js/api/exceptions/request-pending.d.ts +0 -9
  14. package/dist/lib/types/lib/sip.js/api/exceptions/session-description-handler.d.ts +0 -8
  15. package/dist/lib/types/lib/sip.js/api/exceptions/session-terminated.d.ts +0 -8
  16. package/dist/lib/types/lib/sip.js/api/exceptions/state-transition.d.ts +0 -8
  17. package/dist/lib/types/lib/sip.js/api/index.d.ts +0 -59
  18. package/dist/lib/types/lib/sip.js/api/info.d.ts +0 -16
  19. package/dist/lib/types/lib/sip.js/api/invitation-accept-options.d.ts +0 -19
  20. package/dist/lib/types/lib/sip.js/api/invitation-progress-options.d.ts +0 -38
  21. package/dist/lib/types/lib/sip.js/api/invitation-reject-options.d.ts +0 -25
  22. package/dist/lib/types/lib/sip.js/api/invitation.d.ts +0 -179
  23. package/dist/lib/types/lib/sip.js/api/inviter-cancel-options.d.ts +0 -9
  24. package/dist/lib/types/lib/sip.js/api/inviter-invite-options.d.ts +0 -28
  25. package/dist/lib/types/lib/sip.js/api/inviter-options.d.ts +0 -43
  26. package/dist/lib/types/lib/sip.js/api/inviter.d.ts +0 -236
  27. package/dist/lib/types/lib/sip.js/api/message.d.ts +0 -16
  28. package/dist/lib/types/lib/sip.js/api/messager-message-options.d.ts +0 -11
  29. package/dist/lib/types/lib/sip.js/api/messager-options.d.ts +0 -17
  30. package/dist/lib/types/lib/sip.js/api/messager.d.ts +0 -26
  31. package/dist/lib/types/lib/sip.js/api/notification.d.ts +0 -16
  32. package/dist/lib/types/lib/sip.js/api/notifier.d.ts +0 -8
  33. package/dist/lib/types/lib/sip.js/api/publisher-options.d.ts +0 -33
  34. package/dist/lib/types/lib/sip.js/api/publisher-publish-options.d.ts +0 -6
  35. package/dist/lib/types/lib/sip.js/api/publisher-state.d.ts +0 -21
  36. package/dist/lib/types/lib/sip.js/api/publisher-unpublish-options.d.ts +0 -6
  37. package/dist/lib/types/lib/sip.js/api/publisher.d.ts +0 -65
  38. package/dist/lib/types/lib/sip.js/api/referral.d.ts +0 -38
  39. package/dist/lib/types/lib/sip.js/api/registerer-options.d.ts +0 -46
  40. package/dist/lib/types/lib/sip.js/api/registerer-register-options.d.ts +0 -11
  41. package/dist/lib/types/lib/sip.js/api/registerer-state.d.ts +0 -21
  42. package/dist/lib/types/lib/sip.js/api/registerer-unregister-options.d.ts +0 -16
  43. package/dist/lib/types/lib/sip.js/api/registerer.d.ts +0 -144
  44. package/dist/lib/types/lib/sip.js/api/session-bye-options.d.ts +0 -11
  45. package/dist/lib/types/lib/sip.js/api/session-delegate.d.ts +0 -79
  46. package/dist/lib/types/lib/sip.js/api/session-description-handler-factory.d.ts +0 -15
  47. package/dist/lib/types/lib/sip.js/api/session-description-handler.d.ts +0 -74
  48. package/dist/lib/types/lib/sip.js/api/session-info-options.d.ts +0 -11
  49. package/dist/lib/types/lib/sip.js/api/session-invite-options.d.ts +0 -28
  50. package/dist/lib/types/lib/sip.js/api/session-message-options.d.ts +0 -11
  51. package/dist/lib/types/lib/sip.js/api/session-options.d.ts +0 -8
  52. package/dist/lib/types/lib/sip.js/api/session-refer-options.d.ts +0 -14
  53. package/dist/lib/types/lib/sip.js/api/session-state.d.ts +0 -45
  54. package/dist/lib/types/lib/sip.js/api/session.d.ts +0 -359
  55. package/dist/lib/types/lib/sip.js/api/subscriber-options.d.ts +0 -11
  56. package/dist/lib/types/lib/sip.js/api/subscriber-subscribe-options.d.ts +0 -6
  57. package/dist/lib/types/lib/sip.js/api/subscriber.d.ts +0 -94
  58. package/dist/lib/types/lib/sip.js/api/subscription-delegate.d.ts +0 -12
  59. package/dist/lib/types/lib/sip.js/api/subscription-options.d.ts +0 -8
  60. package/dist/lib/types/lib/sip.js/api/subscription-state.d.ts +0 -19
  61. package/dist/lib/types/lib/sip.js/api/subscription-subscribe-options.d.ts +0 -6
  62. package/dist/lib/types/lib/sip.js/api/subscription-unsubscribe-options.d.ts +0 -6
  63. package/dist/lib/types/lib/sip.js/api/subscription.d.ts +0 -84
  64. package/dist/lib/types/lib/sip.js/api/transport-state.d.ts +0 -37
  65. package/dist/lib/types/lib/sip.js/api/transport.d.ts +0 -159
  66. package/dist/lib/types/lib/sip.js/api/user-agent-delegate.d.ts +0 -84
  67. package/dist/lib/types/lib/sip.js/api/user-agent-options.d.ts +0 -253
  68. package/dist/lib/types/lib/sip.js/api/user-agent-state.d.ts +0 -14
  69. package/dist/lib/types/lib/sip.js/api/user-agent.d.ts +0 -200
  70. package/dist/lib/types/lib/sip.js/core/dialogs/dialog-state.d.ts +0 -34
  71. package/dist/lib/types/lib/sip.js/core/dialogs/dialog.d.ts +0 -161
  72. package/dist/lib/types/lib/sip.js/core/dialogs/index.d.ts +0 -4
  73. package/dist/lib/types/lib/sip.js/core/dialogs/session-dialog.d.ts +0 -196
  74. package/dist/lib/types/lib/sip.js/core/dialogs/subscription-dialog.d.ts +0 -120
  75. package/dist/lib/types/lib/sip.js/core/exceptions/exception.d.ts +0 -8
  76. package/dist/lib/types/lib/sip.js/core/exceptions/index.d.ts +0 -3
  77. package/dist/lib/types/lib/sip.js/core/exceptions/transaction-state-error.d.ts +0 -8
  78. package/dist/lib/types/lib/sip.js/core/exceptions/transport-error.d.ts +0 -8
  79. package/dist/lib/types/lib/sip.js/core/index.d.ts +0 -15
  80. package/dist/lib/types/lib/sip.js/core/log/index.d.ts +0 -3
  81. package/dist/lib/types/lib/sip.js/core/log/levels.d.ts +0 -10
  82. package/dist/lib/types/lib/sip.js/core/log/logger-factory.d.ts +0 -21
  83. package/dist/lib/types/lib/sip.js/core/log/logger.d.ts +0 -19
  84. package/dist/lib/types/lib/sip.js/core/messages/body.d.ts +0 -64
  85. package/dist/lib/types/lib/sip.js/core/messages/digest-authentication.d.ts +0 -51
  86. package/dist/lib/types/lib/sip.js/core/messages/incoming-message.d.ts +0 -79
  87. package/dist/lib/types/lib/sip.js/core/messages/incoming-request-message.d.ts +0 -10
  88. package/dist/lib/types/lib/sip.js/core/messages/incoming-request.d.ts +0 -67
  89. package/dist/lib/types/lib/sip.js/core/messages/incoming-response-message.d.ts +0 -10
  90. package/dist/lib/types/lib/sip.js/core/messages/incoming-response.d.ts +0 -12
  91. package/dist/lib/types/lib/sip.js/core/messages/index.d.ts +0 -13
  92. package/dist/lib/types/lib/sip.js/core/messages/md5.d.ts +0 -32
  93. package/dist/lib/types/lib/sip.js/core/messages/methods/ack.d.ts +0 -18
  94. package/dist/lib/types/lib/sip.js/core/messages/methods/bye.d.ts +0 -21
  95. package/dist/lib/types/lib/sip.js/core/messages/methods/cancel.d.ts +0 -21
  96. package/dist/lib/types/lib/sip.js/core/messages/methods/constants.d.ts +0 -20
  97. package/dist/lib/types/lib/sip.js/core/messages/methods/index.d.ts +0 -13
  98. package/dist/lib/types/lib/sip.js/core/messages/methods/info.d.ts +0 -21
  99. package/dist/lib/types/lib/sip.js/core/messages/methods/invite.d.ts +0 -86
  100. package/dist/lib/types/lib/sip.js/core/messages/methods/message.d.ts +0 -21
  101. package/dist/lib/types/lib/sip.js/core/messages/methods/notify.d.ts +0 -21
  102. package/dist/lib/types/lib/sip.js/core/messages/methods/prack.d.ts +0 -21
  103. package/dist/lib/types/lib/sip.js/core/messages/methods/publish.d.ts +0 -21
  104. package/dist/lib/types/lib/sip.js/core/messages/methods/refer.d.ts +0 -21
  105. package/dist/lib/types/lib/sip.js/core/messages/methods/register.d.ts +0 -21
  106. package/dist/lib/types/lib/sip.js/core/messages/methods/subscribe.d.ts +0 -54
  107. package/dist/lib/types/lib/sip.js/core/messages/outgoing-request-message.d.ts +0 -94
  108. package/dist/lib/types/lib/sip.js/core/messages/outgoing-request.d.ts +0 -67
  109. package/dist/lib/types/lib/sip.js/core/messages/outgoing-response.d.ts +0 -42
  110. package/dist/lib/types/lib/sip.js/core/messages/parser.d.ts +0 -14
  111. package/dist/lib/types/lib/sip.js/core/messages/utils.d.ts +0 -24
  112. package/dist/lib/types/lib/sip.js/core/session/index.d.ts +0 -2
  113. package/dist/lib/types/lib/sip.js/core/session/session-delegate.d.ts +0 -70
  114. package/dist/lib/types/lib/sip.js/core/session/session.d.ts +0 -134
  115. package/dist/lib/types/lib/sip.js/core/subscription/index.d.ts +0 -2
  116. package/dist/lib/types/lib/sip.js/core/subscription/subscription-delegate.d.ts +0 -27
  117. package/dist/lib/types/lib/sip.js/core/subscription/subscription.d.ts +0 -55
  118. package/dist/lib/types/lib/sip.js/core/timers.d.ts +0 -20
  119. package/dist/lib/types/lib/sip.js/core/transactions/client-transaction.d.ts +0 -45
  120. package/dist/lib/types/lib/sip.js/core/transactions/index.d.ts +0 -10
  121. package/dist/lib/types/lib/sip.js/core/transactions/invite-client-transaction.d.ts +0 -116
  122. package/dist/lib/types/lib/sip.js/core/transactions/invite-server-transaction.d.ts +0 -127
  123. package/dist/lib/types/lib/sip.js/core/transactions/non-invite-client-transaction.d.ts +0 -69
  124. package/dist/lib/types/lib/sip.js/core/transactions/non-invite-server-transaction.d.ts +0 -57
  125. package/dist/lib/types/lib/sip.js/core/transactions/server-transaction.d.ts +0 -35
  126. package/dist/lib/types/lib/sip.js/core/transactions/transaction-state.d.ts +0 -13
  127. package/dist/lib/types/lib/sip.js/core/transactions/transaction-user.d.ts +0 -72
  128. package/dist/lib/types/lib/sip.js/core/transactions/transaction.d.ts +0 -79
  129. package/dist/lib/types/lib/sip.js/core/transport.d.ts +0 -31
  130. package/dist/lib/types/lib/sip.js/core/user-agent-core/allowed-methods.d.ts +0 -4
  131. package/dist/lib/types/lib/sip.js/core/user-agent-core/index.d.ts +0 -3
  132. package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core-configuration.d.ts +0 -99
  133. package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core-delegate.d.ts +0 -37
  134. package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core.d.ts +0 -179
  135. package/dist/lib/types/lib/sip.js/core/user-agents/bye-user-agent-client.d.ts +0 -10
  136. package/dist/lib/types/lib/sip.js/core/user-agents/bye-user-agent-server.d.ts +0 -10
  137. package/dist/lib/types/lib/sip.js/core/user-agents/cancel-user-agent-client.d.ts +0 -10
  138. package/dist/lib/types/lib/sip.js/core/user-agents/index.d.ts +0 -26
  139. package/dist/lib/types/lib/sip.js/core/user-agents/info-user-agent-client.d.ts +0 -10
  140. package/dist/lib/types/lib/sip.js/core/user-agents/info-user-agent-server.d.ts +0 -10
  141. package/dist/lib/types/lib/sip.js/core/user-agents/invite-user-agent-client.d.ts +0 -35
  142. package/dist/lib/types/lib/sip.js/core/user-agents/invite-user-agent-server.d.ts +0 -77
  143. package/dist/lib/types/lib/sip.js/core/user-agents/message-user-agent-client.d.ts +0 -10
  144. package/dist/lib/types/lib/sip.js/core/user-agents/message-user-agent-server.d.ts +0 -10
  145. package/dist/lib/types/lib/sip.js/core/user-agents/notify-user-agent-client.d.ts +0 -10
  146. package/dist/lib/types/lib/sip.js/core/user-agents/notify-user-agent-server.d.ts +0 -16
  147. package/dist/lib/types/lib/sip.js/core/user-agents/prack-user-agent-client.d.ts +0 -10
  148. package/dist/lib/types/lib/sip.js/core/user-agents/prack-user-agent-server.d.ts +0 -16
  149. package/dist/lib/types/lib/sip.js/core/user-agents/publish-user-agent-client.d.ts +0 -10
  150. package/dist/lib/types/lib/sip.js/core/user-agents/re-invite-user-agent-client.d.ts +0 -18
  151. package/dist/lib/types/lib/sip.js/core/user-agents/re-invite-user-agent-server.d.ts +0 -41
  152. package/dist/lib/types/lib/sip.js/core/user-agents/re-subscribe-user-agent-client.d.ts +0 -17
  153. package/dist/lib/types/lib/sip.js/core/user-agents/re-subscribe-user-agent-server.d.ts +0 -10
  154. package/dist/lib/types/lib/sip.js/core/user-agents/refer-user-agent-client.d.ts +0 -10
  155. package/dist/lib/types/lib/sip.js/core/user-agents/refer-user-agent-server.d.ts +0 -16
  156. package/dist/lib/types/lib/sip.js/core/user-agents/register-user-agent-client.d.ts +0 -10
  157. package/dist/lib/types/lib/sip.js/core/user-agents/register-user-agent-server.d.ts +0 -11
  158. package/dist/lib/types/lib/sip.js/core/user-agents/subscribe-user-agent-client.d.ts +0 -65
  159. package/dist/lib/types/lib/sip.js/core/user-agents/subscribe-user-agent-server.d.ts +0 -11
  160. package/dist/lib/types/lib/sip.js/core/user-agents/user-agent-client.d.ts +0 -103
  161. package/dist/lib/types/lib/sip.js/core/user-agents/user-agent-server.d.ts +0 -79
  162. package/dist/lib/types/lib/sip.js/grammar/grammar.d.ts +0 -26
  163. package/dist/lib/types/lib/sip.js/grammar/index.d.ts +0 -4
  164. package/dist/lib/types/lib/sip.js/grammar/name-addr-header.d.ts +0 -24
  165. package/dist/lib/types/lib/sip.js/grammar/parameters.d.ts +0 -16
  166. package/dist/lib/types/lib/sip.js/grammar/pegjs/dist/grammar.d.ts +0 -50
  167. package/dist/lib/types/lib/sip.js/grammar/uri.d.ts +0 -62
  168. package/dist/lib/types/lib/sip.js/index.d.ts +0 -9
  169. package/dist/lib/types/lib/sip.js/platform/web/index.d.ts +0 -4
  170. package/dist/lib/types/lib/sip.js/platform/web/modifiers/index.d.ts +0 -5
  171. package/dist/lib/types/lib/sip.js/platform/web/modifiers/modifiers.d.ts +0 -41
  172. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/index.d.ts +0 -14
  173. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/media-stream-factory-default.d.ts +0 -6
  174. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/media-stream-factory.d.ts +0 -6
  175. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/peer-connection-configuration-default.d.ts +0 -5
  176. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/peer-connection-delegate.d.ts +0 -63
  177. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-configuration.d.ts +0 -16
  178. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-default.d.ts +0 -11
  179. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-options.d.ts +0 -9
  180. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory.d.ts +0 -16
  181. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-options.d.ts +0 -47
  182. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler.d.ts +0 -212
  183. package/dist/lib/types/lib/sip.js/platform/web/simple-user/index.d.ts +0 -7
  184. package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user-delegate.d.ts +0 -72
  185. package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user-options.d.ts +0 -90
  186. package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user.d.ts +0 -226
  187. package/dist/lib/types/lib/sip.js/platform/web/transport/index.d.ts +0 -6
  188. package/dist/lib/types/lib/sip.js/platform/web/transport/transport-options.d.ts +0 -30
  189. package/dist/lib/types/lib/sip.js/platform/web/transport/transport.d.ts +0 -125
  190. package/dist/lib/types/lib/sip.js/version.d.ts +0 -1
  191. package/dist/lib/types/webrtc/webrtc-method.d.ts +0 -2
  192. package/dist/lib/types/webrtc/webrtc.d.ts +0 -38
  193. package/index.html/index.html +0 -118
  194. package/nginx.conf +0 -56
  195. package/rollup-new.config.mjs +0 -20
  196. package/rollup.config.js +0 -45
  197. package/src/config.ts +0 -19
  198. package/src/index.ts +0 -2473
  199. package/src/lib/sip.js/api/ack.ts +0 -15
  200. package/src/lib/sip.js/api/api-extractor.json +0 -350
  201. package/src/lib/sip.js/api/bye.ts +0 -27
  202. package/src/lib/sip.js/api/dtmf.ts +0 -27
  203. package/src/lib/sip.js/api/emitter.ts +0 -110
  204. package/src/lib/sip.js/api/exceptions/content-type-unsupported.ts +0 -11
  205. package/src/lib/sip.js/api/exceptions/index.ts +0 -5
  206. package/src/lib/sip.js/api/exceptions/request-pending.ts +0 -12
  207. package/src/lib/sip.js/api/exceptions/session-description-handler.ts +0 -11
  208. package/src/lib/sip.js/api/exceptions/session-terminated.ts +0 -11
  209. package/src/lib/sip.js/api/exceptions/state-transition.ts +0 -11
  210. package/src/lib/sip.js/api/index.ts +0 -59
  211. package/src/lib/sip.js/api/info.ts +0 -27
  212. package/src/lib/sip.js/api/invitation-accept-options.ts +0 -20
  213. package/src/lib/sip.js/api/invitation-progress-options.ts +0 -36
  214. package/src/lib/sip.js/api/invitation-reject-options.ts +0 -22
  215. package/src/lib/sip.js/api/invitation.ts +0 -815
  216. package/src/lib/sip.js/api/inviter-cancel-options.ts +0 -9
  217. package/src/lib/sip.js/api/inviter-invite-options.ts +0 -29
  218. package/src/lib/sip.js/api/inviter-options.ts +0 -44
  219. package/src/lib/sip.js/api/inviter.ts +0 -1126
  220. package/src/lib/sip.js/api/message.ts +0 -27
  221. package/src/lib/sip.js/api/messager-message-options.ts +0 -12
  222. package/src/lib/sip.js/api/messager-options.ts +0 -18
  223. package/src/lib/sip.js/api/messager.ts +0 -89
  224. package/src/lib/sip.js/api/notification.ts +0 -27
  225. package/src/lib/sip.js/api/notifier.ts +0 -7
  226. package/src/lib/sip.js/api/publisher-options.ts +0 -34
  227. package/src/lib/sip.js/api/publisher-publish-options.ts +0 -6
  228. package/src/lib/sip.js/api/publisher-state.ts +0 -21
  229. package/src/lib/sip.js/api/publisher-unpublish-options.ts +0 -6
  230. package/src/lib/sip.js/api/publisher.ts +0 -421
  231. package/src/lib/sip.js/api/referral.ts +0 -89
  232. package/src/lib/sip.js/api/registerer-options.ts +0 -55
  233. package/src/lib/sip.js/api/registerer-register-options.ts +0 -12
  234. package/src/lib/sip.js/api/registerer-state.ts +0 -21
  235. package/src/lib/sip.js/api/registerer-unregister-options.ts +0 -17
  236. package/src/lib/sip.js/api/registerer.ts +0 -819
  237. package/src/lib/sip.js/api/session-bye-options.ts +0 -12
  238. package/src/lib/sip.js/api/session-delegate.ts +0 -87
  239. package/src/lib/sip.js/api/session-description-handler-factory.ts +0 -16
  240. package/src/lib/sip.js/api/session-description-handler.ts +0 -89
  241. package/src/lib/sip.js/api/session-info-options.ts +0 -12
  242. package/src/lib/sip.js/api/session-invite-options.ts +0 -29
  243. package/src/lib/sip.js/api/session-message-options.ts +0 -12
  244. package/src/lib/sip.js/api/session-options.ts +0 -8
  245. package/src/lib/sip.js/api/session-refer-options.ts +0 -15
  246. package/src/lib/sip.js/api/session-state.ts +0 -45
  247. package/src/lib/sip.js/api/session.ts +0 -1454
  248. package/src/lib/sip.js/api/subscriber-options.ts +0 -12
  249. package/src/lib/sip.js/api/subscriber-subscribe-options.ts +0 -6
  250. package/src/lib/sip.js/api/subscriber.ts +0 -537
  251. package/src/lib/sip.js/api/subscription-delegate.ts +0 -13
  252. package/src/lib/sip.js/api/subscription-options.ts +0 -8
  253. package/src/lib/sip.js/api/subscription-state.ts +0 -19
  254. package/src/lib/sip.js/api/subscription-subscribe-options.ts +0 -6
  255. package/src/lib/sip.js/api/subscription-unsubscribe-options.ts +0 -6
  256. package/src/lib/sip.js/api/subscription.ts +0 -161
  257. package/src/lib/sip.js/api/transport-state.ts +0 -37
  258. package/src/lib/sip.js/api/transport.ts +0 -169
  259. package/src/lib/sip.js/api/user-agent-delegate.ts +0 -95
  260. package/src/lib/sip.js/api/user-agent-options.ts +0 -322
  261. package/src/lib/sip.js/api/user-agent-state.ts +0 -14
  262. package/src/lib/sip.js/api/user-agent.ts +0 -1013
  263. package/src/lib/sip.js/core/api-extractor.json +0 -350
  264. package/src/lib/sip.js/core/dialogs/dialog-state.ts +0 -35
  265. package/src/lib/sip.js/core/dialogs/dialog.ts +0 -605
  266. package/src/lib/sip.js/core/dialogs/index.ts +0 -4
  267. package/src/lib/sip.js/core/dialogs/session-dialog.ts +0 -997
  268. package/src/lib/sip.js/core/dialogs/subscription-dialog.ts +0 -558
  269. package/src/lib/sip.js/core/exceptions/exception.ts +0 -11
  270. package/src/lib/sip.js/core/exceptions/index.ts +0 -3
  271. package/src/lib/sip.js/core/exceptions/transaction-state-error.ts +0 -11
  272. package/src/lib/sip.js/core/exceptions/transport-error.ts +0 -11
  273. package/src/lib/sip.js/core/index.ts +0 -19
  274. package/src/lib/sip.js/core/log/index.ts +0 -3
  275. package/src/lib/sip.js/core/log/levels.ts +0 -10
  276. package/src/lib/sip.js/core/log/logger-factory.ts +0 -119
  277. package/src/lib/sip.js/core/log/logger.ts +0 -42
  278. package/src/lib/sip.js/core/messages/body.ts +0 -171
  279. package/src/lib/sip.js/core/messages/digest-authentication.ts +0 -190
  280. package/src/lib/sip.js/core/messages/incoming-message.ts +0 -152
  281. package/src/lib/sip.js/core/messages/incoming-request-message.ts +0 -14
  282. package/src/lib/sip.js/core/messages/incoming-request.ts +0 -75
  283. package/src/lib/sip.js/core/messages/incoming-response-message.ts +0 -14
  284. package/src/lib/sip.js/core/messages/incoming-response.ts +0 -13
  285. package/src/lib/sip.js/core/messages/index.ts +0 -18
  286. package/src/lib/sip.js/core/messages/md5.ts +0 -437
  287. package/src/lib/sip.js/core/messages/methods/ack.ts +0 -22
  288. package/src/lib/sip.js/core/messages/methods/bye.ts +0 -22
  289. package/src/lib/sip.js/core/messages/methods/cancel.ts +0 -22
  290. package/src/lib/sip.js/core/messages/methods/constants.ts +0 -21
  291. package/src/lib/sip.js/core/messages/methods/index.ts +0 -13
  292. package/src/lib/sip.js/core/messages/methods/info.ts +0 -22
  293. package/src/lib/sip.js/core/messages/methods/invite.ts +0 -104
  294. package/src/lib/sip.js/core/messages/methods/message.ts +0 -22
  295. package/src/lib/sip.js/core/messages/methods/notify.ts +0 -22
  296. package/src/lib/sip.js/core/messages/methods/prack.ts +0 -22
  297. package/src/lib/sip.js/core/messages/methods/publish.ts +0 -22
  298. package/src/lib/sip.js/core/messages/methods/refer.ts +0 -22
  299. package/src/lib/sip.js/core/messages/methods/register.ts +0 -22
  300. package/src/lib/sip.js/core/messages/methods/subscribe.ts +0 -59
  301. package/src/lib/sip.js/core/messages/outgoing-request-message.ts +0 -299
  302. package/src/lib/sip.js/core/messages/outgoing-request.ts +0 -77
  303. package/src/lib/sip.js/core/messages/outgoing-response.ts +0 -174
  304. package/src/lib/sip.js/core/messages/parser.ts +0 -265
  305. package/src/lib/sip.js/core/messages/utils.ts +0 -144
  306. package/src/lib/sip.js/core/session/index.ts +0 -2
  307. package/src/lib/sip.js/core/session/session-delegate.ts +0 -88
  308. package/src/lib/sip.js/core/session/session.ts +0 -158
  309. package/src/lib/sip.js/core/subscription/index.ts +0 -2
  310. package/src/lib/sip.js/core/subscription/subscription-delegate.ts +0 -30
  311. package/src/lib/sip.js/core/subscription/subscription.ts +0 -61
  312. package/src/lib/sip.js/core/timers.ts +0 -24
  313. package/src/lib/sip.js/core/transactions/client-transaction.ts +0 -78
  314. package/src/lib/sip.js/core/transactions/index.ts +0 -10
  315. package/src/lib/sip.js/core/transactions/invite-client-transaction.ts +0 -505
  316. package/src/lib/sip.js/core/transactions/invite-server-transaction.ts +0 -433
  317. package/src/lib/sip.js/core/transactions/non-invite-client-transaction.ts +0 -258
  318. package/src/lib/sip.js/core/transactions/non-invite-server-transaction.ts +0 -242
  319. package/src/lib/sip.js/core/transactions/server-transaction.ts +0 -47
  320. package/src/lib/sip.js/core/transactions/transaction-state.ts +0 -13
  321. package/src/lib/sip.js/core/transactions/transaction-user.ts +0 -82
  322. package/src/lib/sip.js/core/transactions/transaction.ts +0 -149
  323. package/src/lib/sip.js/core/transport.ts +0 -32
  324. package/src/lib/sip.js/core/user-agent-core/allowed-methods.ts +0 -19
  325. package/src/lib/sip.js/core/user-agent-core/index.ts +0 -3
  326. package/src/lib/sip.js/core/user-agent-core/user-agent-core-configuration.ts +0 -111
  327. package/src/lib/sip.js/core/user-agent-core/user-agent-core-delegate.ts +0 -50
  328. package/src/lib/sip.js/core/user-agent-core/user-agent-core.ts +0 -905
  329. package/src/lib/sip.js/core/user-agents/bye-user-agent-client.ts +0 -16
  330. package/src/lib/sip.js/core/user-agents/bye-user-agent-server.ts +0 -14
  331. package/src/lib/sip.js/core/user-agents/cancel-user-agent-client.ts +0 -14
  332. package/src/lib/sip.js/core/user-agents/index.ts +0 -26
  333. package/src/lib/sip.js/core/user-agents/info-user-agent-client.ts +0 -15
  334. package/src/lib/sip.js/core/user-agents/info-user-agent-server.ts +0 -14
  335. package/src/lib/sip.js/core/user-agents/invite-user-agent-client.ts +0 -406
  336. package/src/lib/sip.js/core/user-agents/invite-user-agent-server.ts +0 -269
  337. package/src/lib/sip.js/core/user-agents/message-user-agent-client.ts +0 -14
  338. package/src/lib/sip.js/core/user-agents/message-user-agent-server.ts +0 -14
  339. package/src/lib/sip.js/core/user-agents/notify-user-agent-client.ts +0 -15
  340. package/src/lib/sip.js/core/user-agents/notify-user-agent-server.ts +0 -30
  341. package/src/lib/sip.js/core/user-agents/prack-user-agent-client.ts +0 -16
  342. package/src/lib/sip.js/core/user-agents/prack-user-agent-server.ts +0 -37
  343. package/src/lib/sip.js/core/user-agents/publish-user-agent-client.ts +0 -14
  344. package/src/lib/sip.js/core/user-agents/re-invite-user-agent-client.ts +0 -128
  345. package/src/lib/sip.js/core/user-agents/re-invite-user-agent-server.ts +0 -109
  346. package/src/lib/sip.js/core/user-agents/re-subscribe-user-agent-client.ts +0 -78
  347. package/src/lib/sip.js/core/user-agents/re-subscribe-user-agent-server.ts +0 -14
  348. package/src/lib/sip.js/core/user-agents/refer-user-agent-client.ts +0 -15
  349. package/src/lib/sip.js/core/user-agents/refer-user-agent-server.ts +0 -30
  350. package/src/lib/sip.js/core/user-agents/register-user-agent-client.ts +0 -14
  351. package/src/lib/sip.js/core/user-agents/register-user-agent-server.ts +0 -14
  352. package/src/lib/sip.js/core/user-agents/subscribe-user-agent-client.ts +0 -342
  353. package/src/lib/sip.js/core/user-agents/subscribe-user-agent-server.ts +0 -14
  354. package/src/lib/sip.js/core/user-agents/user-agent-client.ts +0 -378
  355. package/src/lib/sip.js/core/user-agents/user-agent-server.ts +0 -276
  356. package/src/lib/sip.js/grammar/grammar.ts +0 -55
  357. package/src/lib/sip.js/grammar/index.ts +0 -4
  358. package/src/lib/sip.js/grammar/name-addr-header.ts +0 -58
  359. package/src/lib/sip.js/grammar/parameters.ts +0 -45
  360. package/src/lib/sip.js/grammar/pegjs/README.md +0 -9
  361. package/src/lib/sip.js/grammar/pegjs/dist/grammar.ts +0 -1557
  362. package/src/lib/sip.js/grammar/pegjs/src/grammar.pegjs +0 -1009
  363. package/src/lib/sip.js/grammar/uri.ts +0 -370
  364. package/src/lib/sip.js/index.ts +0 -20
  365. package/src/lib/sip.js/platform/react/README.md +0 -1
  366. package/src/lib/sip.js/platform/web/index.ts +0 -4
  367. package/src/lib/sip.js/platform/web/modifiers/index.ts +0 -5
  368. package/src/lib/sip.js/platform/web/modifiers/modifiers.ts +0 -180
  369. package/src/lib/sip.js/platform/web/session-description-handler/api-extractor.json +0 -350
  370. package/src/lib/sip.js/platform/web/session-description-handler/index.ts +0 -14
  371. package/src/lib/sip.js/platform/web/session-description-handler/media-stream-factory-default.ts +0 -22
  372. package/src/lib/sip.js/platform/web/session-description-handler/media-stream-factory.ts +0 -10
  373. package/src/lib/sip.js/platform/web/session-description-handler/peer-connection-configuration-default.ts +0 -17
  374. package/src/lib/sip.js/platform/web/session-description-handler/peer-connection-delegate.ts +0 -72
  375. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-configuration.ts +0 -17
  376. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-default.ts +0 -45
  377. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-options.ts +0 -10
  378. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory.ts +0 -17
  379. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-options.ts +0 -56
  380. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler.ts +0 -938
  381. package/src/lib/sip.js/platform/web/simple-user/api-extractor.json +0 -350
  382. package/src/lib/sip.js/platform/web/simple-user/index.ts +0 -7
  383. package/src/lib/sip.js/platform/web/simple-user/simple-user-delegate.ts +0 -82
  384. package/src/lib/sip.js/platform/web/simple-user/simple-user-options.ts +0 -102
  385. package/src/lib/sip.js/platform/web/simple-user/simple-user.ts +0 -1099
  386. package/src/lib/sip.js/platform/web/transport/api-extractor.json +0 -350
  387. package/src/lib/sip.js/platform/web/transport/index.ts +0 -6
  388. package/src/lib/sip.js/platform/web/transport/transport-options.ts +0 -34
  389. package/src/lib/sip.js/platform/web/transport/transport.ts +0 -743
  390. package/src/lib/sip.js/version.ts +0 -1
  391. package/src/lib/socket.io.esm.min.js +0 -7
  392. package/src/webrtc/webrtc-method.ts +0 -49
  393. package/src/webrtc/webrtc.ts +0 -350
  394. package/tsconfig.json +0 -21
@@ -1,433 +0,0 @@
1
- // @ts-nocheck
2
- import { TransportError } from '../exceptions'
3
- import { C, IncomingRequestMessage } from '../messages'
4
- import { Timers } from '../timers'
5
- import { Transport } from '../transport'
6
- import { ServerTransaction } from './server-transaction'
7
- import { TransactionState } from './transaction-state'
8
- import { ServerTransactionUser } from './transaction-user'
9
-
10
- /**
11
- * INVITE Server Transaction.
12
- * @remarks
13
- * https://tools.ietf.org/html/rfc3261#section-17.2.1
14
- * @public
15
- */
16
- export class InviteServerTransaction extends ServerTransaction {
17
- private lastFinalResponse: string | undefined
18
- private lastProvisionalResponse: string | undefined
19
- private H: number | undefined
20
- private I: number | undefined
21
- private L: number | undefined
22
-
23
- /**
24
- * FIXME: This should not be here. It should be in the UAS.
25
- *
26
- * If the UAS desires an extended period of time to answer the INVITE,
27
- * it will need to ask for an "extension" in order to prevent proxies
28
- * from canceling the transaction. A proxy has the option of canceling
29
- * a transaction when there is a gap of 3 minutes between responses in a
30
- * transaction. To prevent cancellation, the UAS MUST send a non-100
31
- * provisional response at every minute, to handle the possibility of
32
- * lost provisional responses.
33
- *
34
- * An INVITE transaction can go on for extended durations when the
35
- * user is placed on hold, or when interworking with PSTN systems
36
- * which allow communications to take place without answering the
37
- * call. The latter is common in Interactive Voice Response (IVR)
38
- * systems.
39
- * https://tools.ietf.org/html/rfc3261#section-13.3.1.1
40
- */
41
- private progressExtensionTimer: number | undefined
42
-
43
- /**
44
- * Constructor.
45
- * Upon construction, a "100 Trying" reply will be immediately sent.
46
- * After construction the transaction will be in the "proceeding" state and the transaction
47
- * `id` will equal the branch parameter set in the Via header of the incoming request.
48
- * https://tools.ietf.org/html/rfc3261#section-17.2.1
49
- * @param request - Incoming INVITE request from the transport.
50
- * @param transport - The transport.
51
- * @param user - The transaction user.
52
- */
53
- constructor(request: IncomingRequestMessage, transport: Transport, user: ServerTransactionUser) {
54
- super(request, transport, user, TransactionState.Proceeding, 'sip.transaction.ist')
55
- }
56
-
57
- /**
58
- * Destructor.
59
- */
60
- public dispose(): void {
61
- this.stopProgressExtensionTimer()
62
- if (this.H) {
63
- clearTimeout(this.H)
64
- this.H = undefined
65
- }
66
- if (this.I) {
67
- clearTimeout(this.I)
68
- this.I = undefined
69
- }
70
- if (this.L) {
71
- clearTimeout(this.L)
72
- this.L = undefined
73
- }
74
- super.dispose()
75
- }
76
-
77
- /** Transaction kind. Deprecated. */
78
- get kind(): string {
79
- return 'ist'
80
- }
81
-
82
- /**
83
- * Receive requests from transport matching this transaction.
84
- * @param request - Request matching this transaction.
85
- */
86
- public receiveRequest(request: IncomingRequestMessage): void {
87
- switch (this.state) {
88
- case TransactionState.Proceeding:
89
- // If a request retransmission is received while in the "Proceeding" state, the most
90
- // recent provisional response that was received from the TU MUST be passed to the
91
- // transport layer for retransmission.
92
- // https://tools.ietf.org/html/rfc3261#section-17.2.1
93
- if (request.method === C.INVITE) {
94
- if (this.lastProvisionalResponse) {
95
- this.send(this.lastProvisionalResponse).catch((error: TransportError) => {
96
- this.logTransportError(error, 'Failed to send retransmission of provisional response.')
97
- })
98
- }
99
- return
100
- }
101
- break
102
- case TransactionState.Accepted:
103
- // While in the "Accepted" state, any retransmissions of the INVITE
104
- // received will match this transaction state machine and will be
105
- // absorbed by the machine without changing its state. These
106
- // retransmissions are not passed onto the TU.
107
- // https://tools.ietf.org/html/rfc6026#section-7.1
108
- if (request.method === C.INVITE) {
109
- return
110
- }
111
- break
112
- case TransactionState.Completed:
113
- // Furthermore, while in the "Completed" state, if a request retransmission is
114
- // received, the server SHOULD pass the response to the transport for retransmission.
115
- // https://tools.ietf.org/html/rfc3261#section-17.2.1
116
- if (request.method === C.INVITE) {
117
- if (!this.lastFinalResponse) {
118
- throw new Error('Last final response undefined.')
119
- }
120
- this.send(this.lastFinalResponse).catch((error: TransportError) => {
121
- this.logTransportError(error, 'Failed to send retransmission of final response.')
122
- })
123
- return
124
- }
125
- // If an ACK is received while the server transaction is in the "Completed" state,
126
- // the server transaction MUST transition to the "Confirmed" state.
127
- // https://tools.ietf.org/html/rfc3261#section-17.2.1
128
- if (request.method === C.ACK) {
129
- this.stateTransition(TransactionState.Confirmed)
130
- return
131
- }
132
- break
133
- case TransactionState.Confirmed:
134
- // The purpose of the "Confirmed" state is to absorb any additional ACK messages that arrive,
135
- // triggered from retransmissions of the final response.
136
- // https://tools.ietf.org/html/rfc3261#section-17.2.1
137
- if (request.method === C.INVITE || request.method === C.ACK) {
138
- return
139
- }
140
- break
141
- case TransactionState.Terminated:
142
- // For good measure absorb any additional messages that arrive (should not happen).
143
- if (request.method === C.INVITE || request.method === C.ACK) {
144
- return
145
- }
146
- break
147
- default:
148
- throw new Error(`Invalid state ${this.state}`)
149
- }
150
-
151
- const message = `INVITE server transaction received unexpected ${request.method} request while in state ${this.state}.`
152
- this.logger.warn(message)
153
- return
154
- }
155
-
156
- /**
157
- * Receive responses from TU for this transaction.
158
- * @param statusCode - Status code of response.
159
- * @param response - Response.
160
- */
161
- public receiveResponse(statusCode: number, response: string): void {
162
- if (statusCode < 100 || statusCode > 699) {
163
- throw new Error(`Invalid status code ${statusCode}`)
164
- }
165
-
166
- switch (this.state) {
167
- case TransactionState.Proceeding:
168
- // The TU passes any number of provisional responses to the server
169
- // transaction. So long as the server transaction is in the
170
- // "Proceeding" state, each of these MUST be passed to the transport
171
- // layer for transmission. They are not sent reliably by the
172
- // transaction layer (they are not retransmitted by it) and do not cause
173
- // a change in the state of the server transaction.
174
- // https://tools.ietf.org/html/rfc3261#section-17.2.1
175
- if (statusCode >= 100 && statusCode <= 199) {
176
- this.lastProvisionalResponse = response
177
- // Start the progress extension timer only for a non-100 provisional response.
178
- if (statusCode > 100) {
179
- this.startProgressExtensionTimer() // FIXME: remove
180
- }
181
- this.send(response).catch((error: TransportError) => {
182
- this.logTransportError(error, 'Failed to send 1xx response.')
183
- })
184
- return
185
- }
186
- // If, while in the "Proceeding" state, the TU passes a 2xx response
187
- // to the server transaction, the server transaction MUST pass this
188
- // response to the transport layer for transmission. It is not
189
- // retransmitted by the server transaction; retransmissions of 2xx
190
- // responses are handled by the TU. The server transaction MUST then
191
- // transition to the "Accepted" state.
192
- // https://tools.ietf.org/html/rfc6026#section-8.5
193
- if (statusCode >= 200 && statusCode <= 299) {
194
- this.lastFinalResponse = response
195
- this.stateTransition(TransactionState.Accepted)
196
- this.send(response).catch((error: TransportError) => {
197
- this.logTransportError(error, 'Failed to send 2xx response.')
198
- })
199
- return
200
- }
201
- // While in the "Proceeding" state, if the TU passes a response with
202
- // status code from 300 to 699 to the server transaction, the response
203
- // MUST be passed to the transport layer for transmission, and the state
204
- // machine MUST enter the "Completed" state.
205
- // https://tools.ietf.org/html/rfc3261#section-17.2.1
206
- if (statusCode >= 300 && statusCode <= 699) {
207
- this.lastFinalResponse = response
208
- this.stateTransition(TransactionState.Completed)
209
- this.send(response).catch((error: TransportError) => {
210
- this.logTransportError(error, 'Failed to send non-2xx final response.')
211
- })
212
- return
213
- }
214
- break
215
- case TransactionState.Accepted:
216
- // While in the "Accepted" state, if the TU passes a 2xx response,
217
- // the server transaction MUST pass the response to the transport layer for transmission.
218
- // https://tools.ietf.org/html/rfc6026#section-8.7
219
- if (statusCode >= 200 && statusCode <= 299) {
220
- this.send(response).catch((error: TransportError) => {
221
- this.logTransportError(error, 'Failed to send 2xx response.')
222
- })
223
- return
224
- }
225
- break
226
- case TransactionState.Completed:
227
- break
228
- case TransactionState.Confirmed:
229
- break
230
- case TransactionState.Terminated:
231
- break
232
- default:
233
- throw new Error(`Invalid state ${this.state}`)
234
- }
235
-
236
- const message = `INVITE server transaction received unexpected ${statusCode} response from TU while in state ${this.state}.`
237
- this.logger.error(message)
238
- throw new Error(message)
239
- }
240
-
241
- /**
242
- * Retransmit the last 2xx response. This is a noop if not in the "accepted" state.
243
- */
244
- public retransmitAcceptedResponse(): void {
245
- if (this.state === TransactionState.Accepted && this.lastFinalResponse) {
246
- this.send(this.lastFinalResponse).catch((error: TransportError) => {
247
- this.logTransportError(error, 'Failed to send 2xx response.')
248
- })
249
- }
250
- }
251
-
252
- /**
253
- * First, the procedures in [4] are followed, which attempt to deliver the response to a backup.
254
- * If those should all fail, based on the definition of failure in [4], the server transaction SHOULD
255
- * inform the TU that a failure has occurred, and MUST remain in the current state.
256
- * https://tools.ietf.org/html/rfc6026#section-8.8
257
- */
258
- protected onTransportError(error: Error): void {
259
- if (this.user.onTransportError) {
260
- this.user.onTransportError(error)
261
- }
262
- }
263
-
264
- /** For logging. */
265
- protected typeToString(): string {
266
- return 'INVITE server transaction'
267
- }
268
-
269
- /**
270
- * Execute a state transition.
271
- * @param newState - New state.
272
- */
273
- private stateTransition(newState: TransactionState): void {
274
- // Assert valid state transitions.
275
- const invalidStateTransition = (): void => {
276
- throw new Error(`Invalid state transition from ${this.state} to ${newState}`)
277
- }
278
-
279
- switch (newState) {
280
- case TransactionState.Proceeding:
281
- invalidStateTransition()
282
- break
283
- case TransactionState.Accepted:
284
- case TransactionState.Completed:
285
- if (this.state !== TransactionState.Proceeding) {
286
- invalidStateTransition()
287
- }
288
- break
289
- case TransactionState.Confirmed:
290
- if (this.state !== TransactionState.Completed) {
291
- invalidStateTransition()
292
- }
293
- break
294
- case TransactionState.Terminated:
295
- if (
296
- this.state !== TransactionState.Accepted &&
297
- this.state !== TransactionState.Completed &&
298
- this.state !== TransactionState.Confirmed
299
- ) {
300
- invalidStateTransition()
301
- }
302
- break
303
- default:
304
- invalidStateTransition()
305
- }
306
-
307
- // On any state transition, stop resending provisional responses
308
- this.stopProgressExtensionTimer()
309
-
310
- // The purpose of the "Accepted" state is to absorb retransmissions of an accepted INVITE request.
311
- // Any such retransmissions are absorbed entirely within the server transaction.
312
- // They are not passed up to the TU since any downstream UAS cores that accepted the request have
313
- // taken responsibility for reliability and will already retransmit their 2xx responses if necessary.
314
- // https://tools.ietf.org/html/rfc6026#section-8.7
315
- if (newState === TransactionState.Accepted) {
316
- this.L = setTimeout(() => this.timerL(), Timers.TIMER_L)
317
- }
318
-
319
- // When the "Completed" state is entered, timer H MUST be set to fire in 64*T1 seconds for all transports.
320
- // Timer H determines when the server transaction abandons retransmitting the response.
321
- // If an ACK is received while the server transaction is in the "Completed" state,
322
- // the server transaction MUST transition to the "Confirmed" state.
323
- // https://tools.ietf.org/html/rfc3261#section-17.2.1
324
- if (newState === TransactionState.Completed) {
325
- // FIXME: Missing timer G for unreliable transports.
326
- this.H = setTimeout(() => this.timerH(), Timers.TIMER_H)
327
- }
328
-
329
- // The purpose of the "Confirmed" state is to absorb any additional ACK messages that arrive,
330
- // triggered from retransmissions of the final response. When this state is entered, timer I
331
- // is set to fire in T4 seconds for unreliable transports, and zero seconds for reliable
332
- // transports. Once timer I fires, the server MUST transition to the "Terminated" state.
333
- // https://tools.ietf.org/html/rfc3261#section-17.2.1
334
- if (newState === TransactionState.Confirmed) {
335
- // FIXME: This timer is not getting set correctly for unreliable transports.
336
- this.I = setTimeout(() => this.timerI(), Timers.TIMER_I)
337
- }
338
-
339
- // Once the transaction is in the "Terminated" state, it MUST be destroyed immediately.
340
- // https://tools.ietf.org/html/rfc6026#section-8.7
341
- if (newState === TransactionState.Terminated) {
342
- this.dispose()
343
- }
344
-
345
- // Update state.
346
- this.setState(newState)
347
- }
348
-
349
- /**
350
- * FIXME: UAS Provisional Retransmission Timer. See RFC 3261 Section 13.3.1.1
351
- * This is in the wrong place. This is not a transaction level thing. It's a UAS level thing.
352
- */
353
- private startProgressExtensionTimer(): void {
354
- // Start the progress extension timer only for the first non-100 provisional response.
355
- if (this.progressExtensionTimer === undefined) {
356
- this.progressExtensionTimer = setInterval(() => {
357
- this.logger.debug(`Progress extension timer expired for INVITE server transaction ${this.id}.`)
358
- if (!this.lastProvisionalResponse) {
359
- throw new Error('Last provisional response undefined.')
360
- }
361
- this.send(this.lastProvisionalResponse).catch((error: TransportError) => {
362
- this.logTransportError(error, 'Failed to send retransmission of provisional response.')
363
- })
364
- }, Timers.PROVISIONAL_RESPONSE_INTERVAL)
365
- }
366
- }
367
-
368
- /**
369
- * FIXME: UAS Provisional Retransmission Timer id. See RFC 3261 Section 13.3.1.1
370
- * This is in the wrong place. This is not a transaction level thing. It's a UAS level thing.
371
- */
372
- private stopProgressExtensionTimer(): void {
373
- if (this.progressExtensionTimer !== undefined) {
374
- clearInterval(this.progressExtensionTimer)
375
- this.progressExtensionTimer = undefined
376
- }
377
- }
378
-
379
- /**
380
- * While in the "Proceeding" state, if the TU passes a response with status code
381
- * from 300 to 699 to the server transaction, the response MUST be passed to the
382
- * transport layer for transmission, and the state machine MUST enter the "Completed" state.
383
- * For unreliable transports, timer G is set to fire in T1 seconds, and is not set to fire for
384
- * reliable transports. If timer G fires, the response is passed to the transport layer once
385
- * more for retransmission, and timer G is set to fire in MIN(2*T1, T2) seconds. From then on,
386
- * when timer G fires, the response is passed to the transport again for transmission, and
387
- * timer G is reset with a value that doubles, unless that value exceeds T2, in which case
388
- * it is reset with the value of T2.
389
- * https://tools.ietf.org/html/rfc3261#section-17.2.1
390
- */
391
- private timerG(): void {
392
- // TODO
393
- }
394
-
395
- /**
396
- * If timer H fires while in the "Completed" state, it implies that the ACK was never received.
397
- * In this case, the server transaction MUST transition to the "Terminated" state, and MUST
398
- * indicate to the TU that a transaction failure has occurred.
399
- * https://tools.ietf.org/html/rfc3261#section-17.2.1
400
- */
401
- private timerH(): void {
402
- this.logger.debug(`Timer H expired for INVITE server transaction ${this.id}.`)
403
- if (this.state === TransactionState.Completed) {
404
- this.logger.warn('ACK to negative final response was never received, terminating transaction.')
405
- this.stateTransition(TransactionState.Terminated)
406
- }
407
- }
408
-
409
- /**
410
- * Once timer I fires, the server MUST transition to the "Terminated" state.
411
- * https://tools.ietf.org/html/rfc3261#section-17.2.1
412
- */
413
- private timerI(): void {
414
- this.logger.debug(`Timer I expired for INVITE server transaction ${this.id}.`)
415
- this.stateTransition(TransactionState.Terminated)
416
- }
417
-
418
- /**
419
- * When Timer L fires and the state machine is in the "Accepted" state, the machine MUST
420
- * transition to the "Terminated" state. Once the transaction is in the "Terminated" state,
421
- * it MUST be destroyed immediately. Timer L reflects the amount of time the server
422
- * transaction could receive 2xx responses for retransmission from the
423
- * TU while it is waiting to receive an ACK.
424
- * https://tools.ietf.org/html/rfc6026#section-7.1
425
- * https://tools.ietf.org/html/rfc6026#section-8.7
426
- */
427
- private timerL(): void {
428
- this.logger.debug(`Timer L expired for INVITE server transaction ${this.id}.`)
429
- if (this.state === TransactionState.Accepted) {
430
- this.stateTransition(TransactionState.Terminated)
431
- }
432
- }
433
- }
@@ -1,258 +0,0 @@
1
- // @ts-nocheck
2
- import { TransportError } from '../exceptions'
3
- import { IncomingResponseMessage, OutgoingRequestMessage } from '../messages'
4
- import { Timers } from '../timers'
5
- import { Transport } from '../transport'
6
- import { ClientTransaction } from './client-transaction'
7
- import { TransactionState } from './transaction-state'
8
- import { ClientTransactionUser } from './transaction-user'
9
-
10
- /**
11
- * Non-INVITE Client Transaction.
12
- * @remarks
13
- * Non-INVITE transactions do not make use of ACK.
14
- * They are simple request-response interactions.
15
- * https://tools.ietf.org/html/rfc3261#section-17.1.2
16
- * @public
17
- */
18
- export class NonInviteClientTransaction extends ClientTransaction {
19
- private F: number | undefined
20
- private K: number | undefined
21
-
22
- /**
23
- * Constructor
24
- * Upon construction, the outgoing request's Via header is updated by calling `setViaHeader`.
25
- * Then `toString` is called on the outgoing request and the message is sent via the transport.
26
- * After construction the transaction will be in the "calling" state and the transaction id
27
- * will equal the branch parameter set in the Via header of the outgoing request.
28
- * https://tools.ietf.org/html/rfc3261#section-17.1.2
29
- * @param request - The outgoing Non-INVITE request.
30
- * @param transport - The transport.
31
- * @param user - The transaction user.
32
- */
33
- constructor(request: OutgoingRequestMessage, transport: Transport, user: ClientTransactionUser) {
34
- super(request, transport, user, TransactionState.Trying, 'sip.transaction.nict')
35
- // FIXME: Timer E for unreliable transports not implemented.
36
- //
37
- // The "Trying" state is entered when the TU initiates a new client
38
- // transaction with a request. When entering this state, the client
39
- // transaction SHOULD set timer F to fire in 64*T1 seconds. The request
40
- // MUST be passed to the transport layer for transmission.
41
- // https://tools.ietf.org/html/rfc3261#section-17.1.2.2
42
- this.F = setTimeout(() => this.timerF(), Timers.TIMER_F)
43
- this.send(request.toString()).catch((error: TransportError) => {
44
- this.logTransportError(error, 'Failed to send initial outgoing request.')
45
- })
46
- }
47
-
48
- /**
49
- * Destructor.
50
- */
51
- public dispose(): void {
52
- if (this.F) {
53
- clearTimeout(this.F)
54
- this.F = undefined
55
- }
56
- if (this.K) {
57
- clearTimeout(this.K)
58
- this.K = undefined
59
- }
60
- super.dispose()
61
- }
62
-
63
- /** Transaction kind. Deprecated. */
64
- get kind(): string {
65
- return 'nict'
66
- }
67
-
68
- /**
69
- * Handler for incoming responses from the transport which match this transaction.
70
- * @param response - The incoming response.
71
- */
72
- public receiveResponse(response: IncomingResponseMessage): void {
73
- const statusCode = response.statusCode
74
- if (!statusCode || statusCode < 100 || statusCode > 699) {
75
- throw new Error(`Invalid status code ${statusCode}`)
76
- }
77
-
78
- switch (this.state) {
79
- case TransactionState.Trying:
80
- // If a provisional response is received while in the "Trying" state, the
81
- // response MUST be passed to the TU, and then the client transaction
82
- // SHOULD move to the "Proceeding" state.
83
- // https://tools.ietf.org/html/rfc3261#section-17.1.2.2
84
- if (statusCode >= 100 && statusCode <= 199) {
85
- this.stateTransition(TransactionState.Proceeding)
86
- if (this.user.receiveResponse) {
87
- this.user.receiveResponse(response)
88
- }
89
- return
90
- }
91
- // If a final response (status codes 200-699) is received while in the
92
- // "Trying" state, the response MUST be passed to the TU, and the
93
- // client transaction MUST transition to the "Completed" state.
94
- // https://tools.ietf.org/html/rfc3261#section-17.1.2.2
95
- if (statusCode >= 200 && statusCode <= 699) {
96
- this.stateTransition(TransactionState.Completed)
97
- if (statusCode === 408) {
98
- this.onRequestTimeout()
99
- return
100
- }
101
- if (this.user.receiveResponse) {
102
- this.user.receiveResponse(response)
103
- }
104
- return
105
- }
106
- break
107
- case TransactionState.Proceeding:
108
- // If a provisional response is received while in the "Proceeding" state,
109
- // the response MUST be passed to the TU. (From Figure 6)
110
- // https://tools.ietf.org/html/rfc3261#section-17.1.2.2
111
- if (statusCode >= 100 && statusCode <= 199) {
112
- if (this.user.receiveResponse) {
113
- return this.user.receiveResponse(response)
114
- }
115
- }
116
- // If a final response (status codes 200-699) is received while in the
117
- // "Proceeding" state, the response MUST be passed to the TU, and the
118
- // client transaction MUST transition to the "Completed" state.
119
- // https://tools.ietf.org/html/rfc3261#section-17.1.2.2
120
- if (statusCode >= 200 && statusCode <= 699) {
121
- this.stateTransition(TransactionState.Completed)
122
- if (statusCode === 408) {
123
- this.onRequestTimeout()
124
- return
125
- }
126
- if (this.user.receiveResponse) {
127
- this.user.receiveResponse(response)
128
- }
129
- return
130
- }
131
- break
132
- case TransactionState.Completed:
133
- // The "Completed" state exists to buffer any additional response
134
- // retransmissions that may be received (which is why the client
135
- // transaction remains there only for unreliable transports).
136
- // https://tools.ietf.org/html/rfc3261#section-17.1.2.2
137
- return
138
- case TransactionState.Terminated:
139
- // For good measure just absorb additional response retransmissions.
140
- return
141
- default:
142
- throw new Error(`Invalid state ${this.state}`)
143
- }
144
-
145
- const message = `Non-INVITE client transaction received unexpected ${statusCode} response while in state ${this.state}.`
146
- this.logger.warn(message)
147
- return
148
- }
149
-
150
- /**
151
- * The client transaction SHOULD inform the TU that a transport failure has occurred,
152
- * and the client transaction SHOULD transition directly to the "Terminated" state.
153
- * The TU will handle the fail over mechanisms described in [4].
154
- * https://tools.ietf.org/html/rfc3261#section-17.1.4
155
- * @param error - Transport error
156
- */
157
- protected onTransportError(error: Error): void {
158
- if (this.user.onTransportError) {
159
- this.user.onTransportError(error)
160
- }
161
- this.stateTransition(TransactionState.Terminated, true)
162
- }
163
-
164
- /** For logging. */
165
- protected typeToString(): string {
166
- return 'non-INVITE client transaction'
167
- }
168
-
169
- /**
170
- * Execute a state transition.
171
- * @param newState - New state.
172
- */
173
- private stateTransition(newState: TransactionState, dueToTransportError = false): void {
174
- // Assert valid state transitions.
175
- const invalidStateTransition = (): void => {
176
- throw new Error(`Invalid state transition from ${this.state} to ${newState}`)
177
- }
178
-
179
- switch (newState) {
180
- case TransactionState.Trying:
181
- invalidStateTransition()
182
- break
183
- case TransactionState.Proceeding:
184
- if (this.state !== TransactionState.Trying) {
185
- invalidStateTransition()
186
- }
187
- break
188
- case TransactionState.Completed:
189
- if (this.state !== TransactionState.Trying && this.state !== TransactionState.Proceeding) {
190
- invalidStateTransition()
191
- }
192
- break
193
- case TransactionState.Terminated:
194
- if (
195
- this.state !== TransactionState.Trying &&
196
- this.state !== TransactionState.Proceeding &&
197
- this.state !== TransactionState.Completed
198
- ) {
199
- if (!dueToTransportError) {
200
- invalidStateTransition()
201
- }
202
- }
203
- break
204
- default:
205
- invalidStateTransition()
206
- }
207
-
208
- // Once the client transaction enters the "Completed" state, it MUST set
209
- // Timer K to fire in T4 seconds for unreliable transports, and zero
210
- // seconds for reliable transports The "Completed" state exists to
211
- // buffer any additional response retransmissions that may be received
212
- // (which is why the client transaction remains there only for unreliable transports).
213
- // https://tools.ietf.org/html/rfc3261#section-17.1.2.2
214
- if (newState === TransactionState.Completed) {
215
- if (this.F) {
216
- clearTimeout(this.F)
217
- this.F = undefined
218
- }
219
- this.K = setTimeout(() => this.timerK(), Timers.TIMER_K)
220
- }
221
-
222
- // Once the transaction is in the terminated state, it MUST be destroyed immediately.
223
- // https://tools.ietf.org/html/rfc3261#section-17.1.2.2
224
- if (newState === TransactionState.Terminated) {
225
- this.dispose()
226
- }
227
-
228
- // Update state.
229
- this.setState(newState)
230
- }
231
-
232
- /**
233
- * If Timer F fires while the client transaction is still in the
234
- * "Trying" state, the client transaction SHOULD inform the TU about the
235
- * timeout, and then it SHOULD enter the "Terminated" state.
236
- * If timer F fires while in the "Proceeding" state, the TU MUST be informed of
237
- * a timeout, and the client transaction MUST transition to the terminated state.
238
- * https://tools.ietf.org/html/rfc3261#section-17.1.2.2
239
- */
240
- private timerF(): void {
241
- this.logger.debug(`Timer F expired for non-INVITE client transaction ${this.id}.`)
242
- if (this.state === TransactionState.Trying || this.state === TransactionState.Proceeding) {
243
- this.onRequestTimeout()
244
- this.stateTransition(TransactionState.Terminated)
245
- }
246
- }
247
-
248
- /**
249
- * If Timer K fires while in this (COMPLETED) state, the client transaction
250
- * MUST transition to the "Terminated" state.
251
- * https://tools.ietf.org/html/rfc3261#section-17.1.2.2
252
- */
253
- private timerK(): void {
254
- if (this.state === TransactionState.Completed) {
255
- this.stateTransition(TransactionState.Terminated)
256
- }
257
- }
258
- }