ue-softphone-sdk 2.2.3 → 2.2.5

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 +2486 -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,1009 @@
1
+ {
2
+ options.data = {}; // Object to which header attributes will be assigned during parsing
3
+
4
+ function list(head: string, tail: Array<string>) {
5
+ return [head].concat(tail);
6
+ }
7
+ }
8
+
9
+ // ABNF BASIC
10
+
11
+ CRLF = "\r\n"
12
+ DIGIT = [0-9]
13
+ ALPHA = [a-zA-Z]
14
+ HEXDIG = [0-9a-fA-F]
15
+ WSP = SP / HTAB
16
+ OCTET = [\u0000-\u00FF]
17
+ DQUOTE = ["]
18
+ SP = " "
19
+ HTAB = "\t"
20
+
21
+
22
+ // BASIC RULES
23
+
24
+ alphanum = [a-zA-Z0-9]
25
+ reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+" / "$" / ","
26
+ unreserved = alphanum / mark
27
+ mark = "-" / "_" / "." / "!" / "~" / "*" / "'" / "(" / ")"
28
+ escaped = $ ("%" HEXDIG HEXDIG)
29
+
30
+ /* RFC3261 25: A recipient MAY replace any linear white space with a single SP
31
+ * before interpreting the field value or forwarding the message downstream
32
+ */
33
+ LWS = ( WSP* CRLF )? WSP+ {return " "; }
34
+
35
+ SWS = LWS?
36
+
37
+ HCOLON = ( SP / HTAB )* ":" SWS {return ':'; }
38
+
39
+ TEXT_UTF8_TRIM = $( TEXT_UTF8char+ ( LWS* TEXT_UTF8char)* )
40
+
41
+ TEXT_UTF8char = [\x21-\x7E] / UTF8_NONASCII
42
+
43
+ UTF8_NONASCII = [\u0080-\uFFFF]
44
+
45
+ UTF8_CONT = [\x80-\xBF]
46
+
47
+ LHEX = DIGIT / [\x61-\x66]
48
+
49
+ token = $ (alphanum / "-" / "." / "!" / "%" / "*"
50
+ / "_" / "+" / "`" / "'" / "~" )+
51
+
52
+ token_nodot = $ ( alphanum / "-" / "!" / "%" / "*"
53
+ / "_" / "+" / "`" / "'" / "~" )+
54
+
55
+ separators = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\\"
56
+ / DQUOTE / "/" / "[" / "]" / "?" / "=" / "{" / "}"
57
+ / SP / HTAB
58
+
59
+ word = $ (alphanum / "-" / "." / "!" / "%" / "*" /
60
+ "_" / "+" / "`" / "'" / "~" /
61
+ "(" / ")" / "<" / ">" /
62
+ ":" / "\\" / DQUOTE /
63
+ "/" / "[" / "]" / "?" /
64
+ "{" / "}" )+
65
+
66
+ STAR = SWS "*" SWS {return "*"; }
67
+ SLASH = SWS "/" SWS {return "/"; }
68
+ EQUAL = SWS "=" SWS {return "="; }
69
+ LPAREN = SWS "(" SWS {return "("; }
70
+ RPAREN = SWS ")" SWS {return ")"; }
71
+ RAQUOT = ">" SWS {return ">"; }
72
+ LAQUOT = SWS "<" {return "<"; }
73
+ COMMA = SWS "," SWS {return ","; }
74
+ SEMI = SWS ";" SWS {return ";"; }
75
+ COLON = SWS ":" SWS {return ":"; }
76
+ LDQUOT = SWS DQUOTE {return "\""; }
77
+ RDQUOT = DQUOTE SWS {return "\""; }
78
+
79
+ comment = LPAREN (ctext / quoted_pair / comment)* RPAREN
80
+
81
+ ctext = [\x21-\x27] / [\x2A-\x5B] / [\x5D-\x7E] / UTF8_NONASCII / LWS
82
+
83
+ quoted_string = $( SWS DQUOTE ( qdtext / quoted_pair )* DQUOTE )
84
+
85
+ quoted_string_clean = SWS DQUOTE contents: $( qdtext / quoted_pair )* DQUOTE {
86
+ return contents; }
87
+
88
+ qdtext = LWS / "\x21" / [\x23-\x5B] / [\x5D-\x7E] / UTF8_NONASCII
89
+
90
+ quoted_pair = "\\" ( [\x00-\x09] / [\x0B-\x0C] / [\x0E-\x7F] )
91
+
92
+
93
+ //=======================
94
+ // SIP URI
95
+ //=======================
96
+
97
+ SIP_URI_noparams = uri_scheme ":" userinfo ? hostport {
98
+ options = options || { data: {}};
99
+ options.data.uri = new URI(options.data.scheme, options.data.user, options.data.host, options.data.port);
100
+ delete options.data.scheme;
101
+ delete options.data.user;
102
+ delete options.data.host;
103
+ delete options.data.host_type;
104
+ delete options.data.port;
105
+ }
106
+
107
+ SIP_URI = uri_scheme ":" userinfo ? hostport uri_parameters headers ? {
108
+ options = options || { data: {}};
109
+ options.data.uri = new URI(options.data.scheme, options.data.user, options.data.host, options.data.port, options.data.uri_params, options.data.uri_headers);
110
+ delete options.data.scheme;
111
+ delete options.data.user;
112
+ delete options.data.host;
113
+ delete options.data.host_type;
114
+ delete options.data.port;
115
+ delete options.data.uri_params;
116
+
117
+ if (options.startRule === 'SIP_URI') { options.data = options.data.uri;}
118
+ }
119
+
120
+ uri_scheme = uri_scheme: ( "sips"i / "sip"i ) {
121
+ options = options || { data: {}};
122
+ options.data.scheme = uri_scheme; }
123
+
124
+ userinfo = user (":" password)? "@" {
125
+ options = options || { data: {}};
126
+ options.data.user = decodeURIComponent(text().slice(0, -1));}
127
+
128
+ user = ( unreserved / escaped / user_unreserved )+
129
+
130
+ user_unreserved = "&" / "=" / "+" / "$" / "," / ";" / "?" / "/"
131
+
132
+ password = ( unreserved / escaped / "&" / "=" / "+" / "$" / "," )* {
133
+ options = options || { data: {}};
134
+ options.data.password = text(); }
135
+
136
+ hostport = host ( ":" port )?
137
+
138
+ host = ( hostname / IPv4address / IPv6reference ) {
139
+ options = options || { data: {}};
140
+ options.data.host = text();
141
+ return options.data.host; }
142
+
143
+ hostname = ( domainlabel "." )* toplabel "." ? {
144
+ options = options || { data: {}};
145
+ options.data.host_type = 'domain';
146
+ return text(); }
147
+
148
+ domainlabel = domainlabel: ( [a-zA-Z0-9_-]+ )
149
+
150
+ toplabel = toplabel: ( [a-zA-Z][a-zA-Z0-9-]* )
151
+
152
+ IPv6reference = "[" IPv6address "]" {
153
+ options = options || { data: {}};
154
+ options.data.host_type = 'IPv6';
155
+ return text(); }
156
+
157
+ IPv6address = ( h16 ":" h16 ":" h16 ":" h16 ":" h16 ":" h16 ":" ls32
158
+ / "::" h16 ":" h16 ":" h16 ":" h16 ":" h16 ":" ls32
159
+ / "::" h16 ":" h16 ":" h16 ":" h16 ":" ls32
160
+ / "::" h16 ":" h16 ":" h16 ":" ls32
161
+ / "::" h16 ":" h16 ":" ls32
162
+ / "::" h16 ":" ls32
163
+ / "::" ls32
164
+ / "::" h16
165
+ / h16 "::" h16 ":" h16 ":" h16 ":" h16 ":" ls32
166
+ / h16 (":" h16)? "::" h16 ":" h16 ":" h16 ":" ls32
167
+ / h16 (":" h16)? (":" h16)? "::" h16 ":" h16 ":" ls32
168
+ / h16 (":" h16)? (":" h16)? (":" h16)? "::" h16 ":" ls32
169
+ / h16 (":" h16)? (":" h16)? (":" h16)? (":" h16)? "::" ls32
170
+ / h16 (":" h16)? (":" h16)? (":" h16)? (":" h16)? (":" h16)? "::" h16
171
+ / h16 (":" h16)? (":" h16)? (":" h16)? (":" h16)? (":" h16)? (":" h16)? "::"
172
+ ) {
173
+ options = options || { data: {}};
174
+ options.data.host_type = 'IPv6';
175
+ return text(); }
176
+
177
+
178
+ h16 = HEXDIG HEXDIG? HEXDIG? HEXDIG?
179
+
180
+ ls32 = ( h16 ":" h16 ) / IPv4address
181
+
182
+
183
+ IPv4address = dec_octet "." dec_octet "." dec_octet "." dec_octet {
184
+ options = options || { data: {}};
185
+ options.data.host_type = 'IPv4';
186
+ return text(); }
187
+
188
+ dec_octet = "25" [\x30-\x35] // 250-255
189
+ / "2" [\x30-\x34] DIGIT // 200-249
190
+ / "1" DIGIT DIGIT // 100-199
191
+ / [\x31-\x39] DIGIT // 10-99
192
+ / DIGIT // 0-9
193
+
194
+ port = port: (DIGIT ? DIGIT ? DIGIT ? DIGIT ? DIGIT ?) {
195
+ options = options || { data: {}};
196
+ port = parseInt(port.join(''));
197
+ options.data.port = port;
198
+ return port; }
199
+
200
+ // URI PARAMETERS
201
+
202
+ uri_parameters = ( ";" uri_parameter)*
203
+
204
+ uri_parameter = transport_param / user_param / method_param
205
+ / ttl_param / maddr_param / lr_param / other_param
206
+
207
+ transport_param = "transport="i transport: ( "udp"i / "tcp"i / "sctp"i
208
+ / "tls"i / other_transport) {
209
+ options = options || { data: {}};
210
+ if(!options.data.uri_params) options.data.uri_params={};
211
+ options.data.uri_params['transport'] = transport.toLowerCase(); }
212
+
213
+ other_transport = token
214
+
215
+ user_param = "user="i user:( "phone"i / "ip"i / other_user) {
216
+ options = options || { data: {}};
217
+ if(!options.data.uri_params) options.data.uri_params={};
218
+ options.data.uri_params['user'] = user.toLowerCase(); }
219
+
220
+ other_user = token
221
+
222
+ method_param = "method="i method: Method {
223
+ options = options || { data: {}};
224
+ if(!options.data.uri_params) options.data.uri_params={};
225
+ options.data.uri_params['method'] = method; }
226
+
227
+ ttl_param = "ttl="i ttl: ttl {
228
+ options = options || { data: {}};
229
+ if(!options.data.params) options.data.params={};
230
+ options.data.params['ttl'] = ttl; }
231
+
232
+ maddr_param = "maddr="i maddr: host {
233
+ options = options || { data: {}};
234
+ if(!options.data.uri_params) options.data.uri_params={};
235
+ options.data.uri_params['maddr'] = maddr; }
236
+
237
+ lr_param = "lr"i ('=' token)? {
238
+ options = options || { data: {}};
239
+ if(!options.data.uri_params) options.data.uri_params={};
240
+ options.data.uri_params['lr'] = undefined; }
241
+
242
+ other_param = param: pname value: ( "=" pvalue )? {
243
+ options = options || { data: {}};
244
+ if(!options.data.uri_params) options.data.uri_params = {};
245
+ if (value === null){
246
+ value = undefined;
247
+ }
248
+ else {
249
+ value = value[1];
250
+ }
251
+ options.data.uri_params[param.toLowerCase()] = value;}
252
+
253
+ pname = $ paramchar +
254
+
255
+ pvalue = $ paramchar +
256
+
257
+ paramchar = param_unreserved / unreserved / escaped
258
+
259
+ param_unreserved = "[" / "]" / "/" / ":" / "&" / "+" / "$"
260
+
261
+
262
+ // HEADERS
263
+
264
+ headers = "?" header ( "&" header )*
265
+
266
+ header = hname: hname "=" hvalue: hvalue {
267
+ hname = hname.join('').toLowerCase();
268
+ hvalue = hvalue.join('');
269
+ options = options || { data: {}};
270
+ if(!options.data.uri_headers) options.data.uri_headers = {};
271
+ if (!options.data.uri_headers[hname]) {
272
+ options.data.uri_headers[hname] = [hvalue];
273
+ } else {
274
+ options.data.uri_headers[hname].push(hvalue);
275
+ }}
276
+
277
+ hname = ( hnv_unreserved / unreserved / escaped )+
278
+
279
+ hvalue = ( hnv_unreserved / unreserved / escaped )*
280
+
281
+ hnv_unreserved = "[" / "]" / "/" / "?" / ":" / "+" / "$"
282
+
283
+
284
+ // FIRST LINE
285
+
286
+ Request_Response = Status_Line / Request_Line
287
+
288
+
289
+ // REQUEST LINE
290
+
291
+ Request_Line = Method SP Request_URI SP SIP_Version
292
+
293
+ Request_URI = SIP_URI / absoluteURI
294
+
295
+ absoluteURI = scheme ":" ( hier_part / opaque_part )
296
+ {
297
+ options = options || { data: {}};
298
+ // lots of tests fail if this isn't guarded...
299
+ if (options.startRule === 'Refer_To') {
300
+ options.data.uri = new URI(options.data.scheme, options.data.user, options.data.host, options.data.port, options.data.uri_params, options.data.uri_headers);
301
+ delete options.data.scheme;
302
+ delete options.data.user;
303
+ delete options.data.host;
304
+ delete options.data.host_type;
305
+ delete options.data.port;
306
+ delete options.data.uri_params;
307
+ }
308
+ }
309
+
310
+ hier_part = ( net_path / abs_path ) ( "?" query )?
311
+
312
+ net_path = "//" authority abs_path ?
313
+
314
+ abs_path = "/" path_segments
315
+
316
+ opaque_part = uric_no_slash uric *
317
+
318
+ uric = reserved / unreserved / escaped
319
+
320
+ uric_no_slash = unreserved / escaped / ";" / "?" / ":" / "@" / "&" / "="
321
+ / "+" / "$" / ","
322
+
323
+ path_segments = segment ( "/" segment )*
324
+
325
+ segment = pchar * ( ";" param )*
326
+
327
+ param = pchar *
328
+
329
+ pchar = unreserved / escaped /
330
+ ":" / "@" / "&" / "=" / "+" / "$" / ","
331
+
332
+ scheme = ( ALPHA ( ALPHA / DIGIT / "+" / "-" / "." )* ){
333
+ options = options || { data: {}};
334
+ options.data.scheme= text(); }
335
+
336
+ authority = srvr / reg_name
337
+
338
+ srvr = ( ( userinfo "@" )? hostport )?
339
+
340
+ reg_name = ( unreserved / escaped / "$" / ","
341
+ / ";" / ":" / "@" / "&" / "=" / "+" )+
342
+
343
+ query = uric *
344
+
345
+ SIP_Version = "SIP"i "/" DIGIT + "." DIGIT + {
346
+ options = options || { data: {}};
347
+ options.data.sip_version = text(); }
348
+
349
+ // SIP METHODS
350
+
351
+ INVITEm = "\x49\x4E\x56\x49\x54\x45" // INVITE in caps
352
+
353
+ ACKm = "\x41\x43\x4B" // ACK in caps
354
+
355
+ PRACKm = "\x56\x58\x41\x43\x48" // PRACK in caps
356
+
357
+ OPTIONSm = "\x4F\x50\x54\x49\x4F\x4E\x53" // OPTIONS in caps
358
+
359
+ BYEm = "\x42\x59\x45" // BYE in caps
360
+
361
+ CANCELm = "\x43\x41\x4E\x43\x45\x4C" // CANCEL in caps
362
+
363
+ REGISTERm = "\x52\x45\x47\x49\x53\x54\x45\x52" // REGISTER in caps
364
+
365
+ SUBSCRIBEm = "\x53\x55\x42\x53\x43\x52\x49\x42\x45" // SUBSCRIBE in caps
366
+
367
+ NOTIFYm = "\x4E\x4F\x54\x49\x46\x59" // NOTIFY in caps
368
+
369
+ REFERm = "\x52\x45\x46\x45\x52" // REFER in caps
370
+
371
+ PUBLISHm = "\x50\x55\x42\x4c\x49\x53\x48" // PUBLISH in caps
372
+
373
+ Method = ( INVITEm / ACKm / OPTIONSm / BYEm / CANCELm / REGISTERm
374
+ / SUBSCRIBEm / PUBLISHm / NOTIFYm / REFERm / extension_method ){
375
+
376
+ options = options || { data: {}};
377
+ options.data.method = text();
378
+ return options.data.method; }
379
+
380
+ extension_method = token
381
+
382
+
383
+ // STATUS LINE
384
+
385
+ Status_Line = SIP_Version SP Status_Code SP Reason_Phrase
386
+
387
+ Status_Code = status_code: extension_code {
388
+ options = options || { data: {}};
389
+ options.data.status_code = parseInt(status_code.join('')); }
390
+
391
+ extension_code = DIGIT DIGIT DIGIT
392
+
393
+ Reason_Phrase = (reserved / unreserved / escaped
394
+ / UTF8_NONASCII / UTF8_CONT / SP / HTAB)* {
395
+ options = options || { data: {}};
396
+ options.data.reason_phrase = text(); }
397
+
398
+
399
+ //=======================
400
+ // HEADERS
401
+ //=======================
402
+
403
+ // Allow-Events
404
+
405
+ Allow_Events = event_type (COMMA event_type)*
406
+
407
+
408
+ // CALL-ID
409
+
410
+ Call_ID = word ( "@" word )? {
411
+ options = options || { data: {}};
412
+ options.data = text(); }
413
+
414
+ // CONTACT
415
+
416
+ Contact = ( STAR / (contact_param (COMMA contact_param)*) ) {
417
+ var idx, length;
418
+ options = options || { data: {}};
419
+ length = options.data.multi_header.length;
420
+ for (idx = 0; idx < length; idx++) {
421
+ if (options.data.multi_header[idx].parsed === null) {
422
+ options.data = null;
423
+ break;
424
+ }
425
+ }
426
+ if (options.data !== null) {
427
+ options.data = options.data.multi_header;
428
+ } else {
429
+ options.data = -1;
430
+ }}
431
+
432
+ contact_param = (addr_spec / name_addr) (SEMI contact_params)* {
433
+ var header;
434
+ options = options || { data: {}};
435
+ if(!options.data.multi_header) options.data.multi_header = [];
436
+ try {
437
+ header = new NameAddrHeader(options.data.uri, options.data.displayName, options.data.params);
438
+ delete options.data.uri;
439
+ delete options.data.displayName;
440
+ delete options.data.params;
441
+ } catch(e) {
442
+ header = null;
443
+ }
444
+ options.data.multi_header.push( { 'position': peg$currPos,
445
+ 'offset': location().start.offset,
446
+ 'parsed': header
447
+ });}
448
+
449
+ name_addr = ( displayName )? LAQUOT SIP_URI RAQUOT
450
+
451
+ addr_spec = SIP_URI_noparams
452
+
453
+ displayName = displayName: (token ( LWS token )* / quoted_string) {
454
+ displayName = text().trim();
455
+ if (displayName[0] === '\"') {
456
+ displayName = displayName.substring(1, displayName.length-1);
457
+ }
458
+ options = options || { data: {}};
459
+ options.data.displayName = displayName; }
460
+ // The previous rule is corrected from RFC3261
461
+
462
+ contact_params = c_p_q / c_p_expires / contact_extension
463
+
464
+ c_p_q = "q"i EQUAL q: qvalue {
465
+ options = options || { data: {}};
466
+ if(!options.data.params) options.data.params = {};
467
+ options.data.params['q'] = q; }
468
+
469
+ c_p_expires = "expires"i EQUAL expires: delta_seconds {
470
+ options = options || { data: {}};
471
+ if(!options.data.params) options.data.params = {};
472
+ options.data.params['expires'] = expires; }
473
+
474
+ contact_extension = generic_param
475
+
476
+ delta_seconds = delta_seconds: DIGIT+ {
477
+ return parseInt(delta_seconds.join('')); }
478
+
479
+ qvalue = "0" ( "." DIGIT? DIGIT? DIGIT? )? {
480
+ return parseFloat(text()); }
481
+
482
+ generic_param = param: token value: ( EQUAL gen_value )? {
483
+ options = options || { data: {}};
484
+ if(!options.data.params) options.data.params = {};
485
+ if (value === null){
486
+ value = undefined;
487
+ }
488
+ else {
489
+ value = value[1];
490
+ }
491
+ options.data.params[param.toLowerCase()] = value;}
492
+
493
+ gen_value = token / host / quoted_string
494
+
495
+
496
+ // CONTENT-DISPOSITION
497
+
498
+ Content_Disposition = disp_type ( SEMI disp_param )*
499
+
500
+ disp_type = ("render"i / "session"i / "icon"i / "alert"i / disp_extension_token)
501
+ {
502
+ options = options || { data: {}};
503
+ if (options.startRule === 'Content_Disposition') {
504
+ options.data.type = text().toLowerCase();
505
+ }
506
+ }
507
+
508
+ disp_param = handling_param / generic_param
509
+
510
+ handling_param = "handling"i EQUAL ( "optional"i / "required"i / other_handling )
511
+
512
+ other_handling = token
513
+
514
+ disp_extension_token = token
515
+
516
+
517
+ // CONTENT-ENCODING
518
+
519
+ Content_Encoding = content_coding (COMMA content_coding)*
520
+
521
+ content_coding = token
522
+
523
+
524
+ // CONTENT-LENGTH
525
+
526
+ Content_Length = length: (DIGIT +) {
527
+ options = options || { data: {}};
528
+ options.data = parseInt(length.join('')); }
529
+
530
+ // CONTENT-TYPE
531
+
532
+ Content_Type = media_type {
533
+ options = options || { data: {}};
534
+ options.data = text(); }
535
+
536
+ media_type = m_type SLASH m_subtype (SEMI m_parameter)*
537
+
538
+ m_type = discrete_type / composite_type
539
+
540
+ discrete_type = "text"i / "image"i / "audio"i / "video"i / "application"i
541
+ / extension_token
542
+
543
+ composite_type = "message"i / "multipart"i / extension_token
544
+
545
+ extension_token = ietf_token / x_token
546
+
547
+ ietf_token = token
548
+
549
+ x_token = "x-"i token
550
+
551
+ m_subtype = extension_token / iana_token
552
+
553
+ iana_token = token
554
+
555
+ m_parameter = m_attribute EQUAL m_value
556
+
557
+ m_attribute = token
558
+
559
+ m_value = token / quoted_string
560
+
561
+
562
+ // CSEQ
563
+
564
+ CSeq = CSeq_value LWS CSeq_method
565
+
566
+ CSeq_value = cseq_value: DIGIT + {
567
+ options = options || { data: {}};
568
+ options.data.value=parseInt(cseq_value.join('')); }
569
+
570
+ CSeq_method = Method
571
+
572
+
573
+ // EXPIRES
574
+
575
+ Expires = expires: delta_seconds {options = options || { data: {}}; options.data = expires; }
576
+
577
+
578
+ Event = event_type: event_type ( SEMI event_param )* {
579
+ options = options || { data: {}};
580
+ options.data.event = event_type.toLowerCase(); }
581
+
582
+ event_type = $( event_package ( "." event_template )* )
583
+
584
+ event_package = token_nodot
585
+
586
+ event_template = token_nodot
587
+
588
+ event_param = generic_param
589
+
590
+ // FROM
591
+
592
+ From = ( addr_spec / name_addr ) ( SEMI from_param )* {
593
+ options = options || { data: {}};
594
+ var tag = options.data.tag;
595
+ options.data = new NameAddrHeader(options.data.uri, options.data.displayName, options.data.params);
596
+ if (tag) {options.data.setParam('tag',tag)}
597
+ }
598
+
599
+ from_param = tag_param / generic_param
600
+
601
+ tag_param = "tag"i EQUAL tag: token {options = options || { data: {}};options.data.tag = tag; }
602
+
603
+
604
+ //MAX-FORWARDS
605
+
606
+ Max_Forwards = forwards: DIGIT+ {
607
+ options = options || { data: {}};
608
+ options.data = parseInt(forwards.join('')); }
609
+
610
+
611
+ // MIN-EXPIRES
612
+
613
+ Min_Expires = min_expires: delta_seconds {options = options || { data: {}}; options.data = min_expires; }
614
+
615
+ // Name_Addr
616
+
617
+ Name_Addr_Header = ( displayName )* LAQUOT SIP_URI RAQUOT ( SEMI generic_param )* {
618
+ options = options || { data: {}};
619
+ options.data = new NameAddrHeader(options.data.uri, options.data.displayName, options.data.params);
620
+ }
621
+
622
+ // PROXY-AUTHENTICATE
623
+
624
+ Proxy_Authenticate = proxy_authenticate: challenge
625
+
626
+ challenge = ("Digest"i LWS digest_cln (COMMA digest_cln)*)
627
+ / other_challenge
628
+
629
+ other_challenge = auth_scheme LWS auth_param (COMMA auth_param)*
630
+
631
+ auth_scheme = token
632
+
633
+ auth_param = auth_param_name EQUAL ( token / quoted_string )
634
+
635
+ auth_param_name = token
636
+
637
+ digest_cln = realm / domain / nonce / opaque / stale / algorithm
638
+ / qop_options / auth_param
639
+
640
+ realm = "realm"i EQUAL realm_value
641
+
642
+ realm_value = realm: quoted_string_clean { options = options || { data: {}}; options.data.realm = realm; }
643
+
644
+ domain = "domain"i EQUAL LDQUOT URI ( SP+ URI )* RDQUOT
645
+
646
+ URI = absoluteURI / abs_path
647
+
648
+ nonce = "nonce"i EQUAL nonce_value
649
+
650
+ nonce_value = nonce: quoted_string_clean { options = options || { data: {}}; options.data.nonce=nonce; }
651
+
652
+ opaque = "opaque"i EQUAL opaque: quoted_string_clean { options = options || { data: {}}; options.data.opaque=opaque; }
653
+
654
+ stale = "stale"i EQUAL ( "true"i { options = options || { data: {}}; options.data.stale=true; } / "false"i { options = options || { data: {}}; options.data.stale=false; } )
655
+
656
+ algorithm = "algorithm"i EQUAL algorithm: ( "MD5"i / "MD5-sess"i
657
+ / token ) {
658
+ options = options || { data: {}};
659
+ options.data.algorithm=algorithm.toUpperCase(); }
660
+
661
+ qop_options = "qop"i EQUAL LDQUOT (qop_value ("," qop_value)*) RDQUOT
662
+
663
+ qop_value = qop_value: ( "auth-int"i / "auth"i / token ) {
664
+ options = options || { data: {}};
665
+ options.data.qop || (options.data.qop=[]);
666
+ options.data.qop.push(qop_value.toLowerCase()); }
667
+
668
+ // PUBLISH ETag
669
+
670
+ SIP_ETag = token
671
+
672
+ SIP_If_Match = token
673
+
674
+ // PROXY-REQUIRE
675
+
676
+ Proxy_Require = option_tag (COMMA option_tag)*
677
+
678
+ option_tag = token
679
+
680
+
681
+ // RAck
682
+
683
+ RAck = RAck_value LWS RAck_value LWS RAck_method
684
+
685
+ RAck_value = rack_value: DIGIT + {
686
+ options = options || { data: {}};
687
+ options.data.value=parseInt(rack_value.join('')); }
688
+
689
+ RAck_method = Method
690
+
691
+
692
+ // RECORD-ROUTE
693
+
694
+ Record_Route = rec_route (COMMA rec_route)* {
695
+ var idx, length;
696
+ options = options || { data: {}};
697
+ length = options.data.multi_header.length;
698
+ for (idx = 0; idx < length; idx++) {
699
+ if (options.data.multi_header[idx].parsed === null) {
700
+ options.data = null;
701
+ break;
702
+ }
703
+ }
704
+ if (options.data !== null) {
705
+ options.data = options.data.multi_header;
706
+ } else {
707
+ options.data = -1;
708
+ }}
709
+
710
+ rec_route = name_addr ( SEMI rr_param )* {
711
+ var header;
712
+ options = options || { data: {}};
713
+ if(!options.data.multi_header) options.data.multi_header = [];
714
+ try {
715
+ header = new NameAddrHeader(options.data.uri, options.data.displayName, options.data.params);
716
+ delete options.data.uri;
717
+ delete options.data.displayName;
718
+ delete options.data.params;
719
+ } catch(e) {
720
+ header = null;
721
+ }
722
+ options.data.multi_header.push( { 'position': peg$currPos,
723
+ 'offset': location().start.offset,
724
+ 'parsed': header
725
+ });}
726
+
727
+ rr_param = generic_param
728
+
729
+ // REFER-TO
730
+
731
+ Refer_To = ( addr_spec / name_addr / LAQUOT? absoluteURI RAQUOT? ) ( SEMI r_param )* {
732
+ options = options || { data: {}};
733
+ options.data = new NameAddrHeader(options.data.uri, options.data.displayName, options.data.params);
734
+ }
735
+
736
+ r_param = generic_param
737
+
738
+ // REPLACES
739
+
740
+ Replaces = replaces_call_id ( SEMI replaces_params )* {
741
+ options = options || { data: {}};
742
+ if (!(options.data.replaces_from_tag && options.data.replaces_to_tag)) {
743
+ options.data = -1;
744
+ }
745
+ }
746
+
747
+ replaces_call_id = Call_ID {
748
+ options = options || { data: {}};
749
+ options.data = {
750
+ call_id: options.data
751
+ };
752
+ }
753
+
754
+ replaces_params = "from-tag"i EQUAL from_tag: token {
755
+ options = options || { data: {}};
756
+ options.data.replaces_from_tag = from_tag;
757
+ }
758
+ / "to-tag"i EQUAL to_tag: token {
759
+ options = options || { data: {}};
760
+ options.data.replaces_to_tag = to_tag;
761
+ }
762
+ / "early-only"i {
763
+ options = options || { data: {}};
764
+ options.data.early_only = true;
765
+ }
766
+ / generic_param
767
+
768
+ // REQUIRE
769
+
770
+ Require = value:(
771
+ head:option_tag
772
+ tail:(COMMA r:option_tag {return r;})*
773
+ { return list(head, tail); }
774
+ )?
775
+ {
776
+ options = options || { data: {}};
777
+ if (options.startRule === 'Require') {
778
+ options.data = value || [];
779
+ }
780
+ }
781
+
782
+
783
+ // ROUTE
784
+
785
+ Route = route_param (COMMA route_param)*
786
+
787
+ route_param = name_addr ( SEMI rr_param )*
788
+
789
+ // RSEQ
790
+
791
+ RSeq = rseq_value: DIGIT + {
792
+ options = options || { data: {}};
793
+ options.data.value=parseInt(rseq_value.join('')); }
794
+
795
+
796
+ // SUBSCRIPTION-STATE
797
+
798
+ Subscription_State = substate_value ( SEMI subexp_params )*
799
+
800
+ substate_value = ( "active"i / "pending"i / "terminated"i
801
+ / extension_substate ) {
802
+ options = options || { data: {}};
803
+ options.data.state = text(); }
804
+
805
+ extension_substate = token
806
+
807
+ subexp_params = "reason"i EQUAL reason: event_reason_value {
808
+ options = options || { data: {}};
809
+ if (typeof reason !== 'undefined') options.data.reason = reason; }
810
+ / "expires"i EQUAL expires: delta_seconds {
811
+ options = options || { data: {}};
812
+ if (typeof expires !== 'undefined') options.data.expires = expires; }
813
+ / "retry_after"i EQUAL retry_after: delta_seconds {
814
+ options = options || { data: {}};
815
+ if (typeof retry_after !== 'undefined') options.data.retry_after = retry_after; }
816
+ / generic_param
817
+
818
+ event_reason_value = "deactivated"i
819
+ / "probation"i
820
+ / "rejected"i
821
+ / "timeout"i
822
+ / "giveup"i
823
+ / "noresource"i
824
+ / "invariant"i
825
+ / event_reason_extension
826
+
827
+ event_reason_extension = token
828
+
829
+
830
+ // SUBJECT
831
+
832
+ Subject = ( TEXT_UTF8_TRIM )?
833
+
834
+
835
+ // SUPPORTED
836
+
837
+ Supported = value:(
838
+ head:option_tag
839
+ tail:(COMMA r:option_tag {return r;})*
840
+ { return list(head, tail); }
841
+ )?
842
+ {
843
+ options = options || { data: {}};
844
+ if (options.startRule === 'Supported') {
845
+ options.data = value || [];
846
+ }
847
+ }
848
+
849
+
850
+ // TO
851
+
852
+ To = ( addr_spec / name_addr ) ( SEMI to_param )* {
853
+ options = options || { data: {}};
854
+ var tag = options.data.tag;
855
+ options.data = new NameAddrHeader(options.data.uri, options.data.displayName, options.data.params);
856
+ if (tag) {options.data.setParam('tag',tag)}
857
+ }
858
+
859
+ to_param = tag_param / generic_param
860
+
861
+ // VIA
862
+
863
+ Via = via_parm (COMMA via_parm)*
864
+
865
+ via_parm = sent_protocol LWS sent_by ( SEMI via_params )*
866
+
867
+ via_params = via_ttl / via_maddr / via_received / via_branch / response_port / via_extension
868
+
869
+ via_ttl = "ttl"i EQUAL via_ttl_value: ttl {
870
+ options = options || { data: {}};
871
+ options.data.ttl = via_ttl_value; }
872
+
873
+ via_maddr = "maddr"i EQUAL via_maddr: host {
874
+ options = options || { data: {}};
875
+ options.data.maddr = via_maddr; }
876
+
877
+ via_received = "received"i EQUAL via_received: (IPv4address / IPv6address / IPv6reference) {
878
+ options = options || { data: {}};
879
+ options.data.received = via_received; }
880
+
881
+ via_branch = "branch"i EQUAL via_branch: token {
882
+ options = options || { data: {}};
883
+ options.data.branch = via_branch; }
884
+
885
+ response_port = "rport"i EQUAL response_port:(DIGIT*) {
886
+ options = options || { data: {}};
887
+ if(typeof response_port !== 'undefined')
888
+ options.data.rport = response_port.join(''); }
889
+
890
+ via_extension = generic_param
891
+
892
+ sent_protocol = protocol_name SLASH protocol_version SLASH transport
893
+
894
+ protocol_name = via_protocol: ( "SIP"i / token ) {
895
+ options = options || { data: {}};
896
+ options.data.protocol = via_protocol; }
897
+
898
+ protocol_version = token
899
+
900
+ transport = via_transport: ("UDP"i / "TCP"i / "TLS"i / "SCTP"i / other_transport) {
901
+ options = options || { data: {}};
902
+ options.data.transport = via_transport; }
903
+
904
+ sent_by = viaHost ( COLON via_port )?
905
+
906
+ viaHost = ( hostname / IPv4address / IPv6reference ) {
907
+ options = options || { data: {}};
908
+ options.data.host = text(); }
909
+
910
+ via_port = via_sent_by_port: (DIGIT ? DIGIT ? DIGIT ? DIGIT ? DIGIT ?) {
911
+ options = options || { data: {}};
912
+ options.data.port = parseInt(via_sent_by_port.join('')); }
913
+
914
+ ttl = ttl: (DIGIT DIGIT ? DIGIT ?) {
915
+ return parseInt(ttl.join('')); }
916
+
917
+
918
+ // WWW-AUTHENTICATE
919
+
920
+ WWW_Authenticate = www_authenticate: challenge
921
+
922
+
923
+ // RFC 4028
924
+
925
+ Session_Expires = deltaSeconds:delta_seconds (SEMI se_params)*
926
+ {
927
+ options = options || { data: {}};
928
+ if (options.startRule === 'Session_Expires') {
929
+ options.data.deltaSeconds = deltaSeconds;
930
+ }
931
+ }
932
+
933
+ se_params = refresher_param / generic_param
934
+
935
+ refresher_param = "refresher" EQUAL endpoint:("uas" / "uac")
936
+ {
937
+ options = options || { data: {}};
938
+ if (options.startRule === 'Session_Expires') {
939
+ options.data.refresher = endpoint;
940
+ }
941
+ }
942
+
943
+ Min_SE = deltaSeconds:delta_seconds (SEMI generic_param)*
944
+ {
945
+ options = options || { data: {}};
946
+ if (options.startRule === 'Min_SE') {
947
+ options.data = deltaSeconds;
948
+ }
949
+ }
950
+
951
+ // EXTENSION-HEADER
952
+
953
+ extension_header = extension_header: header_name HCOLON header_value: header_value
954
+
955
+ header_name = token
956
+
957
+ header_value = (TEXT_UTF8char / UTF8_CONT / LWS)*
958
+
959
+ message_body = OCTET*
960
+
961
+
962
+ // STUN URI (draft-nandakumar-rtcweb-stun-uri)
963
+
964
+ stun_URI = stun_scheme ":" stun_host_port
965
+
966
+ stun_scheme = scheme: ("stuns"i / "stun"i) {
967
+ options = options || { data: {}};options.data.scheme = scheme; }
968
+
969
+ stun_host_port = stun_host ( ":" port )?
970
+
971
+ stun_host = host: (IPv4address / IPv6reference / reg_name) {
972
+ options = options || { data: {}};
973
+ options.data.host = host; }
974
+
975
+ stun_unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
976
+
977
+ sub_delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
978
+
979
+
980
+ // TURN URI (draft-petithuguenin-behave-turn-uris)
981
+
982
+ turn_URI = turn_scheme ":" stun_host_port ( "?transport=" transport )?
983
+
984
+ turn_scheme = scheme: ("turns"i / "turn"i) {
985
+ options = options || { data: {}};options.data.scheme = scheme; }
986
+
987
+ turn_transport = transport: ("udp"i / "tcp"i / unreserved*) {
988
+ options = options || { data: {}};options.data.transport = transport; }
989
+
990
+ // UUID URI
991
+ uuid = hex8 "-" hex4 "-" hex4 "-" hex4 "-" hex12 {
992
+ options = options || { data: {}};options.data = text(); }
993
+ hex4 = HEXDIG HEXDIG HEXDIG HEXDIG
994
+ hex8 = hex4 hex4
995
+ hex12 = hex4 hex4 hex4
996
+
997
+ // RFC 3420 (message/sipfrag)
998
+
999
+ sipfrag = Request_Response header* (CRLF message_body)?
1000
+
1001
+ // RFC 3892 (Referred-By)
1002
+
1003
+ Referred_By = ("Referred-By" / "b") HCOLON referrer_uri ( SEMI (referredby_id_param / generic_param))*
1004
+
1005
+ referrer_uri = (name_addr / addr_spec)
1006
+
1007
+ referredby_id_param = "cid" EQUAL sip_clean_msg_id
1008
+
1009
+ sip_clean_msg_id = LDQUOT mark "@" (mark / host) RDQUOT