ue-softphone-sdk 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/dist/api/bye.d.ts +16 -0
  2. package/dist/api/dtmf.d.ts +15 -0
  3. package/dist/api/emitter.d.ts +88 -0
  4. package/dist/api/exceptions/content-type-unsupported.d.ts +8 -0
  5. package/dist/api/exceptions/index.d.ts +5 -0
  6. package/dist/api/exceptions/request-pending.d.ts +9 -0
  7. package/dist/api/exceptions/session-description-handler.d.ts +8 -0
  8. package/dist/api/exceptions/session-terminated.d.ts +8 -0
  9. package/dist/api/exceptions/state-transition.d.ts +8 -0
  10. package/dist/api/index.d.ts +58 -0
  11. package/dist/api/info.d.ts +16 -0
  12. package/dist/api/invitation-accept-options.d.ts +19 -0
  13. package/dist/api/invitation-progress-options.d.ts +38 -0
  14. package/dist/api/invitation-reject-options.d.ts +25 -0
  15. package/dist/api/invitation.d.ts +179 -0
  16. package/dist/api/inviter-cancel-options.d.ts +9 -0
  17. package/dist/api/inviter-invite-options.d.ts +28 -0
  18. package/dist/api/inviter-options.d.ts +43 -0
  19. package/dist/api/inviter.d.ts +236 -0
  20. package/dist/api/message.d.ts +16 -0
  21. package/dist/api/messager-message-options.d.ts +11 -0
  22. package/dist/api/messager-options.d.ts +17 -0
  23. package/dist/api/messager.d.ts +26 -0
  24. package/dist/api/notification.d.ts +16 -0
  25. package/dist/api/notifier.d.ts +8 -0
  26. package/dist/api/publisher-options.d.ts +33 -0
  27. package/dist/api/publisher-publish-options.d.ts +6 -0
  28. package/dist/api/publisher-state.d.ts +21 -0
  29. package/dist/api/publisher-unpublish-options.d.ts +6 -0
  30. package/dist/api/publisher.d.ts +65 -0
  31. package/dist/api/referral.d.ts +38 -0
  32. package/dist/api/registerer-options.d.ts +46 -0
  33. package/dist/api/registerer-register-options.d.ts +11 -0
  34. package/dist/api/registerer-state.d.ts +21 -0
  35. package/dist/api/registerer-unregister-options.d.ts +16 -0
  36. package/dist/api/registerer.d.ts +144 -0
  37. package/dist/api/session-bye-options.d.ts +11 -0
  38. package/dist/api/session-delegate.d.ts +73 -0
  39. package/dist/api/session-description-handler-factory.d.ts +15 -0
  40. package/dist/api/session-description-handler.d.ts +74 -0
  41. package/dist/api/session-info-options.d.ts +11 -0
  42. package/dist/api/session-invite-options.d.ts +28 -0
  43. package/dist/api/session-message-options.d.ts +11 -0
  44. package/dist/api/session-options.d.ts +8 -0
  45. package/dist/api/session-refer-options.d.ts +14 -0
  46. package/dist/api/session-state.d.ts +45 -0
  47. package/dist/api/session.d.ts +359 -0
  48. package/dist/api/subscriber-options.d.ts +11 -0
  49. package/dist/api/subscriber-subscribe-options.d.ts +6 -0
  50. package/dist/api/subscriber.d.ts +94 -0
  51. package/dist/api/subscription-delegate.d.ts +12 -0
  52. package/dist/api/subscription-options.d.ts +8 -0
  53. package/dist/api/subscription-state.d.ts +19 -0
  54. package/dist/api/subscription-subscribe-options.d.ts +6 -0
  55. package/dist/api/subscription-unsubscribe-options.d.ts +6 -0
  56. package/dist/api/subscription.d.ts +84 -0
  57. package/dist/api/transport-state.d.ts +37 -0
  58. package/dist/api/transport.d.ts +159 -0
  59. package/dist/api/user-agent-delegate.d.ts +84 -0
  60. package/dist/api/user-agent-options.d.ts +253 -0
  61. package/dist/api/user-agent-state.d.ts +14 -0
  62. package/dist/api/user-agent.d.ts +200 -0
  63. package/dist/core/dialogs/dialog-state.d.ts +34 -0
  64. package/dist/core/dialogs/dialog.d.ts +161 -0
  65. package/dist/core/dialogs/index.d.ts +4 -0
  66. package/dist/core/dialogs/session-dialog.d.ts +196 -0
  67. package/dist/core/dialogs/subscription-dialog.d.ts +120 -0
  68. package/dist/core/exceptions/exception.d.ts +8 -0
  69. package/dist/core/exceptions/index.d.ts +3 -0
  70. package/dist/core/exceptions/transaction-state-error.d.ts +8 -0
  71. package/dist/core/exceptions/transport-error.d.ts +8 -0
  72. package/dist/core/index.d.ts +15 -0
  73. package/dist/core/log/index.d.ts +3 -0
  74. package/dist/core/log/levels.d.ts +10 -0
  75. package/dist/core/log/logger-factory.d.ts +21 -0
  76. package/dist/core/log/logger.d.ts +19 -0
  77. package/dist/core/messages/body.d.ts +64 -0
  78. package/dist/core/messages/digest-authentication.d.ts +51 -0
  79. package/dist/core/messages/incoming-message.d.ts +79 -0
  80. package/dist/core/messages/incoming-request-message.d.ts +10 -0
  81. package/dist/core/messages/incoming-request.d.ts +67 -0
  82. package/dist/core/messages/incoming-response-message.d.ts +10 -0
  83. package/dist/core/messages/incoming-response.d.ts +12 -0
  84. package/dist/core/messages/index.d.ts +13 -0
  85. package/dist/core/messages/md5.d.ts +32 -0
  86. package/dist/core/messages/methods/ack.d.ts +18 -0
  87. package/dist/core/messages/methods/bye.d.ts +21 -0
  88. package/dist/core/messages/methods/cancel.d.ts +21 -0
  89. package/dist/core/messages/methods/constants.d.ts +20 -0
  90. package/dist/core/messages/methods/index.d.ts +13 -0
  91. package/dist/core/messages/methods/info.d.ts +21 -0
  92. package/dist/core/messages/methods/invite.d.ts +86 -0
  93. package/dist/core/messages/methods/message.d.ts +21 -0
  94. package/dist/core/messages/methods/notify.d.ts +21 -0
  95. package/dist/core/messages/methods/prack.d.ts +21 -0
  96. package/dist/core/messages/methods/publish.d.ts +21 -0
  97. package/dist/core/messages/methods/refer.d.ts +21 -0
  98. package/dist/core/messages/methods/register.d.ts +21 -0
  99. package/dist/core/messages/methods/subscribe.d.ts +54 -0
  100. package/dist/core/messages/outgoing-request-message.d.ts +94 -0
  101. package/dist/core/messages/outgoing-request.d.ts +67 -0
  102. package/dist/core/messages/outgoing-response.d.ts +42 -0
  103. package/dist/core/messages/parser.d.ts +14 -0
  104. package/dist/core/messages/utils.d.ts +24 -0
  105. package/dist/core/session/index.d.ts +2 -0
  106. package/dist/core/session/session-delegate.d.ts +70 -0
  107. package/dist/core/session/session.d.ts +134 -0
  108. package/dist/core/subscription/index.d.ts +2 -0
  109. package/dist/core/subscription/subscription-delegate.d.ts +27 -0
  110. package/dist/core/subscription/subscription.d.ts +55 -0
  111. package/dist/core/timers.d.ts +20 -0
  112. package/dist/core/transactions/client-transaction.d.ts +45 -0
  113. package/dist/core/transactions/index.d.ts +10 -0
  114. package/dist/core/transactions/invite-client-transaction.d.ts +116 -0
  115. package/dist/core/transactions/invite-server-transaction.d.ts +127 -0
  116. package/dist/core/transactions/non-invite-client-transaction.d.ts +69 -0
  117. package/dist/core/transactions/non-invite-server-transaction.d.ts +57 -0
  118. package/dist/core/transactions/server-transaction.d.ts +35 -0
  119. package/dist/core/transactions/transaction-state.d.ts +13 -0
  120. package/dist/core/transactions/transaction-user.d.ts +72 -0
  121. package/dist/core/transactions/transaction.d.ts +79 -0
  122. package/dist/core/transport.d.ts +31 -0
  123. package/dist/core/user-agent-core/allowed-methods.d.ts +4 -0
  124. package/dist/core/user-agent-core/index.d.ts +3 -0
  125. package/dist/core/user-agent-core/user-agent-core-configuration.d.ts +99 -0
  126. package/dist/core/user-agent-core/user-agent-core-delegate.d.ts +37 -0
  127. package/dist/core/user-agent-core/user-agent-core.d.ts +179 -0
  128. package/dist/core/user-agents/bye-user-agent-client.d.ts +10 -0
  129. package/dist/core/user-agents/bye-user-agent-server.d.ts +10 -0
  130. package/dist/core/user-agents/cancel-user-agent-client.d.ts +10 -0
  131. package/dist/core/user-agents/index.d.ts +26 -0
  132. package/dist/core/user-agents/info-user-agent-client.d.ts +10 -0
  133. package/dist/core/user-agents/info-user-agent-server.d.ts +10 -0
  134. package/dist/core/user-agents/invite-user-agent-client.d.ts +35 -0
  135. package/dist/core/user-agents/invite-user-agent-server.d.ts +77 -0
  136. package/dist/core/user-agents/message-user-agent-client.d.ts +10 -0
  137. package/dist/core/user-agents/message-user-agent-server.d.ts +10 -0
  138. package/dist/core/user-agents/notify-user-agent-client.d.ts +10 -0
  139. package/dist/core/user-agents/notify-user-agent-server.d.ts +16 -0
  140. package/dist/core/user-agents/prack-user-agent-client.d.ts +10 -0
  141. package/dist/core/user-agents/prack-user-agent-server.d.ts +16 -0
  142. package/dist/core/user-agents/publish-user-agent-client.d.ts +10 -0
  143. package/dist/core/user-agents/re-invite-user-agent-client.d.ts +18 -0
  144. package/dist/core/user-agents/re-invite-user-agent-server.d.ts +41 -0
  145. package/dist/core/user-agents/re-subscribe-user-agent-client.d.ts +17 -0
  146. package/dist/core/user-agents/re-subscribe-user-agent-server.d.ts +10 -0
  147. package/dist/core/user-agents/refer-user-agent-client.d.ts +10 -0
  148. package/dist/core/user-agents/refer-user-agent-server.d.ts +16 -0
  149. package/dist/core/user-agents/register-user-agent-client.d.ts +10 -0
  150. package/dist/core/user-agents/register-user-agent-server.d.ts +11 -0
  151. package/dist/core/user-agents/subscribe-user-agent-client.d.ts +65 -0
  152. package/dist/core/user-agents/subscribe-user-agent-server.d.ts +11 -0
  153. package/dist/core/user-agents/user-agent-client.d.ts +103 -0
  154. package/dist/core/user-agents/user-agent-server.d.ts +79 -0
  155. package/dist/grammar/grammar.d.ts +26 -0
  156. package/dist/grammar/index.d.ts +4 -0
  157. package/dist/grammar/name-addr-header.d.ts +24 -0
  158. package/dist/grammar/parameters.d.ts +16 -0
  159. package/dist/grammar/pegjs/dist/grammar.d.ts +50 -0
  160. package/dist/grammar/uri.d.ts +62 -0
  161. package/dist/{types/index.d.ts → index.d.ts} +7 -3
  162. package/dist/main.d.ts +9 -0
  163. package/dist/new-index.d.ts +199 -0
  164. package/dist/platform/web/index.d.ts +4 -0
  165. package/dist/platform/web/modifiers/index.d.ts +5 -0
  166. package/dist/platform/web/modifiers/modifiers.d.ts +41 -0
  167. package/dist/platform/web/session-description-handler/index.d.ts +14 -0
  168. package/dist/platform/web/session-description-handler/media-stream-factory-default.d.ts +6 -0
  169. package/dist/platform/web/session-description-handler/media-stream-factory.d.ts +6 -0
  170. package/dist/platform/web/session-description-handler/peer-connection-configuration-default.d.ts +5 -0
  171. package/dist/platform/web/session-description-handler/peer-connection-delegate.d.ts +63 -0
  172. package/dist/platform/web/session-description-handler/session-description-handler-configuration.d.ts +16 -0
  173. package/dist/platform/web/session-description-handler/session-description-handler-factory-default.d.ts +11 -0
  174. package/dist/platform/web/session-description-handler/session-description-handler-factory-options.d.ts +9 -0
  175. package/dist/platform/web/session-description-handler/session-description-handler-factory.d.ts +16 -0
  176. package/dist/platform/web/session-description-handler/session-description-handler-options.d.ts +47 -0
  177. package/dist/platform/web/session-description-handler/session-description-handler.d.ts +212 -0
  178. package/dist/platform/web/simple-user/index.d.ts +7 -0
  179. package/dist/platform/web/simple-user/simple-user-delegate.d.ts +72 -0
  180. package/dist/platform/web/simple-user/simple-user-options.d.ts +90 -0
  181. package/dist/platform/web/simple-user/simple-user.d.ts +226 -0
  182. package/dist/platform/web/transport/index.d.ts +6 -0
  183. package/dist/platform/web/transport/transport-options.d.ts +30 -0
  184. package/dist/platform/web/transport/transport.d.ts +125 -0
  185. package/dist/ue-softphone-sdk.js +2 -1
  186. package/dist/ue-softphone-sdk.js.map +1 -0
  187. package/dist/version.d.ts +1 -0
  188. package/dist/webPhoneSdk.d.ts +24 -0
  189. package/dist/webrtc.d.ts +17 -0
  190. package/{rollup-new.config.mjs → new-rollup.config.mjs} +1 -1
  191. package/package.json +6 -6
  192. package/rollup.config.js +15 -14
  193. package/src/api/api-extractor.json +358 -0
  194. package/src/api/bye.ts +27 -0
  195. package/src/api/dtmf.ts +27 -0
  196. package/src/api/emitter.ts +110 -0
  197. package/src/api/exceptions/content-type-unsupported.ts +11 -0
  198. package/src/api/exceptions/index.ts +5 -0
  199. package/src/api/exceptions/request-pending.ts +12 -0
  200. package/src/api/exceptions/session-description-handler.ts +11 -0
  201. package/src/api/exceptions/session-terminated.ts +11 -0
  202. package/src/api/exceptions/state-transition.ts +11 -0
  203. package/src/api/index.ts +58 -0
  204. package/src/api/info.ts +27 -0
  205. package/src/api/invitation-accept-options.ts +20 -0
  206. package/src/api/invitation-progress-options.ts +36 -0
  207. package/src/api/invitation-reject-options.ts +22 -0
  208. package/src/api/invitation.ts +816 -0
  209. package/src/api/inviter-cancel-options.ts +9 -0
  210. package/src/api/inviter-invite-options.ts +29 -0
  211. package/src/api/inviter-options.ts +44 -0
  212. package/src/api/inviter.ts +1126 -0
  213. package/src/api/message.ts +27 -0
  214. package/src/api/messager-message-options.ts +12 -0
  215. package/src/api/messager-options.ts +18 -0
  216. package/src/api/messager.ts +89 -0
  217. package/src/api/notification.ts +27 -0
  218. package/src/api/notifier.ts +7 -0
  219. package/src/api/publisher-options.ts +34 -0
  220. package/src/api/publisher-publish-options.ts +6 -0
  221. package/src/api/publisher-state.ts +21 -0
  222. package/src/api/publisher-unpublish-options.ts +6 -0
  223. package/src/api/publisher.ts +418 -0
  224. package/src/api/referral.ts +89 -0
  225. package/src/api/registerer-options.ts +55 -0
  226. package/src/api/registerer-register-options.ts +12 -0
  227. package/src/api/registerer-state.ts +21 -0
  228. package/src/api/registerer-unregister-options.ts +17 -0
  229. package/src/api/registerer.ts +814 -0
  230. package/src/api/session-bye-options.ts +12 -0
  231. package/src/api/session-delegate.ts +80 -0
  232. package/src/api/session-description-handler-factory.ts +16 -0
  233. package/src/api/session-description-handler.ts +89 -0
  234. package/src/api/session-info-options.ts +12 -0
  235. package/src/api/session-invite-options.ts +29 -0
  236. package/src/api/session-message-options.ts +12 -0
  237. package/src/api/session-options.ts +8 -0
  238. package/src/api/session-refer-options.ts +15 -0
  239. package/src/api/session-state.ts +45 -0
  240. package/src/api/session.ts +1448 -0
  241. package/src/api/subscriber-options.ts +12 -0
  242. package/src/api/subscriber-subscribe-options.ts +6 -0
  243. package/src/api/subscriber.ts +536 -0
  244. package/src/api/subscription-delegate.ts +13 -0
  245. package/src/api/subscription-options.ts +8 -0
  246. package/src/api/subscription-state.ts +19 -0
  247. package/src/api/subscription-subscribe-options.ts +6 -0
  248. package/src/api/subscription-unsubscribe-options.ts +6 -0
  249. package/src/api/subscription.ts +161 -0
  250. package/src/api/transport-state.ts +37 -0
  251. package/src/api/transport.ts +169 -0
  252. package/src/api/user-agent-delegate.ts +95 -0
  253. package/src/api/user-agent-options.ts +322 -0
  254. package/src/api/user-agent-state.ts +14 -0
  255. package/src/api/user-agent.ts +1014 -0
  256. package/src/core/api-extractor.json +358 -0
  257. package/src/core/dialogs/dialog-state.ts +35 -0
  258. package/src/core/dialogs/dialog.ts +605 -0
  259. package/src/core/dialogs/index.ts +4 -0
  260. package/src/core/dialogs/session-dialog.ts +996 -0
  261. package/src/core/dialogs/subscription-dialog.ts +557 -0
  262. package/src/core/exceptions/exception.ts +11 -0
  263. package/src/core/exceptions/index.ts +3 -0
  264. package/src/core/exceptions/transaction-state-error.ts +11 -0
  265. package/src/core/exceptions/transport-error.ts +11 -0
  266. package/src/core/index.ts +19 -0
  267. package/src/core/log/index.ts +3 -0
  268. package/src/core/log/levels.ts +10 -0
  269. package/src/core/log/logger-factory.ts +119 -0
  270. package/src/core/log/logger.ts +42 -0
  271. package/src/core/messages/body.ts +171 -0
  272. package/src/core/messages/digest-authentication.ts +190 -0
  273. package/src/core/messages/incoming-message.ts +152 -0
  274. package/src/core/messages/incoming-request-message.ts +14 -0
  275. package/src/core/messages/incoming-request.ts +75 -0
  276. package/src/core/messages/incoming-response-message.ts +14 -0
  277. package/src/core/messages/incoming-response.ts +13 -0
  278. package/src/core/messages/index.ts +18 -0
  279. package/src/core/messages/md5.ts +437 -0
  280. package/src/core/messages/methods/ack.ts +22 -0
  281. package/src/core/messages/methods/bye.ts +22 -0
  282. package/src/core/messages/methods/cancel.ts +22 -0
  283. package/src/core/messages/methods/constants.ts +21 -0
  284. package/src/core/messages/methods/index.ts +13 -0
  285. package/src/core/messages/methods/info.ts +22 -0
  286. package/src/core/messages/methods/invite.ts +104 -0
  287. package/src/core/messages/methods/message.ts +22 -0
  288. package/src/core/messages/methods/notify.ts +22 -0
  289. package/src/core/messages/methods/prack.ts +22 -0
  290. package/src/core/messages/methods/publish.ts +22 -0
  291. package/src/core/messages/methods/refer.ts +22 -0
  292. package/src/core/messages/methods/register.ts +22 -0
  293. package/src/core/messages/methods/subscribe.ts +59 -0
  294. package/src/core/messages/outgoing-request-message.ts +299 -0
  295. package/src/core/messages/outgoing-request.ts +77 -0
  296. package/src/core/messages/outgoing-response.ts +174 -0
  297. package/src/core/messages/parser.ts +265 -0
  298. package/src/core/messages/utils.ts +144 -0
  299. package/src/core/session/index.ts +2 -0
  300. package/src/core/session/session-delegate.ts +88 -0
  301. package/src/core/session/session.ts +158 -0
  302. package/src/core/subscription/index.ts +2 -0
  303. package/src/core/subscription/subscription-delegate.ts +30 -0
  304. package/src/core/subscription/subscription.ts +61 -0
  305. package/src/core/timers.ts +24 -0
  306. package/src/core/transactions/client-transaction.ts +78 -0
  307. package/src/core/transactions/index.ts +10 -0
  308. package/src/core/transactions/invite-client-transaction.ts +504 -0
  309. package/src/core/transactions/invite-server-transaction.ts +432 -0
  310. package/src/core/transactions/non-invite-client-transaction.ts +257 -0
  311. package/src/core/transactions/non-invite-server-transaction.ts +241 -0
  312. package/src/core/transactions/server-transaction.ts +47 -0
  313. package/src/core/transactions/transaction-state.ts +13 -0
  314. package/src/core/transactions/transaction-user.ts +82 -0
  315. package/src/core/transactions/transaction.ts +149 -0
  316. package/src/core/transport.ts +32 -0
  317. package/src/core/user-agent-core/allowed-methods.ts +19 -0
  318. package/src/core/user-agent-core/index.ts +3 -0
  319. package/src/core/user-agent-core/user-agent-core-configuration.ts +111 -0
  320. package/src/core/user-agent-core/user-agent-core-delegate.ts +50 -0
  321. package/src/core/user-agent-core/user-agent-core.ts +905 -0
  322. package/src/core/user-agents/bye-user-agent-client.ts +16 -0
  323. package/src/core/user-agents/bye-user-agent-server.ts +14 -0
  324. package/src/core/user-agents/cancel-user-agent-client.ts +14 -0
  325. package/src/core/user-agents/index.ts +26 -0
  326. package/src/core/user-agents/info-user-agent-client.ts +15 -0
  327. package/src/core/user-agents/info-user-agent-server.ts +14 -0
  328. package/src/core/user-agents/invite-user-agent-client.ts +405 -0
  329. package/src/core/user-agents/invite-user-agent-server.ts +269 -0
  330. package/src/core/user-agents/message-user-agent-client.ts +14 -0
  331. package/src/core/user-agents/message-user-agent-server.ts +14 -0
  332. package/src/core/user-agents/notify-user-agent-client.ts +15 -0
  333. package/src/core/user-agents/notify-user-agent-server.ts +30 -0
  334. package/src/core/user-agents/prack-user-agent-client.ts +16 -0
  335. package/src/core/user-agents/prack-user-agent-server.ts +37 -0
  336. package/src/core/user-agents/publish-user-agent-client.ts +14 -0
  337. package/src/core/user-agents/re-invite-user-agent-client.ts +127 -0
  338. package/src/core/user-agents/re-invite-user-agent-server.ts +109 -0
  339. package/src/core/user-agents/re-subscribe-user-agent-client.ts +78 -0
  340. package/src/core/user-agents/re-subscribe-user-agent-server.ts +14 -0
  341. package/src/core/user-agents/refer-user-agent-client.ts +15 -0
  342. package/src/core/user-agents/refer-user-agent-server.ts +30 -0
  343. package/src/core/user-agents/register-user-agent-client.ts +14 -0
  344. package/src/core/user-agents/register-user-agent-server.ts +14 -0
  345. package/src/core/user-agents/subscribe-user-agent-client.ts +341 -0
  346. package/src/core/user-agents/subscribe-user-agent-server.ts +14 -0
  347. package/src/core/user-agents/user-agent-client.ts +378 -0
  348. package/src/core/user-agents/user-agent-server.ts +276 -0
  349. package/src/grammar/grammar.ts +55 -0
  350. package/src/grammar/index.ts +4 -0
  351. package/src/grammar/name-addr-header.ts +58 -0
  352. package/src/grammar/parameters.ts +45 -0
  353. package/src/grammar/pegjs/README.md +9 -0
  354. package/src/grammar/pegjs/dist/grammar.ts +1557 -0
  355. package/src/grammar/pegjs/src/grammar.pegjs +1009 -0
  356. package/src/grammar/uri.ts +370 -0
  357. package/src/index.ts +49 -26
  358. package/src/lib/socket.io.esm.min.js +7 -0
  359. package/src/main.ts +26 -0
  360. package/src/new-index.ts +2478 -0
  361. package/src/platform/react/README.md +1 -0
  362. package/src/platform/web/index.ts +4 -0
  363. package/src/platform/web/modifiers/index.ts +5 -0
  364. package/src/platform/web/modifiers/modifiers.ts +180 -0
  365. package/src/platform/web/session-description-handler/api-extractor.json +358 -0
  366. package/src/platform/web/session-description-handler/index.ts +14 -0
  367. package/src/platform/web/session-description-handler/media-stream-factory-default.ts +22 -0
  368. package/src/platform/web/session-description-handler/media-stream-factory.ts +10 -0
  369. package/src/platform/web/session-description-handler/peer-connection-configuration-default.ts +17 -0
  370. package/src/platform/web/session-description-handler/peer-connection-delegate.ts +72 -0
  371. package/src/platform/web/session-description-handler/session-description-handler-configuration.ts +17 -0
  372. package/src/platform/web/session-description-handler/session-description-handler-factory-default.ts +45 -0
  373. package/src/platform/web/session-description-handler/session-description-handler-factory-options.ts +10 -0
  374. package/src/platform/web/session-description-handler/session-description-handler-factory.ts +17 -0
  375. package/src/platform/web/session-description-handler/session-description-handler-options.ts +56 -0
  376. package/src/platform/web/session-description-handler/session-description-handler.ts +938 -0
  377. package/src/platform/web/simple-user/api-extractor.json +358 -0
  378. package/src/platform/web/simple-user/index.ts +7 -0
  379. package/src/platform/web/simple-user/simple-user-delegate.ts +82 -0
  380. package/src/platform/web/simple-user/simple-user-options.ts +102 -0
  381. package/src/platform/web/simple-user/simple-user.ts +1099 -0
  382. package/src/platform/web/transport/api-extractor.json +358 -0
  383. package/src/platform/web/transport/index.ts +6 -0
  384. package/src/platform/web/transport/transport-options.ts +34 -0
  385. package/src/platform/web/transport/transport.ts +742 -0
  386. package/src/version.ts +8 -0
  387. package/src/webPhoneSdk.ts +67 -0
  388. package/src/webrtc.ts +318 -0
  389. package/tsconfig.json +26 -10
  390. /package/dist/{types/config.d.ts → config.d.ts} +0 -0
@@ -0,0 +1,134 @@
1
+ import { Body, OutgoingByeRequest, OutgoingInfoRequest, OutgoingInviteRequest, OutgoingInviteRequestDelegate, OutgoingMessageRequest, OutgoingNotifyRequest, OutgoingPrackRequest, OutgoingReferRequest, OutgoingRequestDelegate, RequestOptions, URI } from "../messages";
2
+ import { SessionDelegate } from "./session-delegate";
3
+ /**
4
+ * Session.
5
+ * @remarks
6
+ * https://tools.ietf.org/html/rfc3261#section-13
7
+ * @public
8
+ */
9
+ export interface Session {
10
+ /** Session delegate. */
11
+ delegate: SessionDelegate | undefined;
12
+ /** The session id. Equal to callId + localTag + remoteTag. */
13
+ readonly id: string;
14
+ /** Call Id. */
15
+ readonly callId: string;
16
+ /** Local Tag. */
17
+ readonly localTag: string;
18
+ /** Local URI. */
19
+ readonly localURI: URI;
20
+ /** Remote Tag. */
21
+ readonly remoteTag: string;
22
+ /** Remote Target. */
23
+ readonly remoteTarget: URI;
24
+ /** Remote URI. */
25
+ readonly remoteURI: URI;
26
+ /** Session state. */
27
+ readonly sessionState: SessionState;
28
+ /** Current state of the offer/answer exchange. */
29
+ readonly signalingState: SignalingState;
30
+ /** The current answer if signalingState is stable. Otherwise undefined. */
31
+ readonly answer: Body | undefined;
32
+ /** The current offer if signalingState is not initial or closed. Otherwise undefined. */
33
+ readonly offer: Body | undefined;
34
+ /**
35
+ * Destroy session.
36
+ */
37
+ dispose(): void;
38
+ /**
39
+ * Send a BYE request.
40
+ * Terminating a session.
41
+ * https://tools.ietf.org/html/rfc3261#section-15
42
+ * @param delegate - Request delegate.
43
+ * @param options - Options bucket.
44
+ */
45
+ bye(delegate?: OutgoingRequestDelegate, options?: RequestOptions): OutgoingByeRequest;
46
+ /**
47
+ * Send an INFO request.
48
+ * Exchange information during a session.
49
+ * https://tools.ietf.org/html/rfc6086#section-4.2.1
50
+ * @param delegate - Request delegate.
51
+ * @param options - Options bucket.
52
+ */
53
+ info(delegate?: OutgoingRequestDelegate, options?: RequestOptions): OutgoingInfoRequest;
54
+ /**
55
+ * Send re-INVITE request.
56
+ * Modifying a session.
57
+ * https://tools.ietf.org/html/rfc3261#section-14.1
58
+ * @param delegate - Request delegate.
59
+ * @param options - Options bucket.
60
+ */
61
+ invite(delegate?: OutgoingInviteRequestDelegate, options?: RequestOptions): OutgoingInviteRequest;
62
+ /**
63
+ * Send MESSAGE request.
64
+ * Deliver a message during a session.
65
+ * https://tools.ietf.org/html/rfc3428#section-4
66
+ * @param delegate - Request delegate.
67
+ * @param options - Options bucket.
68
+ */
69
+ message(delegate?: OutgoingRequestDelegate, options?: RequestOptions): OutgoingMessageRequest;
70
+ /**
71
+ * Send NOTIFY request.
72
+ * Inform referrer of transfer progress.
73
+ * The use of this is limited to the implicit creation of subscription by REFER (historical).
74
+ * Otherwise, notifiers MUST NOT create subscriptions except upon receipt of a SUBSCRIBE request.
75
+ * https://tools.ietf.org/html/rfc3515#section-3.7
76
+ * @param delegate - Request delegate.
77
+ * @param options - Options bucket.
78
+ */
79
+ notify(delegate?: OutgoingRequestDelegate, options?: RequestOptions): OutgoingNotifyRequest;
80
+ /**
81
+ * Send PRACK request.
82
+ * Acknowledge a reliable provisional response.
83
+ * https://tools.ietf.org/html/rfc3262#section-4
84
+ * @param delegate - Request delegate.
85
+ * @param options - Options bucket.
86
+ */
87
+ prack(delegate?: OutgoingRequestDelegate, options?: RequestOptions): OutgoingPrackRequest;
88
+ /**
89
+ * Send REFER request.
90
+ * Transfer a session.
91
+ * https://tools.ietf.org/html/rfc3515#section-2.4.1
92
+ * @param delegate - Request delegate.
93
+ * @param options - Options bucket.
94
+ */
95
+ refer(delegate?: OutgoingRequestDelegate, options?: RequestOptions): OutgoingReferRequest;
96
+ }
97
+ /**
98
+ * Session state.
99
+ * @remarks
100
+ * https://tools.ietf.org/html/rfc3261#section-13
101
+ * @public
102
+ */
103
+ export declare enum SessionState {
104
+ Initial = "Initial",
105
+ Early = "Early",
106
+ AckWait = "AckWait",
107
+ Confirmed = "Confirmed",
108
+ Terminated = "Terminated"
109
+ }
110
+ /**
111
+ * Offer/Answer state.
112
+ * @remarks
113
+ * ```txt
114
+ * Offer Answer RFC Ini Est Early
115
+ * -------------------------------------------------------------------
116
+ * 1. INVITE Req. 2xx INVITE Resp. RFC 3261 Y Y N
117
+ * 2. 2xx INVITE Resp. ACK Req. RFC 3261 Y Y N
118
+ * 3. INVITE Req. 1xx-rel INVITE Resp. RFC 3262 Y Y N
119
+ * 4. 1xx-rel INVITE Resp. PRACK Req. RFC 3262 Y Y N
120
+ * 5. PRACK Req. 200 PRACK Resp. RFC 3262 N Y Y
121
+ * 6. UPDATE Req. 2xx UPDATE Resp. RFC 3311 N Y Y
122
+ *
123
+ * Table 1: Summary of SIP Usage of the Offer/Answer Model
124
+ * ```
125
+ * https://tools.ietf.org/html/rfc6337#section-2.2
126
+ * @public
127
+ */
128
+ export declare enum SignalingState {
129
+ Initial = "Initial",
130
+ HaveLocalOffer = "HaveLocalOffer",
131
+ HaveRemoteOffer = "HaveRemoteOffer",
132
+ Stable = "Stable",
133
+ Closed = "Closed"
134
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./subscription";
2
+ export * from "./subscription-delegate";
@@ -0,0 +1,27 @@
1
+ import { IncomingNotifyRequest, OutgoingSubscribeRequest } from "../messages";
2
+ /**
3
+ * Subscription delegate.
4
+ * @public
5
+ */
6
+ export interface SubscriptionDelegate {
7
+ /**
8
+ * Receive NOTIFY request. This includes in dialog NOTIFY requests only.
9
+ * Thus the first NOTIFY (the subscription creating NOTIFY) will not be provided.
10
+ * https://tools.ietf.org/html/rfc6665#section-4.1.3
11
+ * @param request - Incoming NOTIFY request.
12
+ */
13
+ onNotify?(request: IncomingNotifyRequest): void;
14
+ /**
15
+ * Sent a SUBSCRIBE request. This includes "auto refresh" in dialog SUBSCRIBE requests only.
16
+ * Thus SUBSCRIBE requests triggered by calls to `refresh()` or `subscribe()` will not be provided.
17
+ * Thus the first SUBSCRIBE (the subscription creating SUBSCRIBE) will not be provided.
18
+ * @param request - Outgoing SUBSCRIBE request.
19
+ */
20
+ onRefresh?(request: OutgoingSubscribeRequest): void;
21
+ /**
22
+ * Subscription termination. This includes non-NOTIFY termination causes only.
23
+ * Thus this will not be called if a NOTIFY is the cause of termination.
24
+ * https://tools.ietf.org/html/rfc6665#section-4.4.1
25
+ */
26
+ onTerminated?(): void;
27
+ }
@@ -0,0 +1,55 @@
1
+ import { OutgoingSubscribeRequest, OutgoingSubscribeRequestDelegate, RequestOptions } from "../messages";
2
+ import { SubscriptionDelegate } from "./subscription-delegate";
3
+ /**
4
+ * Subscription.
5
+ * @remarks
6
+ * https://tools.ietf.org/html/rfc6665
7
+ * @public
8
+ */
9
+ export interface Subscription {
10
+ /** Subscription delegate. */
11
+ delegate: SubscriptionDelegate | undefined;
12
+ /** The subscription id. */
13
+ readonly id: string;
14
+ /** Subscription expires. Number of seconds until the subscription expires. */
15
+ readonly subscriptionExpires: number;
16
+ /** Subscription state. */
17
+ readonly subscriptionState: SubscriptionState;
18
+ /** If true, refresh subscription prior to expiration. Default is false. */
19
+ autoRefresh: boolean;
20
+ /**
21
+ * Destroy subscription.
22
+ */
23
+ dispose(): void;
24
+ /**
25
+ * Send re-SUBSCRIBE request.
26
+ * Refreshing a subscription and unsubscribing.
27
+ * https://tools.ietf.org/html/rfc6665#section-4.1.2.2
28
+ * @param delegate - Request delegate.
29
+ * @param options - Options bucket
30
+ */
31
+ subscribe(delegate?: OutgoingSubscribeRequestDelegate, options?: RequestOptions): OutgoingSubscribeRequest;
32
+ /**
33
+ * 4.1.2.2. Refreshing of Subscriptions
34
+ * https://tools.ietf.org/html/rfc6665#section-4.1.2.2
35
+ */
36
+ refresh(): OutgoingSubscribeRequest;
37
+ /**
38
+ * 4.1.2.3. Unsubscribing
39
+ * https://tools.ietf.org/html/rfc6665#section-4.1.2.3
40
+ */
41
+ unsubscribe(): OutgoingSubscribeRequest;
42
+ }
43
+ /**
44
+ * Subscription state.
45
+ * @remarks
46
+ * https://tools.ietf.org/html/rfc6665#section-4.1.2
47
+ * @public
48
+ */
49
+ export declare enum SubscriptionState {
50
+ Initial = "Initial",
51
+ NotifyWait = "NotifyWait",
52
+ Pending = "Pending",
53
+ Active = "Active",
54
+ Terminated = "Terminated"
55
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Timers.
3
+ * @public
4
+ */
5
+ export declare const Timers: {
6
+ T1: number;
7
+ T2: number;
8
+ T4: number;
9
+ TIMER_B: number;
10
+ TIMER_D: number;
11
+ TIMER_F: number;
12
+ TIMER_H: number;
13
+ TIMER_I: number;
14
+ TIMER_J: number;
15
+ TIMER_K: number;
16
+ TIMER_L: number;
17
+ TIMER_M: number;
18
+ TIMER_N: number;
19
+ PROVISIONAL_RESPONSE_INTERVAL: number;
20
+ };
@@ -0,0 +1,45 @@
1
+ import { IncomingResponseMessage, OutgoingRequestMessage } from "../messages";
2
+ import { Transport } from "../transport";
3
+ import { Transaction } from "./transaction";
4
+ import { TransactionState } from "./transaction-state";
5
+ import { ClientTransactionUser } from "./transaction-user";
6
+ /**
7
+ * Client Transaction.
8
+ * @remarks
9
+ * The client transaction provides its functionality through the
10
+ * maintenance of a state machine.
11
+ *
12
+ * The TU communicates with the client transaction through a simple
13
+ * interface. When the TU wishes to initiate a new transaction, it
14
+ * creates a client transaction and passes it the SIP request to send
15
+ * and an IP address, port, and transport to which to send it. The
16
+ * client transaction begins execution of its state machine. Valid
17
+ * responses are passed up to the TU from the client transaction.
18
+ * https://tools.ietf.org/html/rfc3261#section-17.1
19
+ * @public
20
+ */
21
+ export declare abstract class ClientTransaction extends Transaction {
22
+ private _request;
23
+ protected user: ClientTransactionUser;
24
+ protected constructor(_request: OutgoingRequestMessage, transport: Transport, user: ClientTransactionUser, state: TransactionState, loggerCategory: string);
25
+ private static makeId;
26
+ /** The outgoing request the transaction handling. */
27
+ get request(): OutgoingRequestMessage;
28
+ /**
29
+ * A 408 to non-INVITE will always arrive too late to be useful ([3]),
30
+ * The client already has full knowledge of the timeout. The only
31
+ * information this message would convey is whether or not the server
32
+ * believed the transaction timed out. However, with the current design
33
+ * of the NIT, a client cannot do anything with this knowledge. Thus,
34
+ * the 408 is simply wasting network resources and contributes to the
35
+ * response bombardment illustrated in [3].
36
+ * https://tools.ietf.org/html/rfc4320#section-4.1
37
+ */
38
+ protected onRequestTimeout(): void;
39
+ /**
40
+ * Receive incoming responses from the transport which match this transaction.
41
+ * Responses will be delivered to the transaction user as necessary.
42
+ * @param response - The incoming response.
43
+ */
44
+ abstract receiveResponse(response: IncomingResponseMessage): void;
45
+ }
@@ -0,0 +1,10 @@
1
+ export * from "./client-transaction";
2
+ export * from "./invite-client-transaction";
3
+ export * from "./invite-server-transaction";
4
+ export * from "./non-invite-client-transaction";
5
+ export * from "./non-invite-server-transaction";
6
+ export * from "./invite-client-transaction";
7
+ export * from "./server-transaction";
8
+ export * from "./transaction-state";
9
+ export * from "./transaction-user";
10
+ export * from "./transaction";
@@ -0,0 +1,116 @@
1
+ import { TransportError } from "../exceptions";
2
+ import { IncomingResponseMessage, OutgoingRequestMessage } from "../messages";
3
+ import { Transport } from "../transport";
4
+ import { ClientTransaction } from "./client-transaction";
5
+ import { ClientTransactionUser } from "./transaction-user";
6
+ /**
7
+ * INVITE Client Transaction.
8
+ * @remarks
9
+ * The INVITE transaction consists of a three-way handshake. The client
10
+ * transaction sends an INVITE, the server transaction sends responses,
11
+ * and the client transaction sends an ACK.
12
+ * https://tools.ietf.org/html/rfc3261#section-17.1.1
13
+ * @public
14
+ */
15
+ export declare class InviteClientTransaction extends ClientTransaction {
16
+ private B;
17
+ private D;
18
+ private M;
19
+ /**
20
+ * Map of 2xx to-tag to ACK.
21
+ * If value is not undefined, value is the ACK which was sent.
22
+ * If key exists but value is undefined, a 2xx was received but the ACK not yet sent.
23
+ * Otherwise, a 2xx was not (yet) received for this transaction.
24
+ */
25
+ private ackRetransmissionCache;
26
+ /**
27
+ * Constructor.
28
+ * Upon construction, the outgoing request's Via header is updated by calling `setViaHeader`.
29
+ * Then `toString` is called on the outgoing request and the message is sent via the transport.
30
+ * After construction the transaction will be in the "calling" state and the transaction id
31
+ * will equal the branch parameter set in the Via header of the outgoing request.
32
+ * https://tools.ietf.org/html/rfc3261#section-17.1.1
33
+ * @param request - The outgoing INVITE request.
34
+ * @param transport - The transport.
35
+ * @param user - The transaction user.
36
+ */
37
+ constructor(request: OutgoingRequestMessage, transport: Transport, user: ClientTransactionUser);
38
+ /**
39
+ * Destructor.
40
+ */
41
+ dispose(): void;
42
+ /** Transaction kind. Deprecated. */
43
+ get kind(): string;
44
+ /**
45
+ * ACK a 2xx final response.
46
+ *
47
+ * The transaction includes the ACK only if the final response was not a 2xx response (the
48
+ * transaction will generate and send the ACK to the transport automagically). If the
49
+ * final response was a 2xx, the ACK is not considered part of the transaction (the
50
+ * transaction user needs to generate and send the ACK).
51
+ *
52
+ * This library is not strictly RFC compliant with regard to ACK handling for 2xx final
53
+ * responses. Specifically, retransmissions of ACKs to a 2xx final responses is handled
54
+ * by the transaction layer (instead of the UAC core). The "standard" approach is for
55
+ * the UAC core to receive all 2xx responses and manage sending ACK retransmissions to
56
+ * the transport directly. Herein the transaction layer manages sending ACKs to 2xx responses
57
+ * and any retransmissions of those ACKs as needed.
58
+ *
59
+ * @param ack - The outgoing ACK request.
60
+ */
61
+ ackResponse(ack: OutgoingRequestMessage): void;
62
+ /**
63
+ * Handler for incoming responses from the transport which match this transaction.
64
+ * @param response - The incoming response.
65
+ */
66
+ receiveResponse(response: IncomingResponseMessage): void;
67
+ /**
68
+ * The client transaction SHOULD inform the TU that a transport failure
69
+ * has occurred, and the client transaction SHOULD transition directly
70
+ * to the "Terminated" state. The TU will handle the failover
71
+ * mechanisms described in [4].
72
+ * https://tools.ietf.org/html/rfc3261#section-17.1.4
73
+ * @param error - The error.
74
+ */
75
+ protected onTransportError(error: TransportError): void;
76
+ /** For logging. */
77
+ protected typeToString(): string;
78
+ private ack;
79
+ /**
80
+ * Execute a state transition.
81
+ * @param newState - New state.
82
+ */
83
+ private stateTransition;
84
+ /**
85
+ * When timer A fires, the client transaction MUST retransmit the
86
+ * request by passing it to the transport layer, and MUST reset the
87
+ * timer with a value of 2*T1.
88
+ * When timer A fires 2*T1 seconds later, the request MUST be
89
+ * retransmitted again (assuming the client transaction is still in this
90
+ * state). This process MUST continue so that the request is
91
+ * retransmitted with intervals that double after each transmission.
92
+ * These retransmissions SHOULD only be done while the client
93
+ * transaction is in the "Calling" state.
94
+ * https://tools.ietf.org/html/rfc3261#section-17.1.1.2
95
+ */
96
+ private timerA;
97
+ /**
98
+ * If the client transaction is still in the "Calling" state when timer
99
+ * B fires, the client transaction SHOULD inform the TU that a timeout
100
+ * has occurred. The client transaction MUST NOT generate an ACK.
101
+ * https://tools.ietf.org/html/rfc3261#section-17.1.1.2
102
+ */
103
+ private timerB;
104
+ /**
105
+ * If Timer D fires while the client transaction is in the "Completed" state,
106
+ * the client transaction MUST move to the "Terminated" state.
107
+ * https://tools.ietf.org/html/rfc6026#section-8.4
108
+ */
109
+ private timerD;
110
+ /**
111
+ * If Timer M fires while the client transaction is in the "Accepted"
112
+ * state, the client transaction MUST move to the "Terminated" state.
113
+ * https://tools.ietf.org/html/rfc6026#section-8.4
114
+ */
115
+ private timerM;
116
+ }
@@ -0,0 +1,127 @@
1
+ import { IncomingRequestMessage } from "../messages";
2
+ import { Transport } from "../transport";
3
+ import { ServerTransaction } from "./server-transaction";
4
+ import { ServerTransactionUser } from "./transaction-user";
5
+ /**
6
+ * INVITE Server Transaction.
7
+ * @remarks
8
+ * https://tools.ietf.org/html/rfc3261#section-17.2.1
9
+ * @public
10
+ */
11
+ export declare class InviteServerTransaction extends ServerTransaction {
12
+ private lastFinalResponse;
13
+ private lastProvisionalResponse;
14
+ private H;
15
+ private I;
16
+ private L;
17
+ /**
18
+ * FIXME: This should not be here. It should be in the UAS.
19
+ *
20
+ * If the UAS desires an extended period of time to answer the INVITE,
21
+ * it will need to ask for an "extension" in order to prevent proxies
22
+ * from canceling the transaction. A proxy has the option of canceling
23
+ * a transaction when there is a gap of 3 minutes between responses in a
24
+ * transaction. To prevent cancellation, the UAS MUST send a non-100
25
+ * provisional response at every minute, to handle the possibility of
26
+ * lost provisional responses.
27
+ *
28
+ * An INVITE transaction can go on for extended durations when the
29
+ * user is placed on hold, or when interworking with PSTN systems
30
+ * which allow communications to take place without answering the
31
+ * call. The latter is common in Interactive Voice Response (IVR)
32
+ * systems.
33
+ * https://tools.ietf.org/html/rfc3261#section-13.3.1.1
34
+ */
35
+ private progressExtensionTimer;
36
+ /**
37
+ * Constructor.
38
+ * Upon construction, a "100 Trying" reply will be immediately sent.
39
+ * After construction the transaction will be in the "proceeding" state and the transaction
40
+ * `id` will equal the branch parameter set in the Via header of the incoming request.
41
+ * https://tools.ietf.org/html/rfc3261#section-17.2.1
42
+ * @param request - Incoming INVITE request from the transport.
43
+ * @param transport - The transport.
44
+ * @param user - The transaction user.
45
+ */
46
+ constructor(request: IncomingRequestMessage, transport: Transport, user: ServerTransactionUser);
47
+ /**
48
+ * Destructor.
49
+ */
50
+ dispose(): void;
51
+ /** Transaction kind. Deprecated. */
52
+ get kind(): string;
53
+ /**
54
+ * Receive requests from transport matching this transaction.
55
+ * @param request - Request matching this transaction.
56
+ */
57
+ receiveRequest(request: IncomingRequestMessage): void;
58
+ /**
59
+ * Receive responses from TU for this transaction.
60
+ * @param statusCode - Status code of response.
61
+ * @param response - Response.
62
+ */
63
+ receiveResponse(statusCode: number, response: string): void;
64
+ /**
65
+ * Retransmit the last 2xx response. This is a noop if not in the "accepted" state.
66
+ */
67
+ retransmitAcceptedResponse(): void;
68
+ /**
69
+ * First, the procedures in [4] are followed, which attempt to deliver the response to a backup.
70
+ * If those should all fail, based on the definition of failure in [4], the server transaction SHOULD
71
+ * inform the TU that a failure has occurred, and MUST remain in the current state.
72
+ * https://tools.ietf.org/html/rfc6026#section-8.8
73
+ */
74
+ protected onTransportError(error: Error): void;
75
+ /** For logging. */
76
+ protected typeToString(): string;
77
+ /**
78
+ * Execute a state transition.
79
+ * @param newState - New state.
80
+ */
81
+ private stateTransition;
82
+ /**
83
+ * FIXME: UAS Provisional Retransmission Timer. See RFC 3261 Section 13.3.1.1
84
+ * This is in the wrong place. This is not a transaction level thing. It's a UAS level thing.
85
+ */
86
+ private startProgressExtensionTimer;
87
+ /**
88
+ * FIXME: UAS Provisional Retransmission Timer id. See RFC 3261 Section 13.3.1.1
89
+ * This is in the wrong place. This is not a transaction level thing. It's a UAS level thing.
90
+ */
91
+ private stopProgressExtensionTimer;
92
+ /**
93
+ * While in the "Proceeding" state, if the TU passes a response with status code
94
+ * from 300 to 699 to the server transaction, the response MUST be passed to the
95
+ * transport layer for transmission, and the state machine MUST enter the "Completed" state.
96
+ * For unreliable transports, timer G is set to fire in T1 seconds, and is not set to fire for
97
+ * reliable transports. If timer G fires, the response is passed to the transport layer once
98
+ * more for retransmission, and timer G is set to fire in MIN(2*T1, T2) seconds. From then on,
99
+ * when timer G fires, the response is passed to the transport again for transmission, and
100
+ * timer G is reset with a value that doubles, unless that value exceeds T2, in which case
101
+ * it is reset with the value of T2.
102
+ * https://tools.ietf.org/html/rfc3261#section-17.2.1
103
+ */
104
+ private timerG;
105
+ /**
106
+ * If timer H fires while in the "Completed" state, it implies that the ACK was never received.
107
+ * In this case, the server transaction MUST transition to the "Terminated" state, and MUST
108
+ * indicate to the TU that a transaction failure has occurred.
109
+ * https://tools.ietf.org/html/rfc3261#section-17.2.1
110
+ */
111
+ private timerH;
112
+ /**
113
+ * Once timer I fires, the server MUST transition to the "Terminated" state.
114
+ * https://tools.ietf.org/html/rfc3261#section-17.2.1
115
+ */
116
+ private timerI;
117
+ /**
118
+ * When Timer L fires and the state machine is in the "Accepted" state, the machine MUST
119
+ * transition to the "Terminated" state. Once the transaction is in the "Terminated" state,
120
+ * it MUST be destroyed immediately. Timer L reflects the amount of time the server
121
+ * transaction could receive 2xx responses for retransmission from the
122
+ * TU while it is waiting to receive an ACK.
123
+ * https://tools.ietf.org/html/rfc6026#section-7.1
124
+ * https://tools.ietf.org/html/rfc6026#section-8.7
125
+ */
126
+ private timerL;
127
+ }
@@ -0,0 +1,69 @@
1
+ import { IncomingResponseMessage, OutgoingRequestMessage } from "../messages";
2
+ import { Transport } from "../transport";
3
+ import { ClientTransaction } from "./client-transaction";
4
+ import { ClientTransactionUser } from "./transaction-user";
5
+ /**
6
+ * Non-INVITE Client Transaction.
7
+ * @remarks
8
+ * Non-INVITE transactions do not make use of ACK.
9
+ * They are simple request-response interactions.
10
+ * https://tools.ietf.org/html/rfc3261#section-17.1.2
11
+ * @public
12
+ */
13
+ export declare class NonInviteClientTransaction extends ClientTransaction {
14
+ private F;
15
+ private K;
16
+ /**
17
+ * Constructor
18
+ * Upon construction, the outgoing request's Via header is updated by calling `setViaHeader`.
19
+ * Then `toString` is called on the outgoing request and the message is sent via the transport.
20
+ * After construction the transaction will be in the "calling" state and the transaction id
21
+ * will equal the branch parameter set in the Via header of the outgoing request.
22
+ * https://tools.ietf.org/html/rfc3261#section-17.1.2
23
+ * @param request - The outgoing Non-INVITE request.
24
+ * @param transport - The transport.
25
+ * @param user - The transaction user.
26
+ */
27
+ constructor(request: OutgoingRequestMessage, transport: Transport, user: ClientTransactionUser);
28
+ /**
29
+ * Destructor.
30
+ */
31
+ dispose(): void;
32
+ /** Transaction kind. Deprecated. */
33
+ get kind(): string;
34
+ /**
35
+ * Handler for incoming responses from the transport which match this transaction.
36
+ * @param response - The incoming response.
37
+ */
38
+ receiveResponse(response: IncomingResponseMessage): void;
39
+ /**
40
+ * The client transaction SHOULD inform the TU that a transport failure has occurred,
41
+ * and the client transaction SHOULD transition directly to the "Terminated" state.
42
+ * The TU will handle the fail over mechanisms described in [4].
43
+ * https://tools.ietf.org/html/rfc3261#section-17.1.4
44
+ * @param error - Transport error
45
+ */
46
+ protected onTransportError(error: Error): void;
47
+ /** For logging. */
48
+ protected typeToString(): string;
49
+ /**
50
+ * Execute a state transition.
51
+ * @param newState - New state.
52
+ */
53
+ private stateTransition;
54
+ /**
55
+ * If Timer F fires while the client transaction is still in the
56
+ * "Trying" state, the client transaction SHOULD inform the TU about the
57
+ * timeout, and then it SHOULD enter the "Terminated" state.
58
+ * If timer F fires while in the "Proceeding" state, the TU MUST be informed of
59
+ * a timeout, and the client transaction MUST transition to the terminated state.
60
+ * https://tools.ietf.org/html/rfc3261#section-17.1.2.2
61
+ */
62
+ private timerF;
63
+ /**
64
+ * If Timer K fires while in this (COMPLETED) state, the client transaction
65
+ * MUST transition to the "Terminated" state.
66
+ * https://tools.ietf.org/html/rfc3261#section-17.1.2.2
67
+ */
68
+ private timerK;
69
+ }
@@ -0,0 +1,57 @@
1
+ import { IncomingRequestMessage } from "../messages";
2
+ import { Transport } from "../transport";
3
+ import { ServerTransaction } from "./server-transaction";
4
+ import { ServerTransactionUser } from "./transaction-user";
5
+ /**
6
+ * Non-INVITE Server Transaction.
7
+ * @remarks
8
+ * https://tools.ietf.org/html/rfc3261#section-17.2.2
9
+ * @public
10
+ */
11
+ export declare class NonInviteServerTransaction extends ServerTransaction {
12
+ private lastResponse;
13
+ private J;
14
+ /**
15
+ * Constructor.
16
+ * After construction the transaction will be in the "trying": state and the transaction
17
+ * `id` will equal the branch parameter set in the Via header of the incoming request.
18
+ * https://tools.ietf.org/html/rfc3261#section-17.2.2
19
+ * @param request - Incoming Non-INVITE request from the transport.
20
+ * @param transport - The transport.
21
+ * @param user - The transaction user.
22
+ */
23
+ constructor(request: IncomingRequestMessage, transport: Transport, user: ServerTransactionUser);
24
+ /**
25
+ * Destructor.
26
+ */
27
+ dispose(): void;
28
+ /** Transaction kind. Deprecated. */
29
+ get kind(): string;
30
+ /**
31
+ * Receive requests from transport matching this transaction.
32
+ * @param request - Request matching this transaction.
33
+ */
34
+ receiveRequest(request: IncomingRequestMessage): void;
35
+ /**
36
+ * Receive responses from TU for this transaction.
37
+ * @param statusCode - Status code of response. 101-199 not allowed per RFC 4320.
38
+ * @param response - Response to send.
39
+ */
40
+ receiveResponse(statusCode: number, response: string): void;
41
+ /**
42
+ * First, the procedures in [4] are followed, which attempt to deliver the response to a backup.
43
+ * If those should all fail, based on the definition of failure in [4], the server transaction SHOULD
44
+ * inform the TU that a failure has occurred, and SHOULD transition to the terminated state.
45
+ * https://tools.ietf.org/html/rfc3261#section-17.2.4
46
+ */
47
+ protected onTransportError(error: Error): void;
48
+ /** For logging. */
49
+ protected typeToString(): string;
50
+ private stateTransition;
51
+ /**
52
+ * The server transaction remains in this state until Timer J fires,
53
+ * at which point it MUST transition to the "Terminated" state.
54
+ * https://tools.ietf.org/html/rfc3261#section-17.2.2
55
+ */
56
+ private timerJ;
57
+ }