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,212 @@
1
+ import { BodyAndContentType, SessionDescriptionHandler as SessionDescriptionHandlerDefinition, SessionDescriptionHandlerModifier } from "../../../api";
2
+ import { Logger } from "../../../core";
3
+ import { MediaStreamFactory } from "./media-stream-factory";
4
+ import { SessionDescriptionHandlerConfiguration } from "./session-description-handler-configuration";
5
+ import { SessionDescriptionHandlerOptions } from "./session-description-handler-options";
6
+ import { PeerConnectionDelegate } from "./peer-connection-delegate";
7
+ /**
8
+ * A base class implementing a WebRTC session description handler for sip.js.
9
+ * @remarks
10
+ * It is expected/intended to be extended by specific WebRTC based applications.
11
+ * @privateRemarks
12
+ * So do not put application specific implementation in here.
13
+ * @public
14
+ */
15
+ export declare class SessionDescriptionHandler implements SessionDescriptionHandlerDefinition {
16
+ /** Logger. */
17
+ protected logger: Logger;
18
+ /** Media stream factory. */
19
+ protected mediaStreamFactory: MediaStreamFactory;
20
+ /** Configuration options. */
21
+ protected sessionDescriptionHandlerConfiguration?: SessionDescriptionHandlerConfiguration;
22
+ /** The local media stream. */
23
+ protected _localMediaStream: MediaStream;
24
+ /** The remote media stream. */
25
+ protected _remoteMediaStream: MediaStream;
26
+ /** The data channel. Undefined before created. */
27
+ protected _dataChannel: RTCDataChannel | undefined;
28
+ /** The peer connection. Undefined after SessionDescriptionHandler.close(). */
29
+ protected _peerConnection: RTCPeerConnection | undefined;
30
+ /** The peer connection delegate. */
31
+ protected _peerConnectionDelegate: PeerConnectionDelegate | undefined;
32
+ private iceGatheringCompletePromise;
33
+ private iceGatheringCompleteTimeoutId;
34
+ private iceGatheringCompleteResolve;
35
+ private iceGatheringCompleteReject;
36
+ private localMediaStreamConstraints;
37
+ private onDataChannel;
38
+ /**
39
+ * Constructor
40
+ * @param logger - A logger
41
+ * @param mediaStreamFactory - A factory to provide a MediaStream
42
+ * @param options - Options passed from the SessionDescriptionHandleFactory
43
+ */
44
+ constructor(logger: Logger, mediaStreamFactory: MediaStreamFactory, sessionDescriptionHandlerConfiguration?: SessionDescriptionHandlerConfiguration);
45
+ /**
46
+ * The local media stream currently being sent.
47
+ *
48
+ * @remarks
49
+ * The local media stream initially has no tracks, so the presence of tracks
50
+ * should not be assumed. Furthermore, tracks may be added or removed if the
51
+ * local media changes - for example, on upgrade from audio only to a video session.
52
+ * At any given time there will be at most one audio track and one video track
53
+ * (it's possible that this restriction may not apply to sub-classes).
54
+ * Use `MediaStream.onaddtrack` or add a listener for the `addtrack` event
55
+ * to detect when a new track becomes available:
56
+ * https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/onaddtrack
57
+ */
58
+ get localMediaStream(): MediaStream;
59
+ /**
60
+ * The remote media stream currently being received.
61
+ *
62
+ * @remarks
63
+ * The remote media stream initially has no tracks, so the presence of tracks
64
+ * should not be assumed. Furthermore, tracks may be added or removed if the
65
+ * remote media changes - for example, on upgrade from audio only to a video session.
66
+ * At any given time there will be at most one audio track and one video track
67
+ * (it's possible that this restriction may not apply to sub-classes).
68
+ * Use `MediaStream.onaddtrack` or add a listener for the `addtrack` event
69
+ * to detect when a new track becomes available:
70
+ * https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/onaddtrack
71
+ */
72
+ get remoteMediaStream(): MediaStream;
73
+ /**
74
+ * The data channel. Undefined before it is created.
75
+ */
76
+ get dataChannel(): RTCDataChannel | undefined;
77
+ /**
78
+ * The peer connection. Undefined if peer connection has closed.
79
+ *
80
+ * @remarks
81
+ * While access to the underlying `RTCPeerConnection` is provided, note that
82
+ * using methods with modify it may break the operation of this class.
83
+ * In particular, this class depends on exclusive access to the
84
+ * event handler properties. If you need access to the peer connection
85
+ * events, either register for events using `addEventListener()` on
86
+ * the `RTCPeerConnection` or set the `peerConnectionDelegate` on
87
+ * this `SessionDescriptionHandler`.
88
+ */
89
+ get peerConnection(): RTCPeerConnection | undefined;
90
+ /**
91
+ * A delegate which provides access to the peer connection event handlers.
92
+ *
93
+ * @remarks
94
+ * Setting the peer connection event handlers directly is not supported
95
+ * and may break this class. As this class depends on exclusive access
96
+ * to them, a delegate may be set which provides alternative access to
97
+ * the event handlers in a fashion which is supported.
98
+ */
99
+ get peerConnectionDelegate(): PeerConnectionDelegate | undefined;
100
+ set peerConnectionDelegate(delegate: PeerConnectionDelegate | undefined);
101
+ private static dispatchAddTrackEvent;
102
+ private static dispatchRemoveTrackEvent;
103
+ /**
104
+ * Stop tracks and close peer connection.
105
+ */
106
+ close(): void;
107
+ /**
108
+ * Creates an offer or answer.
109
+ * @param options - Options bucket.
110
+ * @param modifiers - Modifiers.
111
+ */
112
+ getDescription(options?: SessionDescriptionHandlerOptions, modifiers?: Array<SessionDescriptionHandlerModifier>): Promise<BodyAndContentType>;
113
+ /**
114
+ * Returns true if the SessionDescriptionHandler can handle the Content-Type described by a SIP message.
115
+ * @param contentType - The content type that is in the SIP Message.
116
+ */
117
+ hasDescription(contentType: string): boolean;
118
+ /**
119
+ * Send DTMF via RTP (RFC 4733).
120
+ * Returns true if DTMF send is successful, false otherwise.
121
+ * @param tones - A string containing DTMF digits.
122
+ * @param options - Options object to be used by sendDtmf.
123
+ */
124
+ sendDtmf(tones: string, options?: {
125
+ duration: number;
126
+ interToneGap: number;
127
+ }): boolean;
128
+ /**
129
+ * Sets an offer or answer.
130
+ * @param sdp - The session description.
131
+ * @param options - Options bucket.
132
+ * @param modifiers - Modifiers.
133
+ */
134
+ setDescription(sdp: string, options?: SessionDescriptionHandlerOptions, modifiers?: Array<SessionDescriptionHandlerModifier>): Promise<void>;
135
+ /**
136
+ * Applies modifiers to SDP prior to setting the local or remote description.
137
+ * @param sdp - SDP to modify.
138
+ * @param modifiers - Modifiers to apply.
139
+ */
140
+ protected applyModifiers(sdp: RTCSessionDescriptionInit, modifiers?: Array<SessionDescriptionHandlerModifier>): Promise<RTCSessionDescriptionInit>;
141
+ /**
142
+ * Create a data channel.
143
+ * @remarks
144
+ * Only creates a data channel if SessionDescriptionHandlerOptions.dataChannel is true.
145
+ * Only creates a data channel if creating a local offer.
146
+ * Only if one does not already exist.
147
+ * @param options - Session description handler options.
148
+ */
149
+ protected createDataChannel(options?: SessionDescriptionHandlerOptions): Promise<void>;
150
+ /**
151
+ * Depending on current signaling state, create a local offer or answer.
152
+ * @param options - Session description handler options.
153
+ */
154
+ protected createLocalOfferOrAnswer(options?: SessionDescriptionHandlerOptions): Promise<RTCSessionDescriptionInit>;
155
+ /**
156
+ * Get a media stream from the media stream factory and set the local media stream.
157
+ * @param options - Session description handler options.
158
+ */
159
+ protected getLocalMediaStream(options?: SessionDescriptionHandlerOptions): Promise<void>;
160
+ /**
161
+ * Sets the peer connection's sender tracks and local media stream tracks.
162
+ *
163
+ * @remarks
164
+ * Only the first audio and video tracks of the provided MediaStream are utilized.
165
+ * Adds tracks if audio and/or video tracks are not already present, otherwise replaces tracks.
166
+ *
167
+ * @param stream - Media stream containing tracks to be utilized.
168
+ */
169
+ protected setLocalMediaStream(stream: MediaStream): Promise<void>;
170
+ /**
171
+ * Gets the peer connection's local session description.
172
+ */
173
+ protected getLocalSessionDescription(): Promise<RTCSessionDescription>;
174
+ /**
175
+ * Sets the peer connection's local session description.
176
+ * @param sessionDescription - sessionDescription The session description.
177
+ */
178
+ protected setLocalSessionDescription(sessionDescription: RTCSessionDescriptionInit): Promise<void>;
179
+ /**
180
+ * Sets the peer connection's remote session description.
181
+ * @param sessionDescription - The session description.
182
+ */
183
+ protected setRemoteSessionDescription(sessionDescription: RTCSessionDescriptionInit): Promise<void>;
184
+ /**
185
+ * Sets a remote media stream track.
186
+ *
187
+ * @remarks
188
+ * Adds tracks if audio and/or video tracks are not already present, otherwise replaces tracks.
189
+ *
190
+ * @param track - Media stream track to be utilized.
191
+ */
192
+ protected setRemoteTrack(track: MediaStreamTrack): void;
193
+ /**
194
+ * Depending on the current signaling state and the session hold state, update transceiver direction.
195
+ * @param options - Session description handler options.
196
+ */
197
+ protected updateDirection(options?: SessionDescriptionHandlerOptions): Promise<void>;
198
+ /**
199
+ * Called when ICE gathering completes and resolves any waiting promise.
200
+ */
201
+ protected iceGatheringComplete(): void;
202
+ /**
203
+ * Wait for ICE gathering to complete.
204
+ * @param restart - If true, waits if current state is "complete" (waits for transition to "complete").
205
+ * @param timeout - Milliseconds after which waiting times out. No timeout if 0.
206
+ */
207
+ protected waitForIceGatheringComplete(restart?: boolean, timeout?: number): Promise<void>;
208
+ /**
209
+ * Initializes the peer connection event handlers
210
+ */
211
+ private initPeerConnectionEventHandlers;
212
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A simple SIP user implementation for web browsers.
3
+ * @packageDocumentation
4
+ */
5
+ export * from "./simple-user";
6
+ export * from "./simple-user-delegate";
7
+ export * from "./simple-user-options";
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Delegate for {@link SimpleUser}.
3
+ * @public
4
+ */
5
+ export interface SimpleUserDelegate {
6
+ /**
7
+ * Called when a call is answered.
8
+ * @remarks
9
+ * Callback for handling establishment of a new Session.
10
+ */
11
+ onCallAnswered?(): void;
12
+ /**
13
+ * Called when a call is created.
14
+ * @remarks
15
+ * Callback for handling the creation of a new Session.
16
+ */
17
+ onCallCreated?(): void;
18
+ /**
19
+ * Called when a call is received.
20
+ * @remarks
21
+ * Callback for handling incoming INVITE requests.
22
+ * The callback must either accept or reject the incoming call by calling `answer()` or `decline()` respectively.
23
+ */
24
+ onCallReceived?(): void;
25
+ /**
26
+ * Called when a call is hung up.
27
+ * @remarks
28
+ * Callback for handling termination of a Session.
29
+ */
30
+ onCallHangup?(): void;
31
+ /**
32
+ * Called when a call is put on hold or taken off hold.
33
+ * @remarks
34
+ * Callback for handling re-INVITE responses.
35
+ */
36
+ onCallHold?(held: boolean): void;
37
+ /**
38
+ * Called when a call receives an incoming DTMF tone.
39
+ * @remarks
40
+ * Callback for handling an incoming INFO request with content type application/dtmf-relay.
41
+ */
42
+ onCallDTMFReceived?(tone: string, duration: number): void;
43
+ /**
44
+ * Called upon receiving a message.
45
+ * @remarks
46
+ * Callback for handling incoming MESSAGE requests.
47
+ * @param message - The message received.
48
+ */
49
+ onMessageReceived?(message: string): void;
50
+ /**
51
+ * Called when user is registered to received calls.
52
+ */
53
+ onRegistered?(): void;
54
+ /**
55
+ * Called when user is no longer registered to received calls.
56
+ */
57
+ onUnregistered?(): void;
58
+ /**
59
+ * Called when user is connected to server.
60
+ * @remarks
61
+ * Callback for handling user becomes connected.
62
+ */
63
+ onServerConnect?(): void;
64
+ /**
65
+ * Called when user is no longer connected.
66
+ * @remarks
67
+ * Callback for handling user becomes disconnected.
68
+ *
69
+ * @param error - An Error if server caused the disconnect. Otherwise undefined.
70
+ */
71
+ onServerDisconnect?(error?: Error): void;
72
+ }
@@ -0,0 +1,90 @@
1
+ import { UserAgentOptions } from "../../../api";
2
+ import { SimpleUserDelegate } from "./simple-user-delegate";
3
+ /**
4
+ * Media for {@link SimpleUserOptions}.
5
+ * @public
6
+ */
7
+ export interface SimpleUserMedia {
8
+ /**
9
+ * Offer/Answer constraints determine if audio and/or video are utilized.
10
+ * If not specified, only audio is utilized (audio is true, video is false).
11
+ * @remarks
12
+ * Constraints are used when creating local media stream.
13
+ * If undefined, defaults to audio true and video false.
14
+ * If audio and video are false, media stream will have no tracks.
15
+ */
16
+ constraints?: SimpleUserMediaConstraints;
17
+ /** HTML elements for local media streams. */
18
+ local?: SimpleUserMediaLocal;
19
+ /** Local HTML media elements. */
20
+ remote?: SimpleUserMediaRemote;
21
+ }
22
+ /**
23
+ * Constraints for {@link SimpleUserMedia}.
24
+ * @public
25
+ */
26
+ export interface SimpleUserMediaConstraints {
27
+ /** If true, offer and answer to send and receive audio. */
28
+ audio: boolean;
29
+ /** If true, offer and answer to send and receive video. */
30
+ video: boolean;
31
+ }
32
+ /**
33
+ * Local media elements for {@link SimpleUserMedia}.
34
+ * @public
35
+ */
36
+ export interface SimpleUserMediaLocal {
37
+ /** The local video media stream is attached to this element. */
38
+ video?: HTMLVideoElement;
39
+ }
40
+ /**
41
+ * Remote media elements for {@link SimpleUserMedia}.
42
+ * @public
43
+ */
44
+ export interface SimpleUserMediaRemote {
45
+ /** The remote audio media stream is attached to this element. */
46
+ audio?: HTMLAudioElement;
47
+ /** The remote video media stream is attached to this element. */
48
+ video?: HTMLVideoElement;
49
+ }
50
+ /**
51
+ * Options for {@link SimpleUser}.
52
+ * @public
53
+ */
54
+ export interface SimpleUserOptions {
55
+ /**
56
+ * User's SIP Address of Record (AOR).
57
+ * @remarks
58
+ * The AOR is registered to receive incoming calls.
59
+ * If not specified, a random anonymous address is created for the user.
60
+ */
61
+ aor?: string;
62
+ /**
63
+ * Delegate for SimpleUser.
64
+ */
65
+ delegate?: SimpleUserDelegate;
66
+ /**
67
+ * Media options.
68
+ */
69
+ media?: SimpleUserMedia;
70
+ /**
71
+ * Maximum number of times to attempt to reconnection.
72
+ * @remarks
73
+ * When the transport connection is lost (WebSocket disconnects),
74
+ * reconnection will be attempted immediately. If that fails,
75
+ * reconnection will be attempted again when the browser indicates
76
+ * the application has come online. See:
77
+ * https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine
78
+ * @defaultValue 3
79
+ */
80
+ reconnectionAttempts?: number;
81
+ /**
82
+ * Seconds to wait between reconnection attempts.
83
+ * @defaultValue 4
84
+ */
85
+ reconnectionDelay?: number;
86
+ /**
87
+ * Options for UserAgent.
88
+ */
89
+ userAgentOptions?: UserAgentOptions;
90
+ }
@@ -0,0 +1,226 @@
1
+ import { InvitationAcceptOptions, InviterInviteOptions, InviterOptions, RegistererOptions, RegistererRegisterOptions, RegistererUnregisterOptions } from "../../../api";
2
+ import { SimpleUserDelegate } from "./simple-user-delegate";
3
+ import { SimpleUserOptions } from "./simple-user-options";
4
+ /**
5
+ * A simple SIP user class.
6
+ * @remarks
7
+ * While this class is completely functional for simple use cases, it is not intended
8
+ * to provide an interface which is suitable for most (must less all) applications.
9
+ * While this class has many limitations (for example, it only handles a single concurrent session),
10
+ * it is, however, intended to serve as a simple example of using the SIP.js API.
11
+ * @public
12
+ */
13
+ export declare class SimpleUser {
14
+ /** Delegate. */
15
+ delegate: SimpleUserDelegate | undefined;
16
+ private attemptingReconnection;
17
+ private connectRequested;
18
+ private logger;
19
+ private held;
20
+ private muted;
21
+ private options;
22
+ private registerer;
23
+ private registerRequested;
24
+ private session;
25
+ private userAgent;
26
+ /**
27
+ * Constructs a new instance of the `SimpleUser` class.
28
+ * @param server - SIP WebSocket Server URL.
29
+ * @param options - Options bucket. See {@link SimpleUserOptions} for details.
30
+ */
31
+ constructor(server: string, options?: SimpleUserOptions);
32
+ /**
33
+ * Instance identifier.
34
+ * @internal
35
+ */
36
+ get id(): string;
37
+ /** The local media stream. Undefined if call not answered. */
38
+ get localMediaStream(): MediaStream | undefined;
39
+ /** The remote media stream. Undefined if call not answered. */
40
+ get remoteMediaStream(): MediaStream | undefined;
41
+ /**
42
+ * The local audio track, if available.
43
+ * @deprecated Use localMediaStream and get track from the stream.
44
+ */
45
+ get localAudioTrack(): MediaStreamTrack | undefined;
46
+ /**
47
+ * The local video track, if available.
48
+ * @deprecated Use localMediaStream and get track from the stream.
49
+ */
50
+ get localVideoTrack(): MediaStreamTrack | undefined;
51
+ /**
52
+ * The remote audio track, if available.
53
+ * @deprecated Use remoteMediaStream and get track from the stream.
54
+ */
55
+ get remoteAudioTrack(): MediaStreamTrack | undefined;
56
+ /**
57
+ * The remote video track, if available.
58
+ * @deprecated Use remoteMediaStream and get track from the stream.
59
+ */
60
+ get remoteVideoTrack(): MediaStreamTrack | undefined;
61
+ /**
62
+ * Connect.
63
+ * @remarks
64
+ * Start the UserAgent's WebSocket Transport.
65
+ */
66
+ connect(): Promise<void>;
67
+ /**
68
+ * Disconnect.
69
+ * @remarks
70
+ * Stop the UserAgent's WebSocket Transport.
71
+ */
72
+ disconnect(): Promise<void>;
73
+ /**
74
+ * Return true if connected.
75
+ */
76
+ isConnected(): boolean;
77
+ /**
78
+ * Start receiving incoming calls.
79
+ * @remarks
80
+ * Send a REGISTER request for the UserAgent's AOR.
81
+ * Resolves when the REGISTER request is sent, otherwise rejects.
82
+ */
83
+ register(registererOptions?: RegistererOptions, registererRegisterOptions?: RegistererRegisterOptions): Promise<void>;
84
+ /**
85
+ * Stop receiving incoming calls.
86
+ * @remarks
87
+ * Send an un-REGISTER request for the UserAgent's AOR.
88
+ * Resolves when the un-REGISTER request is sent, otherwise rejects.
89
+ */
90
+ unregister(registererUnregisterOptions?: RegistererUnregisterOptions): Promise<void>;
91
+ /**
92
+ * Make an outgoing call.
93
+ * @remarks
94
+ * Send an INVITE request to create a new Session.
95
+ * Resolves when the INVITE request is sent, otherwise rejects.
96
+ * Use `onCallAnswered` delegate method to determine if Session is established.
97
+ * @param destination - The target destination to call. A SIP address to send the INVITE to.
98
+ * @param inviterOptions - Optional options for Inviter constructor.
99
+ * @param inviterInviteOptions - Optional options for Inviter.invite().
100
+ */
101
+ call(destination: string, inviterOptions?: InviterOptions, inviterInviteOptions?: InviterInviteOptions): Promise<void>;
102
+ /**
103
+ * Hangup a call.
104
+ * @remarks
105
+ * Send a BYE request, CANCEL request or reject response to end the current Session.
106
+ * Resolves when the request/response is sent, otherwise rejects.
107
+ * Use `onCallTerminated` delegate method to determine if and when call is ended.
108
+ */
109
+ hangup(): Promise<void>;
110
+ /**
111
+ * Answer an incoming call.
112
+ * @remarks
113
+ * Accept an incoming INVITE request creating a new Session.
114
+ * Resolves with the response is sent, otherwise rejects.
115
+ * Use `onCallAnswered` delegate method to determine if and when call is established.
116
+ * @param invitationAcceptOptions - Optional options for Inviter.accept().
117
+ */
118
+ answer(invitationAcceptOptions?: InvitationAcceptOptions): Promise<void>;
119
+ /**
120
+ * Decline an incoming call.
121
+ * @remarks
122
+ * Reject an incoming INVITE request.
123
+ * Resolves with the response is sent, otherwise rejects.
124
+ * Use `onCallTerminated` delegate method to determine if and when call is ended.
125
+ */
126
+ decline(): Promise<void>;
127
+ /**
128
+ * Hold call
129
+ * @remarks
130
+ * Send a re-INVITE with new offer indicating "hold".
131
+ * Resolves when the re-INVITE request is sent, otherwise rejects.
132
+ * Use `onCallHold` delegate method to determine if request is accepted or rejected.
133
+ * See: https://tools.ietf.org/html/rfc6337
134
+ */
135
+ hold(): Promise<void>;
136
+ /**
137
+ * Unhold call.
138
+ * @remarks
139
+ * Send a re-INVITE with new offer indicating "unhold".
140
+ * Resolves when the re-INVITE request is sent, otherwise rejects.
141
+ * Use `onCallHold` delegate method to determine if request is accepted or rejected.
142
+ * See: https://tools.ietf.org/html/rfc6337
143
+ */
144
+ unhold(): Promise<void>;
145
+ /**
146
+ * Hold state.
147
+ * @remarks
148
+ * True if session media is on hold.
149
+ */
150
+ isHeld(): boolean;
151
+ /**
152
+ * Mute call.
153
+ * @remarks
154
+ * Disable sender's media tracks.
155
+ */
156
+ mute(): void;
157
+ /**
158
+ * Unmute call.
159
+ * @remarks
160
+ * Enable sender's media tracks.
161
+ */
162
+ unmute(): void;
163
+ /**
164
+ * Mute state.
165
+ * @remarks
166
+ * True if sender's media track is disabled.
167
+ */
168
+ isMuted(): boolean;
169
+ /**
170
+ * Send DTMF.
171
+ * @remarks
172
+ * Send an INFO request with content type application/dtmf-relay.
173
+ * @param tone - Tone to send.
174
+ */
175
+ sendDTMF(tone: string): Promise<void>;
176
+ /**
177
+ * Send a message.
178
+ * @remarks
179
+ * Send a MESSAGE request.
180
+ * @param destination - The target destination for the message. A SIP address to send the MESSAGE to.
181
+ */
182
+ message(destination: string, message: string): Promise<void>;
183
+ /** Media constraints. */
184
+ private get constraints();
185
+ /**
186
+ * Attempt reconnection up to `maxReconnectionAttempts` times.
187
+ * @param reconnectionAttempt - Current attempt number.
188
+ */
189
+ private attemptReconnection;
190
+ /** Helper function to remove media from html elements. */
191
+ private cleanupMedia;
192
+ /** Helper function to enable/disable media tracks. */
193
+ private enableReceiverTracks;
194
+ /** Helper function to enable/disable media tracks. */
195
+ private enableSenderTracks;
196
+ /**
197
+ * Setup session delegate and state change handler.
198
+ * @param session - Session to setup
199
+ * @param referralInviterOptions - Options for any Inviter created as result of a REFER.
200
+ */
201
+ private initSession;
202
+ /** Helper function to init send then send invite. */
203
+ private sendInvite;
204
+ /**
205
+ * Puts Session on hold.
206
+ * @param hold - Hold on if true, off if false.
207
+ */
208
+ private setHold;
209
+ /**
210
+ * Puts Session on mute.
211
+ * @param mute - Mute on if true, off if false.
212
+ */
213
+ private setMute;
214
+ /** Helper function to attach local media to html elements. */
215
+ private setupLocalMedia;
216
+ /** Helper function to attach remote media to html elements. */
217
+ private setupRemoteMedia;
218
+ /**
219
+ * End a session.
220
+ * @remarks
221
+ * Send a BYE request, CANCEL request or reject response to end the current Session.
222
+ * Resolves when the request/response is sent, otherwise rejects.
223
+ * Use `onCallTerminated` delegate method to determine if and when Session is terminated.
224
+ */
225
+ private terminate;
226
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A Transport implementation for web browsers.
3
+ * @packageDocumentation
4
+ */
5
+ export * from "./transport";
6
+ export * from "./transport-options";
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Transport options.
3
+ * @public
4
+ */
5
+ export interface TransportOptions {
6
+ /**
7
+ * URL of WebSocket server to connect with. For example, "wss://localhost:8080".
8
+ */
9
+ server: string;
10
+ /**
11
+ * Seconds to wait for WebSocket to connect before giving up.
12
+ * @defaultValue `5`
13
+ */
14
+ connectionTimeout?: number;
15
+ /**
16
+ * Keep alive - needs review.
17
+ * @internal
18
+ */
19
+ keepAliveInterval?: number;
20
+ /**
21
+ * Keep alive - needs review.
22
+ * @internal
23
+ */
24
+ keepAliveDebounce?: number;
25
+ /**
26
+ * If true, messages sent and received by the transport are logged.
27
+ * @defaultValue `true`
28
+ */
29
+ traceSip?: boolean;
30
+ }