ue-softphone-sdk-beta 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/dist/ue-softphone-sdk.js +1 -1
  2. package/package.json +4 -5
  3. package/.babelrc +0 -12
  4. package/.gitlab-ci.yml +0 -3
  5. package/Dockerfile +0 -16
  6. package/dist/lib/types/lib/sip.js/api/ack.d.ts +0 -12
  7. package/dist/lib/types/lib/sip.js/api/bye.d.ts +0 -16
  8. package/dist/lib/types/lib/sip.js/api/dtmf.d.ts +0 -15
  9. package/dist/lib/types/lib/sip.js/api/emitter.d.ts +0 -88
  10. package/dist/lib/types/lib/sip.js/api/exceptions/content-type-unsupported.d.ts +0 -8
  11. package/dist/lib/types/lib/sip.js/api/exceptions/index.d.ts +0 -5
  12. package/dist/lib/types/lib/sip.js/api/exceptions/request-pending.d.ts +0 -9
  13. package/dist/lib/types/lib/sip.js/api/exceptions/session-description-handler.d.ts +0 -8
  14. package/dist/lib/types/lib/sip.js/api/exceptions/session-terminated.d.ts +0 -8
  15. package/dist/lib/types/lib/sip.js/api/exceptions/state-transition.d.ts +0 -8
  16. package/dist/lib/types/lib/sip.js/api/index.d.ts +0 -59
  17. package/dist/lib/types/lib/sip.js/api/info.d.ts +0 -16
  18. package/dist/lib/types/lib/sip.js/api/invitation-accept-options.d.ts +0 -19
  19. package/dist/lib/types/lib/sip.js/api/invitation-progress-options.d.ts +0 -38
  20. package/dist/lib/types/lib/sip.js/api/invitation-reject-options.d.ts +0 -25
  21. package/dist/lib/types/lib/sip.js/api/invitation.d.ts +0 -179
  22. package/dist/lib/types/lib/sip.js/api/inviter-cancel-options.d.ts +0 -9
  23. package/dist/lib/types/lib/sip.js/api/inviter-invite-options.d.ts +0 -28
  24. package/dist/lib/types/lib/sip.js/api/inviter-options.d.ts +0 -43
  25. package/dist/lib/types/lib/sip.js/api/inviter.d.ts +0 -236
  26. package/dist/lib/types/lib/sip.js/api/message.d.ts +0 -16
  27. package/dist/lib/types/lib/sip.js/api/messager-message-options.d.ts +0 -11
  28. package/dist/lib/types/lib/sip.js/api/messager-options.d.ts +0 -17
  29. package/dist/lib/types/lib/sip.js/api/messager.d.ts +0 -26
  30. package/dist/lib/types/lib/sip.js/api/notification.d.ts +0 -16
  31. package/dist/lib/types/lib/sip.js/api/notifier.d.ts +0 -8
  32. package/dist/lib/types/lib/sip.js/api/publisher-options.d.ts +0 -33
  33. package/dist/lib/types/lib/sip.js/api/publisher-publish-options.d.ts +0 -6
  34. package/dist/lib/types/lib/sip.js/api/publisher-state.d.ts +0 -21
  35. package/dist/lib/types/lib/sip.js/api/publisher-unpublish-options.d.ts +0 -6
  36. package/dist/lib/types/lib/sip.js/api/publisher.d.ts +0 -65
  37. package/dist/lib/types/lib/sip.js/api/referral.d.ts +0 -38
  38. package/dist/lib/types/lib/sip.js/api/registerer-options.d.ts +0 -46
  39. package/dist/lib/types/lib/sip.js/api/registerer-register-options.d.ts +0 -11
  40. package/dist/lib/types/lib/sip.js/api/registerer-state.d.ts +0 -21
  41. package/dist/lib/types/lib/sip.js/api/registerer-unregister-options.d.ts +0 -16
  42. package/dist/lib/types/lib/sip.js/api/registerer.d.ts +0 -144
  43. package/dist/lib/types/lib/sip.js/api/session-bye-options.d.ts +0 -11
  44. package/dist/lib/types/lib/sip.js/api/session-delegate.d.ts +0 -79
  45. package/dist/lib/types/lib/sip.js/api/session-description-handler-factory.d.ts +0 -15
  46. package/dist/lib/types/lib/sip.js/api/session-description-handler.d.ts +0 -74
  47. package/dist/lib/types/lib/sip.js/api/session-info-options.d.ts +0 -11
  48. package/dist/lib/types/lib/sip.js/api/session-invite-options.d.ts +0 -28
  49. package/dist/lib/types/lib/sip.js/api/session-message-options.d.ts +0 -11
  50. package/dist/lib/types/lib/sip.js/api/session-options.d.ts +0 -8
  51. package/dist/lib/types/lib/sip.js/api/session-refer-options.d.ts +0 -14
  52. package/dist/lib/types/lib/sip.js/api/session-state.d.ts +0 -45
  53. package/dist/lib/types/lib/sip.js/api/session.d.ts +0 -359
  54. package/dist/lib/types/lib/sip.js/api/subscriber-options.d.ts +0 -11
  55. package/dist/lib/types/lib/sip.js/api/subscriber-subscribe-options.d.ts +0 -6
  56. package/dist/lib/types/lib/sip.js/api/subscriber.d.ts +0 -94
  57. package/dist/lib/types/lib/sip.js/api/subscription-delegate.d.ts +0 -12
  58. package/dist/lib/types/lib/sip.js/api/subscription-options.d.ts +0 -8
  59. package/dist/lib/types/lib/sip.js/api/subscription-state.d.ts +0 -19
  60. package/dist/lib/types/lib/sip.js/api/subscription-subscribe-options.d.ts +0 -6
  61. package/dist/lib/types/lib/sip.js/api/subscription-unsubscribe-options.d.ts +0 -6
  62. package/dist/lib/types/lib/sip.js/api/subscription.d.ts +0 -84
  63. package/dist/lib/types/lib/sip.js/api/transport-state.d.ts +0 -37
  64. package/dist/lib/types/lib/sip.js/api/transport.d.ts +0 -159
  65. package/dist/lib/types/lib/sip.js/api/user-agent-delegate.d.ts +0 -84
  66. package/dist/lib/types/lib/sip.js/api/user-agent-options.d.ts +0 -253
  67. package/dist/lib/types/lib/sip.js/api/user-agent-state.d.ts +0 -14
  68. package/dist/lib/types/lib/sip.js/api/user-agent.d.ts +0 -200
  69. package/dist/lib/types/lib/sip.js/core/dialogs/dialog-state.d.ts +0 -34
  70. package/dist/lib/types/lib/sip.js/core/dialogs/dialog.d.ts +0 -161
  71. package/dist/lib/types/lib/sip.js/core/dialogs/index.d.ts +0 -4
  72. package/dist/lib/types/lib/sip.js/core/dialogs/session-dialog.d.ts +0 -196
  73. package/dist/lib/types/lib/sip.js/core/dialogs/subscription-dialog.d.ts +0 -120
  74. package/dist/lib/types/lib/sip.js/core/exceptions/exception.d.ts +0 -8
  75. package/dist/lib/types/lib/sip.js/core/exceptions/index.d.ts +0 -3
  76. package/dist/lib/types/lib/sip.js/core/exceptions/transaction-state-error.d.ts +0 -8
  77. package/dist/lib/types/lib/sip.js/core/exceptions/transport-error.d.ts +0 -8
  78. package/dist/lib/types/lib/sip.js/core/index.d.ts +0 -15
  79. package/dist/lib/types/lib/sip.js/core/log/index.d.ts +0 -3
  80. package/dist/lib/types/lib/sip.js/core/log/levels.d.ts +0 -10
  81. package/dist/lib/types/lib/sip.js/core/log/logger-factory.d.ts +0 -21
  82. package/dist/lib/types/lib/sip.js/core/log/logger.d.ts +0 -19
  83. package/dist/lib/types/lib/sip.js/core/messages/body.d.ts +0 -64
  84. package/dist/lib/types/lib/sip.js/core/messages/digest-authentication.d.ts +0 -51
  85. package/dist/lib/types/lib/sip.js/core/messages/incoming-message.d.ts +0 -79
  86. package/dist/lib/types/lib/sip.js/core/messages/incoming-request-message.d.ts +0 -10
  87. package/dist/lib/types/lib/sip.js/core/messages/incoming-request.d.ts +0 -67
  88. package/dist/lib/types/lib/sip.js/core/messages/incoming-response-message.d.ts +0 -10
  89. package/dist/lib/types/lib/sip.js/core/messages/incoming-response.d.ts +0 -12
  90. package/dist/lib/types/lib/sip.js/core/messages/index.d.ts +0 -13
  91. package/dist/lib/types/lib/sip.js/core/messages/md5.d.ts +0 -32
  92. package/dist/lib/types/lib/sip.js/core/messages/methods/ack.d.ts +0 -18
  93. package/dist/lib/types/lib/sip.js/core/messages/methods/bye.d.ts +0 -21
  94. package/dist/lib/types/lib/sip.js/core/messages/methods/cancel.d.ts +0 -21
  95. package/dist/lib/types/lib/sip.js/core/messages/methods/constants.d.ts +0 -20
  96. package/dist/lib/types/lib/sip.js/core/messages/methods/index.d.ts +0 -13
  97. package/dist/lib/types/lib/sip.js/core/messages/methods/info.d.ts +0 -21
  98. package/dist/lib/types/lib/sip.js/core/messages/methods/invite.d.ts +0 -86
  99. package/dist/lib/types/lib/sip.js/core/messages/methods/message.d.ts +0 -21
  100. package/dist/lib/types/lib/sip.js/core/messages/methods/notify.d.ts +0 -21
  101. package/dist/lib/types/lib/sip.js/core/messages/methods/prack.d.ts +0 -21
  102. package/dist/lib/types/lib/sip.js/core/messages/methods/publish.d.ts +0 -21
  103. package/dist/lib/types/lib/sip.js/core/messages/methods/refer.d.ts +0 -21
  104. package/dist/lib/types/lib/sip.js/core/messages/methods/register.d.ts +0 -21
  105. package/dist/lib/types/lib/sip.js/core/messages/methods/subscribe.d.ts +0 -54
  106. package/dist/lib/types/lib/sip.js/core/messages/outgoing-request-message.d.ts +0 -94
  107. package/dist/lib/types/lib/sip.js/core/messages/outgoing-request.d.ts +0 -67
  108. package/dist/lib/types/lib/sip.js/core/messages/outgoing-response.d.ts +0 -42
  109. package/dist/lib/types/lib/sip.js/core/messages/parser.d.ts +0 -14
  110. package/dist/lib/types/lib/sip.js/core/messages/utils.d.ts +0 -24
  111. package/dist/lib/types/lib/sip.js/core/session/index.d.ts +0 -2
  112. package/dist/lib/types/lib/sip.js/core/session/session-delegate.d.ts +0 -70
  113. package/dist/lib/types/lib/sip.js/core/session/session.d.ts +0 -134
  114. package/dist/lib/types/lib/sip.js/core/subscription/index.d.ts +0 -2
  115. package/dist/lib/types/lib/sip.js/core/subscription/subscription-delegate.d.ts +0 -27
  116. package/dist/lib/types/lib/sip.js/core/subscription/subscription.d.ts +0 -55
  117. package/dist/lib/types/lib/sip.js/core/timers.d.ts +0 -20
  118. package/dist/lib/types/lib/sip.js/core/transactions/client-transaction.d.ts +0 -45
  119. package/dist/lib/types/lib/sip.js/core/transactions/index.d.ts +0 -10
  120. package/dist/lib/types/lib/sip.js/core/transactions/invite-client-transaction.d.ts +0 -116
  121. package/dist/lib/types/lib/sip.js/core/transactions/invite-server-transaction.d.ts +0 -127
  122. package/dist/lib/types/lib/sip.js/core/transactions/non-invite-client-transaction.d.ts +0 -69
  123. package/dist/lib/types/lib/sip.js/core/transactions/non-invite-server-transaction.d.ts +0 -57
  124. package/dist/lib/types/lib/sip.js/core/transactions/server-transaction.d.ts +0 -35
  125. package/dist/lib/types/lib/sip.js/core/transactions/transaction-state.d.ts +0 -13
  126. package/dist/lib/types/lib/sip.js/core/transactions/transaction-user.d.ts +0 -72
  127. package/dist/lib/types/lib/sip.js/core/transactions/transaction.d.ts +0 -79
  128. package/dist/lib/types/lib/sip.js/core/transport.d.ts +0 -31
  129. package/dist/lib/types/lib/sip.js/core/user-agent-core/allowed-methods.d.ts +0 -4
  130. package/dist/lib/types/lib/sip.js/core/user-agent-core/index.d.ts +0 -3
  131. package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core-configuration.d.ts +0 -99
  132. package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core-delegate.d.ts +0 -37
  133. package/dist/lib/types/lib/sip.js/core/user-agent-core/user-agent-core.d.ts +0 -179
  134. package/dist/lib/types/lib/sip.js/core/user-agents/bye-user-agent-client.d.ts +0 -10
  135. package/dist/lib/types/lib/sip.js/core/user-agents/bye-user-agent-server.d.ts +0 -10
  136. package/dist/lib/types/lib/sip.js/core/user-agents/cancel-user-agent-client.d.ts +0 -10
  137. package/dist/lib/types/lib/sip.js/core/user-agents/index.d.ts +0 -26
  138. package/dist/lib/types/lib/sip.js/core/user-agents/info-user-agent-client.d.ts +0 -10
  139. package/dist/lib/types/lib/sip.js/core/user-agents/info-user-agent-server.d.ts +0 -10
  140. package/dist/lib/types/lib/sip.js/core/user-agents/invite-user-agent-client.d.ts +0 -35
  141. package/dist/lib/types/lib/sip.js/core/user-agents/invite-user-agent-server.d.ts +0 -77
  142. package/dist/lib/types/lib/sip.js/core/user-agents/message-user-agent-client.d.ts +0 -10
  143. package/dist/lib/types/lib/sip.js/core/user-agents/message-user-agent-server.d.ts +0 -10
  144. package/dist/lib/types/lib/sip.js/core/user-agents/notify-user-agent-client.d.ts +0 -10
  145. package/dist/lib/types/lib/sip.js/core/user-agents/notify-user-agent-server.d.ts +0 -16
  146. package/dist/lib/types/lib/sip.js/core/user-agents/prack-user-agent-client.d.ts +0 -10
  147. package/dist/lib/types/lib/sip.js/core/user-agents/prack-user-agent-server.d.ts +0 -16
  148. package/dist/lib/types/lib/sip.js/core/user-agents/publish-user-agent-client.d.ts +0 -10
  149. package/dist/lib/types/lib/sip.js/core/user-agents/re-invite-user-agent-client.d.ts +0 -18
  150. package/dist/lib/types/lib/sip.js/core/user-agents/re-invite-user-agent-server.d.ts +0 -41
  151. package/dist/lib/types/lib/sip.js/core/user-agents/re-subscribe-user-agent-client.d.ts +0 -17
  152. package/dist/lib/types/lib/sip.js/core/user-agents/re-subscribe-user-agent-server.d.ts +0 -10
  153. package/dist/lib/types/lib/sip.js/core/user-agents/refer-user-agent-client.d.ts +0 -10
  154. package/dist/lib/types/lib/sip.js/core/user-agents/refer-user-agent-server.d.ts +0 -16
  155. package/dist/lib/types/lib/sip.js/core/user-agents/register-user-agent-client.d.ts +0 -10
  156. package/dist/lib/types/lib/sip.js/core/user-agents/register-user-agent-server.d.ts +0 -11
  157. package/dist/lib/types/lib/sip.js/core/user-agents/subscribe-user-agent-client.d.ts +0 -65
  158. package/dist/lib/types/lib/sip.js/core/user-agents/subscribe-user-agent-server.d.ts +0 -11
  159. package/dist/lib/types/lib/sip.js/core/user-agents/user-agent-client.d.ts +0 -103
  160. package/dist/lib/types/lib/sip.js/core/user-agents/user-agent-server.d.ts +0 -79
  161. package/dist/lib/types/lib/sip.js/grammar/grammar.d.ts +0 -26
  162. package/dist/lib/types/lib/sip.js/grammar/index.d.ts +0 -4
  163. package/dist/lib/types/lib/sip.js/grammar/name-addr-header.d.ts +0 -24
  164. package/dist/lib/types/lib/sip.js/grammar/parameters.d.ts +0 -16
  165. package/dist/lib/types/lib/sip.js/grammar/pegjs/dist/grammar.d.ts +0 -50
  166. package/dist/lib/types/lib/sip.js/grammar/uri.d.ts +0 -62
  167. package/dist/lib/types/lib/sip.js/index.d.ts +0 -9
  168. package/dist/lib/types/lib/sip.js/platform/web/index.d.ts +0 -4
  169. package/dist/lib/types/lib/sip.js/platform/web/modifiers/index.d.ts +0 -5
  170. package/dist/lib/types/lib/sip.js/platform/web/modifiers/modifiers.d.ts +0 -41
  171. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/index.d.ts +0 -14
  172. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/media-stream-factory-default.d.ts +0 -6
  173. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/media-stream-factory.d.ts +0 -6
  174. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/peer-connection-configuration-default.d.ts +0 -5
  175. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/peer-connection-delegate.d.ts +0 -63
  176. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-configuration.d.ts +0 -16
  177. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-default.d.ts +0 -11
  178. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-options.d.ts +0 -9
  179. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory.d.ts +0 -16
  180. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler-options.d.ts +0 -47
  181. package/dist/lib/types/lib/sip.js/platform/web/session-description-handler/session-description-handler.d.ts +0 -212
  182. package/dist/lib/types/lib/sip.js/platform/web/simple-user/index.d.ts +0 -7
  183. package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user-delegate.d.ts +0 -72
  184. package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user-options.d.ts +0 -90
  185. package/dist/lib/types/lib/sip.js/platform/web/simple-user/simple-user.d.ts +0 -226
  186. package/dist/lib/types/lib/sip.js/platform/web/transport/index.d.ts +0 -6
  187. package/dist/lib/types/lib/sip.js/platform/web/transport/transport-options.d.ts +0 -30
  188. package/dist/lib/types/lib/sip.js/platform/web/transport/transport.d.ts +0 -125
  189. package/dist/lib/types/lib/sip.js/version.d.ts +0 -1
  190. package/dist/lib/types/webrtc/webrtc-method.d.ts +0 -2
  191. package/dist/lib/types/webrtc/webrtc.d.ts +0 -38
  192. package/index.html/index.html +0 -118
  193. package/nginx.conf +0 -56
  194. package/rollup-new.config.mjs +0 -20
  195. package/rollup.config.js +0 -45
  196. package/src/config.ts +0 -19
  197. package/src/index.ts +0 -2473
  198. package/src/lib/sip.js/api/ack.ts +0 -15
  199. package/src/lib/sip.js/api/api-extractor.json +0 -350
  200. package/src/lib/sip.js/api/bye.ts +0 -27
  201. package/src/lib/sip.js/api/dtmf.ts +0 -27
  202. package/src/lib/sip.js/api/emitter.ts +0 -110
  203. package/src/lib/sip.js/api/exceptions/content-type-unsupported.ts +0 -11
  204. package/src/lib/sip.js/api/exceptions/index.ts +0 -5
  205. package/src/lib/sip.js/api/exceptions/request-pending.ts +0 -12
  206. package/src/lib/sip.js/api/exceptions/session-description-handler.ts +0 -11
  207. package/src/lib/sip.js/api/exceptions/session-terminated.ts +0 -11
  208. package/src/lib/sip.js/api/exceptions/state-transition.ts +0 -11
  209. package/src/lib/sip.js/api/index.ts +0 -59
  210. package/src/lib/sip.js/api/info.ts +0 -27
  211. package/src/lib/sip.js/api/invitation-accept-options.ts +0 -20
  212. package/src/lib/sip.js/api/invitation-progress-options.ts +0 -36
  213. package/src/lib/sip.js/api/invitation-reject-options.ts +0 -22
  214. package/src/lib/sip.js/api/invitation.ts +0 -815
  215. package/src/lib/sip.js/api/inviter-cancel-options.ts +0 -9
  216. package/src/lib/sip.js/api/inviter-invite-options.ts +0 -29
  217. package/src/lib/sip.js/api/inviter-options.ts +0 -44
  218. package/src/lib/sip.js/api/inviter.ts +0 -1126
  219. package/src/lib/sip.js/api/message.ts +0 -27
  220. package/src/lib/sip.js/api/messager-message-options.ts +0 -12
  221. package/src/lib/sip.js/api/messager-options.ts +0 -18
  222. package/src/lib/sip.js/api/messager.ts +0 -89
  223. package/src/lib/sip.js/api/notification.ts +0 -27
  224. package/src/lib/sip.js/api/notifier.ts +0 -7
  225. package/src/lib/sip.js/api/publisher-options.ts +0 -34
  226. package/src/lib/sip.js/api/publisher-publish-options.ts +0 -6
  227. package/src/lib/sip.js/api/publisher-state.ts +0 -21
  228. package/src/lib/sip.js/api/publisher-unpublish-options.ts +0 -6
  229. package/src/lib/sip.js/api/publisher.ts +0 -421
  230. package/src/lib/sip.js/api/referral.ts +0 -89
  231. package/src/lib/sip.js/api/registerer-options.ts +0 -55
  232. package/src/lib/sip.js/api/registerer-register-options.ts +0 -12
  233. package/src/lib/sip.js/api/registerer-state.ts +0 -21
  234. package/src/lib/sip.js/api/registerer-unregister-options.ts +0 -17
  235. package/src/lib/sip.js/api/registerer.ts +0 -819
  236. package/src/lib/sip.js/api/session-bye-options.ts +0 -12
  237. package/src/lib/sip.js/api/session-delegate.ts +0 -87
  238. package/src/lib/sip.js/api/session-description-handler-factory.ts +0 -16
  239. package/src/lib/sip.js/api/session-description-handler.ts +0 -89
  240. package/src/lib/sip.js/api/session-info-options.ts +0 -12
  241. package/src/lib/sip.js/api/session-invite-options.ts +0 -29
  242. package/src/lib/sip.js/api/session-message-options.ts +0 -12
  243. package/src/lib/sip.js/api/session-options.ts +0 -8
  244. package/src/lib/sip.js/api/session-refer-options.ts +0 -15
  245. package/src/lib/sip.js/api/session-state.ts +0 -45
  246. package/src/lib/sip.js/api/session.ts +0 -1454
  247. package/src/lib/sip.js/api/subscriber-options.ts +0 -12
  248. package/src/lib/sip.js/api/subscriber-subscribe-options.ts +0 -6
  249. package/src/lib/sip.js/api/subscriber.ts +0 -537
  250. package/src/lib/sip.js/api/subscription-delegate.ts +0 -13
  251. package/src/lib/sip.js/api/subscription-options.ts +0 -8
  252. package/src/lib/sip.js/api/subscription-state.ts +0 -19
  253. package/src/lib/sip.js/api/subscription-subscribe-options.ts +0 -6
  254. package/src/lib/sip.js/api/subscription-unsubscribe-options.ts +0 -6
  255. package/src/lib/sip.js/api/subscription.ts +0 -161
  256. package/src/lib/sip.js/api/transport-state.ts +0 -37
  257. package/src/lib/sip.js/api/transport.ts +0 -169
  258. package/src/lib/sip.js/api/user-agent-delegate.ts +0 -95
  259. package/src/lib/sip.js/api/user-agent-options.ts +0 -322
  260. package/src/lib/sip.js/api/user-agent-state.ts +0 -14
  261. package/src/lib/sip.js/api/user-agent.ts +0 -1013
  262. package/src/lib/sip.js/core/api-extractor.json +0 -350
  263. package/src/lib/sip.js/core/dialogs/dialog-state.ts +0 -35
  264. package/src/lib/sip.js/core/dialogs/dialog.ts +0 -605
  265. package/src/lib/sip.js/core/dialogs/index.ts +0 -4
  266. package/src/lib/sip.js/core/dialogs/session-dialog.ts +0 -997
  267. package/src/lib/sip.js/core/dialogs/subscription-dialog.ts +0 -558
  268. package/src/lib/sip.js/core/exceptions/exception.ts +0 -11
  269. package/src/lib/sip.js/core/exceptions/index.ts +0 -3
  270. package/src/lib/sip.js/core/exceptions/transaction-state-error.ts +0 -11
  271. package/src/lib/sip.js/core/exceptions/transport-error.ts +0 -11
  272. package/src/lib/sip.js/core/index.ts +0 -19
  273. package/src/lib/sip.js/core/log/index.ts +0 -3
  274. package/src/lib/sip.js/core/log/levels.ts +0 -10
  275. package/src/lib/sip.js/core/log/logger-factory.ts +0 -119
  276. package/src/lib/sip.js/core/log/logger.ts +0 -42
  277. package/src/lib/sip.js/core/messages/body.ts +0 -171
  278. package/src/lib/sip.js/core/messages/digest-authentication.ts +0 -190
  279. package/src/lib/sip.js/core/messages/incoming-message.ts +0 -152
  280. package/src/lib/sip.js/core/messages/incoming-request-message.ts +0 -14
  281. package/src/lib/sip.js/core/messages/incoming-request.ts +0 -75
  282. package/src/lib/sip.js/core/messages/incoming-response-message.ts +0 -14
  283. package/src/lib/sip.js/core/messages/incoming-response.ts +0 -13
  284. package/src/lib/sip.js/core/messages/index.ts +0 -18
  285. package/src/lib/sip.js/core/messages/md5.ts +0 -437
  286. package/src/lib/sip.js/core/messages/methods/ack.ts +0 -22
  287. package/src/lib/sip.js/core/messages/methods/bye.ts +0 -22
  288. package/src/lib/sip.js/core/messages/methods/cancel.ts +0 -22
  289. package/src/lib/sip.js/core/messages/methods/constants.ts +0 -21
  290. package/src/lib/sip.js/core/messages/methods/index.ts +0 -13
  291. package/src/lib/sip.js/core/messages/methods/info.ts +0 -22
  292. package/src/lib/sip.js/core/messages/methods/invite.ts +0 -104
  293. package/src/lib/sip.js/core/messages/methods/message.ts +0 -22
  294. package/src/lib/sip.js/core/messages/methods/notify.ts +0 -22
  295. package/src/lib/sip.js/core/messages/methods/prack.ts +0 -22
  296. package/src/lib/sip.js/core/messages/methods/publish.ts +0 -22
  297. package/src/lib/sip.js/core/messages/methods/refer.ts +0 -22
  298. package/src/lib/sip.js/core/messages/methods/register.ts +0 -22
  299. package/src/lib/sip.js/core/messages/methods/subscribe.ts +0 -59
  300. package/src/lib/sip.js/core/messages/outgoing-request-message.ts +0 -299
  301. package/src/lib/sip.js/core/messages/outgoing-request.ts +0 -77
  302. package/src/lib/sip.js/core/messages/outgoing-response.ts +0 -174
  303. package/src/lib/sip.js/core/messages/parser.ts +0 -265
  304. package/src/lib/sip.js/core/messages/utils.ts +0 -144
  305. package/src/lib/sip.js/core/session/index.ts +0 -2
  306. package/src/lib/sip.js/core/session/session-delegate.ts +0 -88
  307. package/src/lib/sip.js/core/session/session.ts +0 -158
  308. package/src/lib/sip.js/core/subscription/index.ts +0 -2
  309. package/src/lib/sip.js/core/subscription/subscription-delegate.ts +0 -30
  310. package/src/lib/sip.js/core/subscription/subscription.ts +0 -61
  311. package/src/lib/sip.js/core/timers.ts +0 -24
  312. package/src/lib/sip.js/core/transactions/client-transaction.ts +0 -78
  313. package/src/lib/sip.js/core/transactions/index.ts +0 -10
  314. package/src/lib/sip.js/core/transactions/invite-client-transaction.ts +0 -505
  315. package/src/lib/sip.js/core/transactions/invite-server-transaction.ts +0 -433
  316. package/src/lib/sip.js/core/transactions/non-invite-client-transaction.ts +0 -258
  317. package/src/lib/sip.js/core/transactions/non-invite-server-transaction.ts +0 -242
  318. package/src/lib/sip.js/core/transactions/server-transaction.ts +0 -47
  319. package/src/lib/sip.js/core/transactions/transaction-state.ts +0 -13
  320. package/src/lib/sip.js/core/transactions/transaction-user.ts +0 -82
  321. package/src/lib/sip.js/core/transactions/transaction.ts +0 -149
  322. package/src/lib/sip.js/core/transport.ts +0 -32
  323. package/src/lib/sip.js/core/user-agent-core/allowed-methods.ts +0 -19
  324. package/src/lib/sip.js/core/user-agent-core/index.ts +0 -3
  325. package/src/lib/sip.js/core/user-agent-core/user-agent-core-configuration.ts +0 -111
  326. package/src/lib/sip.js/core/user-agent-core/user-agent-core-delegate.ts +0 -50
  327. package/src/lib/sip.js/core/user-agent-core/user-agent-core.ts +0 -905
  328. package/src/lib/sip.js/core/user-agents/bye-user-agent-client.ts +0 -16
  329. package/src/lib/sip.js/core/user-agents/bye-user-agent-server.ts +0 -14
  330. package/src/lib/sip.js/core/user-agents/cancel-user-agent-client.ts +0 -14
  331. package/src/lib/sip.js/core/user-agents/index.ts +0 -26
  332. package/src/lib/sip.js/core/user-agents/info-user-agent-client.ts +0 -15
  333. package/src/lib/sip.js/core/user-agents/info-user-agent-server.ts +0 -14
  334. package/src/lib/sip.js/core/user-agents/invite-user-agent-client.ts +0 -406
  335. package/src/lib/sip.js/core/user-agents/invite-user-agent-server.ts +0 -269
  336. package/src/lib/sip.js/core/user-agents/message-user-agent-client.ts +0 -14
  337. package/src/lib/sip.js/core/user-agents/message-user-agent-server.ts +0 -14
  338. package/src/lib/sip.js/core/user-agents/notify-user-agent-client.ts +0 -15
  339. package/src/lib/sip.js/core/user-agents/notify-user-agent-server.ts +0 -30
  340. package/src/lib/sip.js/core/user-agents/prack-user-agent-client.ts +0 -16
  341. package/src/lib/sip.js/core/user-agents/prack-user-agent-server.ts +0 -37
  342. package/src/lib/sip.js/core/user-agents/publish-user-agent-client.ts +0 -14
  343. package/src/lib/sip.js/core/user-agents/re-invite-user-agent-client.ts +0 -128
  344. package/src/lib/sip.js/core/user-agents/re-invite-user-agent-server.ts +0 -109
  345. package/src/lib/sip.js/core/user-agents/re-subscribe-user-agent-client.ts +0 -78
  346. package/src/lib/sip.js/core/user-agents/re-subscribe-user-agent-server.ts +0 -14
  347. package/src/lib/sip.js/core/user-agents/refer-user-agent-client.ts +0 -15
  348. package/src/lib/sip.js/core/user-agents/refer-user-agent-server.ts +0 -30
  349. package/src/lib/sip.js/core/user-agents/register-user-agent-client.ts +0 -14
  350. package/src/lib/sip.js/core/user-agents/register-user-agent-server.ts +0 -14
  351. package/src/lib/sip.js/core/user-agents/subscribe-user-agent-client.ts +0 -342
  352. package/src/lib/sip.js/core/user-agents/subscribe-user-agent-server.ts +0 -14
  353. package/src/lib/sip.js/core/user-agents/user-agent-client.ts +0 -378
  354. package/src/lib/sip.js/core/user-agents/user-agent-server.ts +0 -276
  355. package/src/lib/sip.js/grammar/grammar.ts +0 -55
  356. package/src/lib/sip.js/grammar/index.ts +0 -4
  357. package/src/lib/sip.js/grammar/name-addr-header.ts +0 -58
  358. package/src/lib/sip.js/grammar/parameters.ts +0 -45
  359. package/src/lib/sip.js/grammar/pegjs/README.md +0 -9
  360. package/src/lib/sip.js/grammar/pegjs/dist/grammar.ts +0 -1557
  361. package/src/lib/sip.js/grammar/pegjs/src/grammar.pegjs +0 -1009
  362. package/src/lib/sip.js/grammar/uri.ts +0 -370
  363. package/src/lib/sip.js/index.ts +0 -20
  364. package/src/lib/sip.js/platform/react/README.md +0 -1
  365. package/src/lib/sip.js/platform/web/index.ts +0 -4
  366. package/src/lib/sip.js/platform/web/modifiers/index.ts +0 -5
  367. package/src/lib/sip.js/platform/web/modifiers/modifiers.ts +0 -180
  368. package/src/lib/sip.js/platform/web/session-description-handler/api-extractor.json +0 -350
  369. package/src/lib/sip.js/platform/web/session-description-handler/index.ts +0 -14
  370. package/src/lib/sip.js/platform/web/session-description-handler/media-stream-factory-default.ts +0 -22
  371. package/src/lib/sip.js/platform/web/session-description-handler/media-stream-factory.ts +0 -10
  372. package/src/lib/sip.js/platform/web/session-description-handler/peer-connection-configuration-default.ts +0 -17
  373. package/src/lib/sip.js/platform/web/session-description-handler/peer-connection-delegate.ts +0 -72
  374. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-configuration.ts +0 -17
  375. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-default.ts +0 -45
  376. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory-options.ts +0 -10
  377. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-factory.ts +0 -17
  378. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler-options.ts +0 -56
  379. package/src/lib/sip.js/platform/web/session-description-handler/session-description-handler.ts +0 -938
  380. package/src/lib/sip.js/platform/web/simple-user/api-extractor.json +0 -350
  381. package/src/lib/sip.js/platform/web/simple-user/index.ts +0 -7
  382. package/src/lib/sip.js/platform/web/simple-user/simple-user-delegate.ts +0 -82
  383. package/src/lib/sip.js/platform/web/simple-user/simple-user-options.ts +0 -102
  384. package/src/lib/sip.js/platform/web/simple-user/simple-user.ts +0 -1099
  385. package/src/lib/sip.js/platform/web/transport/api-extractor.json +0 -350
  386. package/src/lib/sip.js/platform/web/transport/index.ts +0 -6
  387. package/src/lib/sip.js/platform/web/transport/transport-options.ts +0 -34
  388. package/src/lib/sip.js/platform/web/transport/transport.ts +0 -743
  389. package/src/lib/sip.js/version.ts +0 -1
  390. package/src/lib/socket.io.esm.min.js +0 -7
  391. package/src/webrtc/webrtc-method.ts +0 -49
  392. package/src/webrtc/webrtc.ts +0 -350
  393. package/tsconfig.json +0 -21
@@ -1,174 +0,0 @@
1
- import { Body } from "./body";
2
- import { IncomingRequestMessage } from "./incoming-request-message";
3
- import { getReasonPhrase, newTag, utf8Length } from "./utils";
4
-
5
- /**
6
- * A SIP message sent from a local server to a remote client.
7
- * @remarks
8
- * For indicating the status of a request sent from the client to the server.
9
- * https://tools.ietf.org/html/rfc3261#section-7.2
10
- * @public
11
- */
12
- export interface OutgoingResponse {
13
- /** The outgoing message. */
14
- readonly message: string;
15
- }
16
-
17
- /**
18
- * Response options bucket.
19
- * @public
20
- */
21
- export interface ResponseOptions {
22
- /** Status code of the response. */
23
- statusCode: number;
24
- /** Reason phrase of the response. */
25
- reasonPhrase?: string;
26
- /** To tag of the response. If not provided, one is generated. */
27
- toTag?: string;
28
- /** User agent string for User-Agent header. */
29
- userAgent?: string;
30
- /** Support options tags for Supported header. */
31
- supported?: Array<string>;
32
- /** Extra headers to include in the message. */
33
- extraHeaders?: Array<string>;
34
- /** Body to include in the message. */
35
- body?: Body;
36
- }
37
-
38
- /**
39
- * When a UAS wishes to construct a response to a request, it follows
40
- * the general procedures detailed in the following subsections.
41
- * Additional behaviors specific to the response code in question, which
42
- * are not detailed in this section, may also be required.
43
- * https://tools.ietf.org/html/rfc3261#section-8.2.6
44
- * @internal
45
- */
46
- export function constructOutgoingResponse(message: IncomingRequestMessage, options: ResponseOptions): OutgoingResponse {
47
- const CRLF = "\r\n";
48
-
49
- if (options.statusCode < 100 || options.statusCode > 699) {
50
- throw new TypeError("Invalid statusCode: " + options.statusCode);
51
- }
52
- const reasonPhrase = options.reasonPhrase ? options.reasonPhrase : getReasonPhrase(options.statusCode);
53
-
54
- // SIP responses are distinguished from requests by having a Status-Line
55
- // as their start-line. A Status-Line consists of the protocol version
56
- // followed by a numeric Status-Code and its associated textual phrase,
57
- // with each element separated by a single SP character.
58
- // https://tools.ietf.org/html/rfc3261#section-7.2
59
- let response = "SIP/2.0 " + options.statusCode + " " + reasonPhrase + CRLF;
60
-
61
- // One largely non-method-specific guideline for the generation of
62
- // responses is that UASs SHOULD NOT issue a provisional response for a
63
- // non-INVITE request. Rather, UASs SHOULD generate a final response to
64
- // a non-INVITE request as soon as possible.
65
- // https://tools.ietf.org/html/rfc3261#section-8.2.6.1
66
- if (options.statusCode >= 100 && options.statusCode < 200) {
67
- // TODO
68
- }
69
-
70
- // When a 100 (Trying) response is generated, any Timestamp header field
71
- // present in the request MUST be copied into this 100 (Trying)
72
- // response. If there is a delay in generating the response, the UAS
73
- // SHOULD add a delay value into the Timestamp value in the response.
74
- // This value MUST contain the difference between the time of sending of
75
- // the response and receipt of the request, measured in seconds.
76
- // https://tools.ietf.org/html/rfc3261#section-8.2.6.1
77
- if (options.statusCode === 100) {
78
- // TODO
79
- }
80
-
81
- // The From field of the response MUST equal the From header field of
82
- // the request. The Call-ID header field of the response MUST equal the
83
- // Call-ID header field of the request. The CSeq header field of the
84
- // response MUST equal the CSeq field of the request. The Via header
85
- // field values in the response MUST equal the Via header field values
86
- // in the request and MUST maintain the same ordering.
87
- // https://tools.ietf.org/html/rfc3261#section-8.2.6.2
88
- const fromHeader = "From: " + message.getHeader("From") + CRLF;
89
- const callIdHeader = "Call-ID: " + message.callId + CRLF;
90
- const cSeqHeader = "CSeq: " + message.cseq + " " + message.method + CRLF;
91
- const viaHeaders = message.getHeaders("via").reduce((previous, current) => {
92
- return previous + "Via: " + current + CRLF;
93
- }, "");
94
-
95
- // If a request contained a To tag in the request, the To header field
96
- // in the response MUST equal that of the request. However, if the To
97
- // header field in the request did not contain a tag, the URI in the To
98
- // header field in the response MUST equal the URI in the To header
99
- // field; additionally, the UAS MUST add a tag to the To header field in
100
- // the response (with the exception of the 100 (Trying) response, in
101
- // which a tag MAY be present). This serves to identify the UAS that is
102
- // responding, possibly resulting in a component of a dialog ID. The
103
- // same tag MUST be used for all responses to that request, both final
104
- // and provisional (again excepting the 100 (Trying)).
105
- // https://tools.ietf.org/html/rfc3261#section-8.2.6.2
106
- let toHeader = "To: " + message.getHeader("to");
107
- if (options.statusCode > 100 && !message.parseHeader("to").hasParam("tag")) {
108
- let toTag = options.toTag;
109
- if (!toTag) {
110
- // Stateless UAS Behavior...
111
- // o To header tags MUST be generated for responses in a stateless
112
- // manner - in a manner that will generate the same tag for the
113
- // same request consistently. For information on tag construction
114
- // see Section 19.3.
115
- // https://tools.ietf.org/html/rfc3261#section-8.2.7
116
- toTag = newTag(); // FIXME: newTag() currently generates random tags
117
- }
118
- toHeader += ";tag=" + toTag;
119
- }
120
- toHeader += CRLF;
121
-
122
- // FIXME: TODO: needs review... moved to InviteUserAgentServer (as it is specific to that)
123
- // let recordRouteHeaders = "";
124
- // if (request.method === C.INVITE && statusCode > 100 && statusCode <= 200) {
125
- // recordRouteHeaders = request.getHeaders("record-route").reduce((previous, current) => {
126
- // return previous + "Record-Route: " + current + CRLF;
127
- // }, "");
128
- // }
129
-
130
- // FIXME: TODO: needs review...
131
- let supportedHeader = "";
132
- if (options.supported) {
133
- supportedHeader = "Supported: " + options.supported.join(", ") + CRLF;
134
- }
135
-
136
- // FIXME: TODO: needs review...
137
- let userAgentHeader = "";
138
- if (options.userAgent) {
139
- userAgentHeader = "User-Agent: " + options.userAgent + CRLF;
140
- }
141
-
142
- let extensionHeaders = "";
143
- if (options.extraHeaders) {
144
- extensionHeaders = options.extraHeaders.reduce((previous, current) => {
145
- return previous + current.trim() + CRLF;
146
- }, "");
147
- }
148
-
149
- // The relative order of header fields with different field names is not
150
- // significant. However, it is RECOMMENDED that header fields which are
151
- // needed for proxy processing (Via, Route, Record-Route, Proxy-Require,
152
- // Max-Forwards, and Proxy-Authorization, for example) appear towards
153
- // the top of the message to facilitate rapid parsing.
154
- // https://tools.ietf.org/html/rfc3261#section-7.3.1
155
- // response += recordRouteHeaders;
156
- response += viaHeaders;
157
- response += fromHeader;
158
- response += toHeader;
159
- response += cSeqHeader;
160
- response += callIdHeader;
161
- response += supportedHeader;
162
- response += userAgentHeader;
163
- response += extensionHeaders;
164
-
165
- if (options.body) {
166
- response += "Content-Type: " + options.body.contentType + CRLF;
167
- response += "Content-Length: " + utf8Length(options.body.content) + CRLF + CRLF;
168
- response += options.body.content;
169
- } else {
170
- response += "Content-Length: " + 0 + CRLF + CRLF;
171
- }
172
-
173
- return { message: response };
174
- }
@@ -1,265 +0,0 @@
1
- /* eslint-disable no-inner-declarations */
2
- /* eslint-disable @typescript-eslint/no-namespace */
3
- import { Grammar } from "../../grammar";
4
- import { Logger } from "../log/logger";
5
- import { IncomingRequestMessage } from "./incoming-request-message";
6
- import { IncomingResponseMessage } from "./incoming-response-message";
7
-
8
- /**
9
- * Extract and parse every header of a SIP message.
10
- * @internal
11
- */
12
- export namespace Parser {
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
- export function getHeader(data: any, headerStart: number): number {
15
- // 'start' position of the header.
16
- let start: number = headerStart;
17
- // 'end' position of the header.
18
- let end = 0;
19
- // 'partial end' position of the header.
20
- let partialEnd = 0;
21
-
22
- // End of message.
23
- if (data.substring(start, start + 2).match(/(^\r\n)/)) {
24
- return -2;
25
- }
26
-
27
- while (end === 0) {
28
- // Partial End of Header.
29
- partialEnd = data.indexOf("\r\n", start);
30
-
31
- // 'indexOf' returns -1 if the value to be found never occurs.
32
- if (partialEnd === -1) {
33
- return partialEnd;
34
- }
35
-
36
- if (
37
- !data.substring(partialEnd + 2, partialEnd + 4).match(/(^\r\n)/) &&
38
- data.charAt(partialEnd + 2).match(/(^\s+)/)
39
- ) {
40
- // Not the end of the message. Continue from the next position.
41
- start = partialEnd + 2;
42
- } else {
43
- end = partialEnd;
44
- }
45
- }
46
-
47
- return end;
48
- }
49
-
50
- export function parseHeader(
51
- message: IncomingRequestMessage | IncomingResponseMessage,
52
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
53
- data: any,
54
- headerStart: number,
55
- headerEnd: number
56
- ): boolean | { error: string } {
57
- const hcolonIndex: number = data.indexOf(":", headerStart);
58
- const headerName: string = data.substring(headerStart, hcolonIndex).trim();
59
- const headerValue: string = data.substring(hcolonIndex + 1, headerEnd).trim();
60
-
61
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
- let parsed: any;
63
- // If header-field is well-known, parse it.
64
- switch (headerName.toLowerCase()) {
65
- case "via":
66
- case "v":
67
- message.addHeader("via", headerValue);
68
- if (message.getHeaders("via").length === 1) {
69
- parsed = message.parseHeader("Via");
70
- if (parsed) {
71
- message.via = parsed;
72
- message.viaBranch = parsed.branch;
73
- }
74
- } else {
75
- parsed = 0;
76
- }
77
- break;
78
- case "from":
79
- case "f":
80
- message.setHeader("from", headerValue);
81
- parsed = message.parseHeader("from");
82
- if (parsed) {
83
- message.from = parsed;
84
- message.fromTag = parsed.getParam("tag");
85
- }
86
- break;
87
- case "to":
88
- case "t":
89
- message.setHeader("to", headerValue);
90
- parsed = message.parseHeader("to");
91
- if (parsed) {
92
- message.to = parsed;
93
- message.toTag = parsed.getParam("tag");
94
- }
95
- break;
96
- case "record-route":
97
- parsed = Grammar.parse(headerValue, "Record_Route");
98
-
99
- if (parsed === -1) {
100
- parsed = undefined;
101
- break;
102
- }
103
- if (!(parsed instanceof Array)) {
104
- parsed = undefined;
105
- break;
106
- }
107
-
108
- parsed.forEach((header) => {
109
- message.addHeader("record-route", headerValue.substring(header.position, header.offset));
110
- message.headers["Record-Route"][message.getHeaders("record-route").length - 1].parsed = header.parsed;
111
- });
112
- break;
113
- case "call-id":
114
- case "i":
115
- message.setHeader("call-id", headerValue);
116
- parsed = message.parseHeader("call-id");
117
- if (parsed) {
118
- message.callId = headerValue;
119
- }
120
- break;
121
- case "contact":
122
- case "m":
123
- parsed = Grammar.parse(headerValue, "Contact");
124
-
125
- if (parsed === -1) {
126
- parsed = undefined;
127
- break;
128
- }
129
- if (!(parsed instanceof Array)) {
130
- parsed = undefined;
131
- break;
132
- }
133
-
134
- parsed.forEach((header) => {
135
- message.addHeader("contact", headerValue.substring(header.position, header.offset));
136
- message.headers.Contact[message.getHeaders("contact").length - 1].parsed = header.parsed;
137
- });
138
- break;
139
- case "content-length":
140
- case "l":
141
- message.setHeader("content-length", headerValue);
142
- parsed = message.parseHeader("content-length");
143
- break;
144
- case "content-type":
145
- case "c":
146
- message.setHeader("content-type", headerValue);
147
- parsed = message.parseHeader("content-type");
148
- break;
149
- case "cseq":
150
- message.setHeader("cseq", headerValue);
151
- parsed = message.parseHeader("cseq");
152
- if (parsed) {
153
- message.cseq = parsed.value;
154
- }
155
- if (message instanceof IncomingResponseMessage) {
156
- message.method = parsed.method;
157
- }
158
- break;
159
- case "max-forwards":
160
- message.setHeader("max-forwards", headerValue);
161
- parsed = message.parseHeader("max-forwards");
162
- break;
163
- case "www-authenticate":
164
- message.setHeader("www-authenticate", headerValue);
165
- parsed = message.parseHeader("www-authenticate");
166
- break;
167
- case "proxy-authenticate":
168
- message.setHeader("proxy-authenticate", headerValue);
169
- parsed = message.parseHeader("proxy-authenticate");
170
- break;
171
- case "refer-to":
172
- case "r":
173
- message.setHeader("refer-to", headerValue);
174
- parsed = message.parseHeader("refer-to");
175
- if (parsed) {
176
- message.referTo = parsed;
177
- }
178
- break;
179
- default:
180
- // Do not parse this header.
181
- message.addHeader(headerName.toLowerCase(), headerValue);
182
- parsed = 0;
183
- }
184
-
185
- if (parsed === undefined) {
186
- return {
187
- error: "error parsing header '" + headerName + "'"
188
- };
189
- } else {
190
- return true;
191
- }
192
- }
193
-
194
- export function parseMessage(
195
- data: string,
196
- logger: Logger
197
- ): IncomingRequestMessage | IncomingResponseMessage | undefined {
198
- let headerStart = 0;
199
- let headerEnd: number = data.indexOf("\r\n");
200
-
201
- if (headerEnd === -1) {
202
- logger.warn("no CRLF found, not a SIP message, discarded");
203
- return;
204
- }
205
-
206
- // Parse first line. Check if it is a Request or a Reply.
207
- const firstLine: string = data.substring(0, headerEnd);
208
- const parsed = Grammar.parse(firstLine, "Request_Response");
209
- let message: IncomingRequestMessage | IncomingResponseMessage;
210
-
211
- if (parsed === -1) {
212
- logger.warn('error parsing first line of SIP message: "' + firstLine + '"');
213
- return;
214
- } else if (!parsed.status_code) {
215
- message = new IncomingRequestMessage();
216
- message.method = parsed.method;
217
- message.ruri = parsed.uri;
218
- } else {
219
- message = new IncomingResponseMessage();
220
- message.statusCode = parsed.status_code;
221
- message.reasonPhrase = parsed.reason_phrase;
222
- }
223
-
224
- message.data = data;
225
- headerStart = headerEnd + 2;
226
-
227
- // Loop over every line in data. Detect the end of each header and parse
228
- // it or simply add to the headers collection.
229
- let bodyStart: number;
230
- // eslint-disable-next-line no-constant-condition
231
- while (true) {
232
- headerEnd = getHeader(data, headerStart);
233
-
234
- // The SIP message has normally finished.
235
- if (headerEnd === -2) {
236
- bodyStart = headerStart + 2;
237
- break;
238
- } else if (headerEnd === -1) {
239
- // data.indexOf returned -1 due to a malformed message.
240
- logger.error("malformed message");
241
- return;
242
- }
243
-
244
- const parsedHeader = parseHeader(message, data, headerStart, headerEnd);
245
-
246
- if (parsedHeader && parsedHeader !== true) {
247
- logger.error(parsedHeader.error);
248
- return;
249
- }
250
-
251
- headerStart = headerEnd + 2;
252
- }
253
-
254
- // RFC3261 18.3.
255
- // If there are additional bytes in the transport packet
256
- // beyond the end of the body, they MUST be discarded.
257
- if (message.hasHeader("content-length")) {
258
- message.body = data.substr(bodyStart, Number(message.getHeader("content-length")));
259
- } else {
260
- message.body = data.substring(bodyStart);
261
- }
262
-
263
- return message;
264
- }
265
- }
@@ -1,144 +0,0 @@
1
- /**
2
- * SIP Response Reasons
3
- * DOC: http://www.iana.org/assignments/sip-parameters
4
- * @internal
5
- */
6
- const REASON_PHRASE: { [code: number]: string } = {
7
- 100: "Trying",
8
- 180: "Ringing",
9
- 181: "Call Is Being Forwarded",
10
- 182: "Queued",
11
- 183: "Session Progress",
12
- 199: "Early Dialog Terminated", // draft-ietf-sipcore-199
13
- 200: "OK",
14
- 202: "Accepted", // RFC 3265
15
- 204: "No Notification", // RFC 5839
16
- 300: "Multiple Choices",
17
- 301: "Moved Permanently",
18
- 302: "Moved Temporarily",
19
- 305: "Use Proxy",
20
- 380: "Alternative Service",
21
- 400: "Bad Request",
22
- 401: "Unauthorized",
23
- 402: "Payment Required",
24
- 403: "Forbidden",
25
- 404: "Not Found",
26
- 405: "Method Not Allowed",
27
- 406: "Not Acceptable",
28
- 407: "Proxy Authentication Required",
29
- 408: "Request Timeout",
30
- 410: "Gone",
31
- 412: "Conditional Request Failed", // RFC 3903
32
- 413: "Request Entity Too Large",
33
- 414: "Request-URI Too Long",
34
- 415: "Unsupported Media Type",
35
- 416: "Unsupported URI Scheme",
36
- 417: "Unknown Resource-Priority", // RFC 4412
37
- 420: "Bad Extension",
38
- 421: "Extension Required",
39
- 422: "Session Interval Too Small", // RFC 4028
40
- 423: "Interval Too Brief",
41
- 428: "Use Identity Header", // RFC 4474
42
- 429: "Provide Referrer Identity", // RFC 3892
43
- 430: "Flow Failed", // RFC 5626
44
- 433: "Anonymity Disallowed", // RFC 5079
45
- 436: "Bad Identity-Info", // RFC 4474
46
- 437: "Unsupported Certificate", // RFC 4744
47
- 438: "Invalid Identity Header", // RFC 4744
48
- 439: "First Hop Lacks Outbound Support", // RFC 5626
49
- 440: "Max-Breadth Exceeded", // RFC 5393
50
- 469: "Bad Info Package", // draft-ietf-sipcore-info-events
51
- 470: "Consent Needed", // RFC 5360
52
- 478: "Unresolvable Destination", // Custom code copied from Kamailio.
53
- 480: "Temporarily Unavailable",
54
- 481: "Call/Transaction Does Not Exist",
55
- 482: "Loop Detected",
56
- 483: "Too Many Hops",
57
- 484: "Address Incomplete",
58
- 485: "Ambiguous",
59
- 486: "Busy Here",
60
- 487: "Request Terminated",
61
- 488: "Not Acceptable Here",
62
- 489: "Bad Event", // RFC 3265
63
- 491: "Request Pending",
64
- 493: "Undecipherable",
65
- 494: "Security Agreement Required", // RFC 3329
66
- 500: "Internal Server Error",
67
- 501: "Not Implemented",
68
- 502: "Bad Gateway",
69
- 503: "Service Unavailable",
70
- 504: "Server Time-out",
71
- 505: "Version Not Supported",
72
- 513: "Message Too Large",
73
- 580: "Precondition Failure", // RFC 3312
74
- 600: "Busy Everywhere",
75
- 603: "Decline",
76
- 604: "Does Not Exist Anywhere",
77
- 606: "Not Acceptable"
78
- };
79
-
80
- /**
81
- * @param size -
82
- * @param base -
83
- * @internal
84
- */
85
- export function createRandomToken(size: number, base = 32): string {
86
- let token = "";
87
- for (let i = 0; i < size; i++) {
88
- const r: number = Math.floor(Math.random() * base);
89
- token += r.toString(base);
90
- }
91
- return token;
92
- }
93
-
94
- /**
95
- * @internal
96
- */
97
- export function getReasonPhrase(code: number): string {
98
- return REASON_PHRASE[code] || "";
99
- }
100
-
101
- /**
102
- * @internal
103
- */
104
- export function newTag(): string {
105
- return createRandomToken(10);
106
- }
107
-
108
- /**
109
- * @param str -
110
- * @internal
111
- */
112
- export function headerize(str: string): string {
113
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
- const exceptions: any = {
115
- "Call-Id": "Call-ID",
116
- Cseq: "CSeq",
117
- "Min-Se": "Min-SE",
118
- Rack: "RAck",
119
- Rseq: "RSeq",
120
- "Www-Authenticate": "WWW-Authenticate"
121
- };
122
- const name: Array<string> = str.toLowerCase().replace(/_/g, "-").split("-");
123
- const parts: number = name.length;
124
- let hname = "";
125
-
126
- for (let part = 0; part < parts; part++) {
127
- if (part !== 0) {
128
- hname += "-";
129
- }
130
- hname += name[part].charAt(0).toUpperCase() + name[part].substring(1);
131
- }
132
- if (exceptions[hname]) {
133
- hname = exceptions[hname];
134
- }
135
- return hname;
136
- }
137
-
138
- /**
139
- * @param str -
140
- * @internal
141
- */
142
- export function utf8Length(str: string): number {
143
- return encodeURIComponent(str).replace(/%[A-F\d]{2}/g, "U").length;
144
- }
@@ -1,2 +0,0 @@
1
- export * from "./session";
2
- export * from "./session-delegate";
@@ -1,88 +0,0 @@
1
- import {
2
- IncomingAckRequest,
3
- IncomingByeRequest,
4
- IncomingInfoRequest,
5
- IncomingInviteRequest,
6
- IncomingMessageRequest,
7
- IncomingNotifyRequest,
8
- IncomingPrackRequest,
9
- IncomingReferRequest
10
- } from "../messages";
11
-
12
- /**
13
- * Session delegate.
14
- * @public
15
- */
16
- export interface SessionDelegate {
17
- /**
18
- * Receive ACK request.
19
- * @param request - Incoming ACK request.
20
- * @returns
21
- * The callback MUST return a promise if it asynchronously handles answers.
22
- * For example, an ACK with an answer (offer in the 200 Ok) may require
23
- * asynchronous processing in which case the callback MUST return a Promise
24
- * which resolves when the answer handling is complete.
25
- * @privateRemarks
26
- * Unlike INVITE handling where we can rely on the generation of a response
27
- * to indicate when offer/answer processing has been completed, ACK handling
28
- * requires some indication from the handler that answer processing is complete
29
- * so that we can avoid some race conditions (see comments in code for more details).
30
- * Having the handler return a Promise provides said indication.
31
- */
32
- onAck?(request: IncomingAckRequest): Promise<void> | void;
33
-
34
- /**
35
- * Timeout waiting for ACK request.
36
- * If no handler is provided the Session will terminated with a BYE.
37
- * https://tools.ietf.org/html/rfc3261#section-13.3.1.4
38
- */
39
- onAckTimeout?(): void;
40
-
41
- /**
42
- * Receive BYE request.
43
- * https://tools.ietf.org/html/rfc3261#section-15.1.2
44
- * @param request - Incoming BYE request.
45
- */
46
- onBye?(request: IncomingByeRequest): void;
47
-
48
- /**
49
- * Receive INFO request.
50
- * @param request - Incoming INFO request.
51
- */
52
- onInfo?(request: IncomingInfoRequest): void;
53
-
54
- /**
55
- * Receive re-INVITE request.
56
- * https://tools.ietf.org/html/rfc3261#section-14.2
57
- * @param request - Incoming INVITE request.
58
- */
59
- onInvite?(request: IncomingInviteRequest): void;
60
-
61
- /**
62
- * Receive MESSAGE request.
63
- * https://tools.ietf.org/html/rfc3428#section-7
64
- * @param request - Incoming MESSAGE request.
65
- */
66
- onMessage?(request: IncomingMessageRequest): void;
67
-
68
- /**
69
- * Receive NOTIFY request.
70
- * https://tools.ietf.org/html/rfc6665#section-4.1.3
71
- * @param request - Incoming NOTIFY request.
72
- */
73
- onNotify?(request: IncomingNotifyRequest): void;
74
-
75
- /**
76
- * Receive PRACK request.
77
- * https://tools.ietf.org/html/rfc3262#section-3
78
- * @param request - Incoming PRACK request.
79
- */
80
- onPrack?(request: IncomingPrackRequest): void;
81
-
82
- /**
83
- * Receive REFER request.
84
- * https://tools.ietf.org/html/rfc3515#section-2.4.2
85
- * @param request - Incoming REFER request.
86
- */
87
- onRefer?(request: IncomingReferRequest): void;
88
- }