@azure/communication-call-automation 1.5.0-beta.2 → 1.6.0-alpha.20250711.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 (415) hide show
  1. package/README.md +51 -1
  2. package/dist/browser/callAutomationClient.d.ts +9 -2
  3. package/dist/browser/callAutomationClient.d.ts.map +1 -1
  4. package/dist/browser/callAutomationClient.js +115 -10
  5. package/dist/browser/callAutomationClient.js.map +1 -1
  6. package/dist/browser/callAutomationEventParser.d.ts.map +1 -1
  7. package/dist/browser/callAutomationEventParser.js +47 -1
  8. package/dist/browser/callAutomationEventParser.js.map +1 -1
  9. package/dist/browser/callConnection.d.ts +16 -6
  10. package/dist/browser/callConnection.d.ts.map +1 -1
  11. package/dist/browser/callConnection.js +166 -15
  12. package/dist/browser/callConnection.js.map +1 -1
  13. package/dist/browser/callMedia.d.ts +20 -10
  14. package/dist/browser/callMedia.d.ts.map +1 -1
  15. package/dist/browser/callMedia.js +190 -22
  16. package/dist/browser/callMedia.js.map +1 -1
  17. package/dist/browser/callRecording.d.ts +8 -2
  18. package/dist/browser/callRecording.d.ts.map +1 -1
  19. package/dist/browser/callRecording.js +20 -5
  20. package/dist/browser/callRecording.js.map +1 -1
  21. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts +39 -0
  22. package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts.map +1 -0
  23. package/dist/browser/eventprocessor/callAutomationEventProcessor.js +137 -0
  24. package/dist/browser/eventprocessor/callAutomationEventProcessor.js.map +1 -0
  25. package/dist/browser/eventprocessor/eventResponses.d.ts +134 -0
  26. package/dist/browser/eventprocessor/eventResponses.d.ts.map +1 -0
  27. package/dist/browser/eventprocessor/eventResponses.js +4 -0
  28. package/dist/browser/eventprocessor/eventResponses.js.map +1 -0
  29. package/dist/browser/generated/src/callAutomationApiClient.d.ts +2 -1
  30. package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -1
  31. package/dist/browser/generated/src/callAutomationApiClient.js +4 -3
  32. package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -1
  33. package/dist/browser/generated/src/models/index.d.ts +971 -206
  34. package/dist/browser/generated/src/models/index.d.ts.map +1 -1
  35. package/dist/browser/generated/src/models/index.js +124 -46
  36. package/dist/browser/generated/src/models/index.js.map +1 -1
  37. package/dist/browser/generated/src/models/mappers.d.ts +59 -11
  38. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
  39. package/dist/browser/generated/src/models/mappers.js +2122 -466
  40. package/dist/browser/generated/src/models/mappers.js.map +1 -1
  41. package/dist/browser/generated/src/models/parameters.d.ts +8 -1
  42. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
  43. package/dist/browser/generated/src/models/parameters.js +45 -6
  44. package/dist/browser/generated/src/models/parameters.js.map +1 -1
  45. package/dist/browser/generated/src/operations/callConnection.d.ts +16 -2
  46. package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -1
  47. package/dist/browser/generated/src/operations/callConnection.js +65 -1
  48. package/dist/browser/generated/src/operations/callConnection.js.map +1 -1
  49. package/dist/browser/generated/src/operations/callDialog.d.ts +35 -0
  50. package/dist/browser/generated/src/operations/callDialog.d.ts.map +1 -0
  51. package/dist/browser/generated/src/operations/callDialog.js +111 -0
  52. package/dist/browser/generated/src/operations/callDialog.js.map +1 -0
  53. package/dist/browser/generated/src/operations/callMedia.d.ts +15 -8
  54. package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -1
  55. package/dist/browser/generated/src/operations/callMedia.js +50 -25
  56. package/dist/browser/generated/src/operations/callMedia.js.map +1 -1
  57. package/dist/browser/generated/src/operations/callRecording.d.ts +7 -1
  58. package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -1
  59. package/dist/browser/generated/src/operations/callRecording.js +24 -0
  60. package/dist/browser/generated/src/operations/callRecording.js.map +1 -1
  61. package/dist/browser/generated/src/operations/index.d.ts +1 -0
  62. package/dist/browser/generated/src/operations/index.d.ts.map +1 -1
  63. package/dist/browser/generated/src/operations/index.js +1 -0
  64. package/dist/browser/generated/src/operations/index.js.map +1 -1
  65. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +16 -2
  66. package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  67. package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  68. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts +27 -0
  69. package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts.map +1 -0
  70. package/dist/browser/generated/src/operationsInterfaces/callDialog.js +9 -0
  71. package/dist/browser/generated/src/operationsInterfaces/callDialog.js.map +1 -0
  72. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +15 -8
  73. package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  74. package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  75. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +7 -1
  76. package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  77. package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  78. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +1 -0
  79. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  80. package/dist/browser/generated/src/operationsInterfaces/index.js +1 -0
  81. package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -1
  82. package/dist/browser/index.d.ts +2 -0
  83. package/dist/browser/index.d.ts.map +1 -1
  84. package/dist/browser/index.js +2 -0
  85. package/dist/browser/index.js.map +1 -1
  86. package/dist/browser/models/constants.js +1 -1
  87. package/dist/browser/models/constants.js.map +1 -1
  88. package/dist/browser/models/events.d.ts +188 -62
  89. package/dist/browser/models/events.d.ts.map +1 -1
  90. package/dist/browser/models/events.js.map +1 -1
  91. package/dist/browser/models/models.d.ts +85 -7
  92. package/dist/browser/models/models.d.ts.map +1 -1
  93. package/dist/browser/models/models.js +3 -1
  94. package/dist/browser/models/models.js.map +1 -1
  95. package/dist/browser/models/options.d.ts +49 -2
  96. package/dist/browser/models/options.d.ts.map +1 -1
  97. package/dist/browser/models/options.js.map +1 -1
  98. package/dist/browser/models/responses.d.ts +82 -10
  99. package/dist/browser/models/responses.d.ts.map +1 -1
  100. package/dist/browser/models/responses.js.map +1 -1
  101. package/dist/browser/utli/converters.d.ts +26 -2
  102. package/dist/browser/utli/converters.d.ts.map +1 -1
  103. package/dist/browser/utli/converters.js +114 -19
  104. package/dist/browser/utli/converters.js.map +1 -1
  105. package/dist/commonjs/callAutomationClient.d.ts +9 -2
  106. package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
  107. package/dist/commonjs/callAutomationClient.js +116 -11
  108. package/dist/commonjs/callAutomationClient.js.map +1 -1
  109. package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
  110. package/dist/commonjs/callAutomationEventParser.js +46 -0
  111. package/dist/commonjs/callAutomationEventParser.js.map +1 -1
  112. package/dist/commonjs/callConnection.d.ts +16 -6
  113. package/dist/commonjs/callConnection.d.ts.map +1 -1
  114. package/dist/commonjs/callConnection.js +167 -16
  115. package/dist/commonjs/callConnection.js.map +1 -1
  116. package/dist/commonjs/callMedia.d.ts +20 -10
  117. package/dist/commonjs/callMedia.d.ts.map +1 -1
  118. package/dist/commonjs/callMedia.js +209 -41
  119. package/dist/commonjs/callMedia.js.map +1 -1
  120. package/dist/commonjs/callRecording.d.ts +8 -2
  121. package/dist/commonjs/callRecording.d.ts.map +1 -1
  122. package/dist/commonjs/callRecording.js +20 -5
  123. package/dist/commonjs/callRecording.js.map +1 -1
  124. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts +39 -0
  125. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts.map +1 -0
  126. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js +141 -0
  127. package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js.map +1 -0
  128. package/dist/commonjs/eventprocessor/eventResponses.d.ts +134 -0
  129. package/dist/commonjs/eventprocessor/eventResponses.d.ts.map +1 -0
  130. package/dist/commonjs/eventprocessor/eventResponses.js +5 -0
  131. package/dist/commonjs/eventprocessor/eventResponses.js.map +1 -0
  132. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +2 -1
  133. package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -1
  134. package/dist/commonjs/generated/src/callAutomationApiClient.js +3 -2
  135. package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -1
  136. package/dist/commonjs/generated/src/models/index.d.ts +971 -206
  137. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
  138. package/dist/commonjs/generated/src/models/index.js +125 -47
  139. package/dist/commonjs/generated/src/models/index.js.map +1 -1
  140. package/dist/commonjs/generated/src/models/mappers.d.ts +59 -11
  141. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
  142. package/dist/commonjs/generated/src/models/mappers.js +2125 -469
  143. package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
  144. package/dist/commonjs/generated/src/models/parameters.d.ts +8 -1
  145. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
  146. package/dist/commonjs/generated/src/models/parameters.js +45 -6
  147. package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
  148. package/dist/commonjs/generated/src/operations/callConnection.d.ts +16 -2
  149. package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -1
  150. package/dist/commonjs/generated/src/operations/callConnection.js +65 -1
  151. package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -1
  152. package/dist/commonjs/generated/src/operations/callDialog.d.ts +35 -0
  153. package/dist/commonjs/generated/src/operations/callDialog.d.ts.map +1 -0
  154. package/dist/commonjs/generated/src/operations/callDialog.js +116 -0
  155. package/dist/commonjs/generated/src/operations/callDialog.js.map +1 -0
  156. package/dist/commonjs/generated/src/operations/callMedia.d.ts +15 -8
  157. package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
  158. package/dist/commonjs/generated/src/operations/callMedia.js +50 -25
  159. package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -1
  160. package/dist/commonjs/generated/src/operations/callRecording.d.ts +7 -1
  161. package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -1
  162. package/dist/commonjs/generated/src/operations/callRecording.js +24 -0
  163. package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -1
  164. package/dist/commonjs/generated/src/operations/index.d.ts +1 -0
  165. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -1
  166. package/dist/commonjs/generated/src/operations/index.js +1 -0
  167. package/dist/commonjs/generated/src/operations/index.js.map +1 -1
  168. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +16 -2
  169. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  170. package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  171. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts +27 -0
  172. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts.map +1 -0
  173. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js +10 -0
  174. package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js.map +1 -0
  175. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +15 -8
  176. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  177. package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  178. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +7 -1
  179. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  180. package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  181. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +1 -0
  182. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  183. package/dist/commonjs/generated/src/operationsInterfaces/index.js +1 -0
  184. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
  185. package/dist/commonjs/index.d.ts +2 -0
  186. package/dist/commonjs/index.d.ts.map +1 -1
  187. package/dist/commonjs/index.js +2 -0
  188. package/dist/commonjs/index.js.map +1 -1
  189. package/dist/commonjs/models/constants.js +1 -1
  190. package/dist/commonjs/models/constants.js.map +1 -1
  191. package/dist/commonjs/models/events.d.ts +188 -62
  192. package/dist/commonjs/models/events.d.ts.map +1 -1
  193. package/dist/commonjs/models/events.js.map +1 -1
  194. package/dist/commonjs/models/models.d.ts +85 -7
  195. package/dist/commonjs/models/models.d.ts.map +1 -1
  196. package/dist/commonjs/models/models.js +11 -6
  197. package/dist/commonjs/models/models.js.map +1 -1
  198. package/dist/commonjs/models/options.d.ts +49 -2
  199. package/dist/commonjs/models/options.d.ts.map +1 -1
  200. package/dist/commonjs/models/options.js.map +1 -1
  201. package/dist/commonjs/models/responses.d.ts +82 -10
  202. package/dist/commonjs/models/responses.d.ts.map +1 -1
  203. package/dist/commonjs/models/responses.js.map +1 -1
  204. package/dist/commonjs/tsdoc-metadata.json +1 -1
  205. package/dist/commonjs/utli/converters.d.ts +26 -2
  206. package/dist/commonjs/utli/converters.d.ts.map +1 -1
  207. package/dist/commonjs/utli/converters.js +119 -18
  208. package/dist/commonjs/utli/converters.js.map +1 -1
  209. package/dist/esm/callAutomationClient.d.ts +9 -2
  210. package/dist/esm/callAutomationClient.d.ts.map +1 -1
  211. package/dist/esm/callAutomationClient.js +115 -10
  212. package/dist/esm/callAutomationClient.js.map +1 -1
  213. package/dist/esm/callAutomationEventParser.d.ts.map +1 -1
  214. package/dist/esm/callAutomationEventParser.js +47 -1
  215. package/dist/esm/callAutomationEventParser.js.map +1 -1
  216. package/dist/esm/callConnection.d.ts +16 -6
  217. package/dist/esm/callConnection.d.ts.map +1 -1
  218. package/dist/esm/callConnection.js +166 -15
  219. package/dist/esm/callConnection.js.map +1 -1
  220. package/dist/esm/callMedia.d.ts +20 -10
  221. package/dist/esm/callMedia.d.ts.map +1 -1
  222. package/dist/esm/callMedia.js +190 -22
  223. package/dist/esm/callMedia.js.map +1 -1
  224. package/dist/esm/callRecording.d.ts +8 -2
  225. package/dist/esm/callRecording.d.ts.map +1 -1
  226. package/dist/esm/callRecording.js +20 -5
  227. package/dist/esm/callRecording.js.map +1 -1
  228. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts +39 -0
  229. package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts.map +1 -0
  230. package/dist/esm/eventprocessor/callAutomationEventProcessor.js +137 -0
  231. package/dist/esm/eventprocessor/callAutomationEventProcessor.js.map +1 -0
  232. package/dist/esm/eventprocessor/eventResponses.d.ts +134 -0
  233. package/dist/esm/eventprocessor/eventResponses.d.ts.map +1 -0
  234. package/dist/esm/eventprocessor/eventResponses.js +4 -0
  235. package/dist/esm/eventprocessor/eventResponses.js.map +1 -0
  236. package/dist/esm/generated/src/callAutomationApiClient.d.ts +2 -1
  237. package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -1
  238. package/dist/esm/generated/src/callAutomationApiClient.js +4 -3
  239. package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
  240. package/dist/esm/generated/src/models/index.d.ts +971 -206
  241. package/dist/esm/generated/src/models/index.d.ts.map +1 -1
  242. package/dist/esm/generated/src/models/index.js +124 -46
  243. package/dist/esm/generated/src/models/index.js.map +1 -1
  244. package/dist/esm/generated/src/models/mappers.d.ts +59 -11
  245. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
  246. package/dist/esm/generated/src/models/mappers.js +2122 -466
  247. package/dist/esm/generated/src/models/mappers.js.map +1 -1
  248. package/dist/esm/generated/src/models/parameters.d.ts +8 -1
  249. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
  250. package/dist/esm/generated/src/models/parameters.js +45 -6
  251. package/dist/esm/generated/src/models/parameters.js.map +1 -1
  252. package/dist/esm/generated/src/operations/callConnection.d.ts +16 -2
  253. package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -1
  254. package/dist/esm/generated/src/operations/callConnection.js +65 -1
  255. package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
  256. package/dist/esm/generated/src/operations/callDialog.d.ts +35 -0
  257. package/dist/esm/generated/src/operations/callDialog.d.ts.map +1 -0
  258. package/dist/esm/generated/src/operations/callDialog.js +111 -0
  259. package/dist/esm/generated/src/operations/callDialog.js.map +1 -0
  260. package/dist/esm/generated/src/operations/callMedia.d.ts +15 -8
  261. package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
  262. package/dist/esm/generated/src/operations/callMedia.js +50 -25
  263. package/dist/esm/generated/src/operations/callMedia.js.map +1 -1
  264. package/dist/esm/generated/src/operations/callRecording.d.ts +7 -1
  265. package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -1
  266. package/dist/esm/generated/src/operations/callRecording.js +24 -0
  267. package/dist/esm/generated/src/operations/callRecording.js.map +1 -1
  268. package/dist/esm/generated/src/operations/index.d.ts +1 -0
  269. package/dist/esm/generated/src/operations/index.d.ts.map +1 -1
  270. package/dist/esm/generated/src/operations/index.js +1 -0
  271. package/dist/esm/generated/src/operations/index.js.map +1 -1
  272. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +16 -2
  273. package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  274. package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  275. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts +27 -0
  276. package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts.map +1 -0
  277. package/dist/esm/generated/src/operationsInterfaces/callDialog.js +9 -0
  278. package/dist/esm/generated/src/operationsInterfaces/callDialog.js.map +1 -0
  279. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +15 -8
  280. package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  281. package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  282. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +7 -1
  283. package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  284. package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  285. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +1 -0
  286. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  287. package/dist/esm/generated/src/operationsInterfaces/index.js +1 -0
  288. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -1
  289. package/dist/esm/index.d.ts +2 -0
  290. package/dist/esm/index.d.ts.map +1 -1
  291. package/dist/esm/index.js +2 -0
  292. package/dist/esm/index.js.map +1 -1
  293. package/dist/esm/models/constants.js +1 -1
  294. package/dist/esm/models/constants.js.map +1 -1
  295. package/dist/esm/models/events.d.ts +188 -62
  296. package/dist/esm/models/events.d.ts.map +1 -1
  297. package/dist/esm/models/events.js.map +1 -1
  298. package/dist/esm/models/models.d.ts +85 -7
  299. package/dist/esm/models/models.d.ts.map +1 -1
  300. package/dist/esm/models/models.js +3 -1
  301. package/dist/esm/models/models.js.map +1 -1
  302. package/dist/esm/models/options.d.ts +49 -2
  303. package/dist/esm/models/options.d.ts.map +1 -1
  304. package/dist/esm/models/options.js.map +1 -1
  305. package/dist/esm/models/responses.d.ts +82 -10
  306. package/dist/esm/models/responses.d.ts.map +1 -1
  307. package/dist/esm/models/responses.js.map +1 -1
  308. package/dist/esm/utli/converters.d.ts +26 -2
  309. package/dist/esm/utli/converters.d.ts.map +1 -1
  310. package/dist/esm/utli/converters.js +114 -19
  311. package/dist/esm/utli/converters.js.map +1 -1
  312. package/dist/react-native/callAutomationClient.d.ts +9 -2
  313. package/dist/react-native/callAutomationClient.d.ts.map +1 -1
  314. package/dist/react-native/callAutomationClient.js +115 -10
  315. package/dist/react-native/callAutomationClient.js.map +1 -1
  316. package/dist/react-native/callAutomationEventParser.d.ts.map +1 -1
  317. package/dist/react-native/callAutomationEventParser.js +47 -1
  318. package/dist/react-native/callAutomationEventParser.js.map +1 -1
  319. package/dist/react-native/callConnection.d.ts +16 -6
  320. package/dist/react-native/callConnection.d.ts.map +1 -1
  321. package/dist/react-native/callConnection.js +166 -15
  322. package/dist/react-native/callConnection.js.map +1 -1
  323. package/dist/react-native/callMedia.d.ts +20 -10
  324. package/dist/react-native/callMedia.d.ts.map +1 -1
  325. package/dist/react-native/callMedia.js +190 -22
  326. package/dist/react-native/callMedia.js.map +1 -1
  327. package/dist/react-native/callRecording.d.ts +8 -2
  328. package/dist/react-native/callRecording.d.ts.map +1 -1
  329. package/dist/react-native/callRecording.js +20 -5
  330. package/dist/react-native/callRecording.js.map +1 -1
  331. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts +39 -0
  332. package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts.map +1 -0
  333. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js +137 -0
  334. package/dist/react-native/eventprocessor/callAutomationEventProcessor.js.map +1 -0
  335. package/dist/react-native/eventprocessor/eventResponses.d.ts +134 -0
  336. package/dist/react-native/eventprocessor/eventResponses.d.ts.map +1 -0
  337. package/dist/react-native/eventprocessor/eventResponses.js +4 -0
  338. package/dist/react-native/eventprocessor/eventResponses.js.map +1 -0
  339. package/dist/react-native/generated/src/callAutomationApiClient.d.ts +2 -1
  340. package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -1
  341. package/dist/react-native/generated/src/callAutomationApiClient.js +4 -3
  342. package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -1
  343. package/dist/react-native/generated/src/models/index.d.ts +971 -206
  344. package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
  345. package/dist/react-native/generated/src/models/index.js +124 -46
  346. package/dist/react-native/generated/src/models/index.js.map +1 -1
  347. package/dist/react-native/generated/src/models/mappers.d.ts +59 -11
  348. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
  349. package/dist/react-native/generated/src/models/mappers.js +2122 -466
  350. package/dist/react-native/generated/src/models/mappers.js.map +1 -1
  351. package/dist/react-native/generated/src/models/parameters.d.ts +8 -1
  352. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
  353. package/dist/react-native/generated/src/models/parameters.js +45 -6
  354. package/dist/react-native/generated/src/models/parameters.js.map +1 -1
  355. package/dist/react-native/generated/src/operations/callConnection.d.ts +16 -2
  356. package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -1
  357. package/dist/react-native/generated/src/operations/callConnection.js +65 -1
  358. package/dist/react-native/generated/src/operations/callConnection.js.map +1 -1
  359. package/dist/react-native/generated/src/operations/callDialog.d.ts +35 -0
  360. package/dist/react-native/generated/src/operations/callDialog.d.ts.map +1 -0
  361. package/dist/react-native/generated/src/operations/callDialog.js +111 -0
  362. package/dist/react-native/generated/src/operations/callDialog.js.map +1 -0
  363. package/dist/react-native/generated/src/operations/callMedia.d.ts +15 -8
  364. package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -1
  365. package/dist/react-native/generated/src/operations/callMedia.js +50 -25
  366. package/dist/react-native/generated/src/operations/callMedia.js.map +1 -1
  367. package/dist/react-native/generated/src/operations/callRecording.d.ts +7 -1
  368. package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -1
  369. package/dist/react-native/generated/src/operations/callRecording.js +24 -0
  370. package/dist/react-native/generated/src/operations/callRecording.js.map +1 -1
  371. package/dist/react-native/generated/src/operations/index.d.ts +1 -0
  372. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -1
  373. package/dist/react-native/generated/src/operations/index.js +1 -0
  374. package/dist/react-native/generated/src/operations/index.js.map +1 -1
  375. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +16 -2
  376. package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
  377. package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -1
  378. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts +27 -0
  379. package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts.map +1 -0
  380. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js +9 -0
  381. package/dist/react-native/generated/src/operationsInterfaces/callDialog.js.map +1 -0
  382. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +15 -8
  383. package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
  384. package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -1
  385. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +7 -1
  386. package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
  387. package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -1
  388. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +1 -0
  389. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -1
  390. package/dist/react-native/generated/src/operationsInterfaces/index.js +1 -0
  391. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -1
  392. package/dist/react-native/index.d.ts +2 -0
  393. package/dist/react-native/index.d.ts.map +1 -1
  394. package/dist/react-native/index.js +2 -0
  395. package/dist/react-native/index.js.map +1 -1
  396. package/dist/react-native/models/constants.js +1 -1
  397. package/dist/react-native/models/constants.js.map +1 -1
  398. package/dist/react-native/models/events.d.ts +188 -62
  399. package/dist/react-native/models/events.d.ts.map +1 -1
  400. package/dist/react-native/models/events.js.map +1 -1
  401. package/dist/react-native/models/models.d.ts +85 -7
  402. package/dist/react-native/models/models.d.ts.map +1 -1
  403. package/dist/react-native/models/models.js +3 -1
  404. package/dist/react-native/models/models.js.map +1 -1
  405. package/dist/react-native/models/options.d.ts +49 -2
  406. package/dist/react-native/models/options.d.ts.map +1 -1
  407. package/dist/react-native/models/options.js.map +1 -1
  408. package/dist/react-native/models/responses.d.ts +82 -10
  409. package/dist/react-native/models/responses.d.ts.map +1 -1
  410. package/dist/react-native/models/responses.js.map +1 -1
  411. package/dist/react-native/utli/converters.d.ts +26 -2
  412. package/dist/react-native/utli/converters.d.ts.map +1 -1
  413. package/dist/react-native/utli/converters.js +114 -19
  414. package/dist/react-native/utli/converters.js.map +1 -1
  415. package/package.json +16 -22
@@ -4,21 +4,19 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.CallMedia = void 0;
6
6
  const index_js_1 = require("./generated/src/index.js");
7
- const index_js_2 = require("./generated/src/index.js");
8
- const index_js_3 = require("./generated/src/operations/index.js");
7
+ const index_js_2 = require("./generated/src/operations/index.js");
9
8
  const communication_common_1 = require("@azure/communication-common");
10
- const communication_common_2 = require("@azure/communication-common");
11
9
  const core_util_1 = require("@azure/core-util");
10
+ const callAutomationAuthPolicy_js_1 = require("./credential/callAutomationAuthPolicy.js");
12
11
  /**
13
12
  * CallMedia class represents call media related APIs.
14
13
  */
15
14
  class CallMedia {
16
- constructor(callConnectionId, endpoint, credential, options) {
17
- this.callAutomationApiClient = new index_js_1.CallAutomationApiClient(endpoint, options);
18
- const authPolicy = (0, communication_common_1.createCommunicationAuthPolicy)(credential);
19
- this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
15
+ constructor(callConnectionId, endpoint, credential, eventProcessor, options) {
16
+ this.callAutomationApiClient = (0, callAutomationAuthPolicy_js_1.createCustomCallAutomationApiClient)(credential, options, endpoint);
20
17
  this.callConnectionId = callConnectionId;
21
- this.callMedia = new index_js_3.CallMediaImpl(this.callAutomationApiClient);
18
+ this.callAutomationEventProcessor = eventProcessor;
19
+ this.callMedia = new index_js_2.CallMediaImpl(this.callAutomationApiClient);
22
20
  }
23
21
  createPlaySourceInternal(playSource) {
24
22
  if (playSource.kind === "fileSource") {
@@ -26,8 +24,11 @@ class CallMedia {
26
24
  uri: playSource.url,
27
25
  };
28
26
  return {
29
- kind: index_js_2.KnownPlaySourceType.File,
27
+ kind: index_js_1.KnownPlaySourceType.File,
30
28
  file: fileSource,
29
+ playSourceCacheId: playSource.playSourceCacheId
30
+ ? playSource.playSourceCacheId
31
+ : playSource.playsourcacheid,
31
32
  };
32
33
  }
33
34
  else if (playSource.kind === "textSource") {
@@ -39,8 +40,11 @@ class CallMedia {
39
40
  customVoiceEndpointId: playSource.customVoiceEndpointId,
40
41
  };
41
42
  return {
42
- kind: index_js_2.KnownPlaySourceType.Text,
43
+ kind: index_js_1.KnownPlaySourceType.Text,
43
44
  text: textSource,
45
+ playSourceCacheId: playSource.playSourceCacheId
46
+ ? playSource.playSourceCacheId
47
+ : playSource.playsourcacheid,
44
48
  };
45
49
  }
46
50
  else if (playSource.kind === "ssmlSource") {
@@ -49,8 +53,11 @@ class CallMedia {
49
53
  customVoiceEndpointId: playSource.customVoiceEndpointId,
50
54
  };
51
55
  return {
52
- kind: index_js_2.KnownPlaySourceType.Ssml,
56
+ kind: index_js_1.KnownPlaySourceType.Ssml,
53
57
  ssml: ssmlSource,
58
+ playSourceCacheId: playSource.playSourceCacheId
59
+ ? playSource.playSourceCacheId
60
+ : playSource.playsourcacheid,
54
61
  };
55
62
  }
56
63
  throw new Error("Invalid play source");
@@ -65,18 +72,54 @@ class CallMedia {
65
72
  async play(playSources, playTo, options = { loop: false }) {
66
73
  const playRequest = {
67
74
  playSources: playSources.map((source) => this.createPlaySourceInternal(source)),
68
- playTo: playTo.map((identifier) => (0, communication_common_2.serializeCommunicationIdentifier)(identifier)),
75
+ playTo: playTo.map((identifier) => (0, communication_common_1.serializeCommunicationIdentifier)(identifier)),
69
76
  playOptions: {
70
77
  loop: false,
78
+ interruptHoldAudio: false,
71
79
  },
72
- operationContext: options.operationContext,
80
+ operationContext: options.operationContext ? options.operationContext : (0, core_util_1.randomUUID)(),
73
81
  operationCallbackUri: options.operationCallbackUrl,
74
82
  };
75
83
  if (options.loop !== undefined) {
76
84
  playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined
77
85
  playRequest.playOptions.loop = options.loop;
78
86
  }
79
- return this.callMedia.play(this.callConnectionId, playRequest, options);
87
+ if (options.interruptHoldAudio !== undefined) {
88
+ playRequest.playOptions = playRequest.playOptions || {
89
+ loop: false,
90
+ interruptHoldAudio: false,
91
+ }; // Ensure playOptions is defined
92
+ playRequest.playOptions.interruptHoldAudio = options.interruptHoldAudio;
93
+ }
94
+ await this.callMedia.play(this.callConnectionId, playRequest, options);
95
+ const playResult = {
96
+ waitForEventProcessor: async (abortSignal, timeoutInMs) => {
97
+ const playEventResult = {
98
+ isSuccess: false,
99
+ };
100
+ await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
101
+ if (event.callConnectionId === this.callConnectionId &&
102
+ event.kind === "PlayCompleted" &&
103
+ event.operationContext === playRequest.operationContext) {
104
+ playEventResult.isSuccess = true;
105
+ playEventResult.successResult = event;
106
+ return true;
107
+ }
108
+ else if (event.callConnectionId === this.callConnectionId &&
109
+ event.kind === "PlayFailed" &&
110
+ event.operationContext === playRequest.operationContext) {
111
+ playEventResult.isSuccess = false;
112
+ playEventResult.failureResult = event;
113
+ return true;
114
+ }
115
+ else {
116
+ return false;
117
+ }
118
+ }, abortSignal, timeoutInMs);
119
+ return playEventResult;
120
+ },
121
+ };
122
+ return playResult;
80
123
  }
81
124
  /**
82
125
  * Play to all participants.
@@ -101,10 +144,39 @@ class CallMedia {
101
144
  if (options.interruptCallMediaOperation !== undefined) {
102
145
  playRequest.playOptions = playRequest.playOptions || {
103
146
  loop: false,
104
- };
105
- playRequest.interruptCallMediaOperation = options.interruptCallMediaOperation;
147
+ interruptCallMediaOperation: false,
148
+ }; // Ensure playOptions is defined
149
+ playRequest.playOptions.interruptCallMediaOperation = options.interruptCallMediaOperation;
106
150
  }
107
- return this.callMedia.play(this.callConnectionId, playRequest, options);
151
+ await this.callMedia.play(this.callConnectionId, playRequest, options);
152
+ const playResult = {
153
+ waitForEventProcessor: async (abortSignal, timeoutInMs) => {
154
+ const playEventResult = {
155
+ isSuccess: false,
156
+ };
157
+ await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
158
+ if (event.callConnectionId === this.callConnectionId &&
159
+ event.kind === "PlayCompleted" &&
160
+ event.operationContext === playRequest.operationContext) {
161
+ playEventResult.isSuccess = true;
162
+ playEventResult.successResult = event;
163
+ return true;
164
+ }
165
+ else if (event.callConnectionId === this.callConnectionId &&
166
+ event.kind === "PlayFailed" &&
167
+ event.operationContext === playRequest.operationContext) {
168
+ playEventResult.isSuccess = false;
169
+ playEventResult.failureResult = event;
170
+ return true;
171
+ }
172
+ else {
173
+ return false;
174
+ }
175
+ }, abortSignal, timeoutInMs);
176
+ return playEventResult;
177
+ },
178
+ };
179
+ return playResult;
108
180
  }
109
181
  createRecognizeRequest(targetParticipant, recognizeOptions) {
110
182
  if (recognizeOptions.kind === "callMediaRecognizeDtmfOptions") {
@@ -120,11 +192,11 @@ class CallMedia {
120
192
  initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds
121
193
  ? recognizeOptions.initialSilenceTimeoutInSeconds
122
194
  : 5,
123
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
195
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
124
196
  dtmfOptions: dtmfOptionsInternal,
125
197
  };
126
198
  return {
127
- recognizeInputType: index_js_2.KnownRecognizeInputType.Dtmf,
199
+ recognizeInputType: index_js_1.KnownRecognizeInputType.Dtmf,
128
200
  playPrompt: recognizeOptions.playPrompt
129
201
  ? this.createPlaySourceInternal(recognizeOptions.playPrompt)
130
202
  : undefined,
@@ -143,13 +215,13 @@ class CallMedia {
143
215
  initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds
144
216
  ? recognizeOptions.initialSilenceTimeoutInSeconds
145
217
  : 5,
146
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
218
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
147
219
  speechLanguage: recognizeOptions.speechLanguage,
148
220
  speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,
149
221
  choices: recognizeOptions.choices,
150
222
  };
151
223
  return {
152
- recognizeInputType: index_js_2.KnownRecognizeInputType.Choices,
224
+ recognizeInputType: index_js_1.KnownRecognizeInputType.Choices,
153
225
  playPrompt: recognizeOptions.playPrompt
154
226
  ? this.createPlaySourceInternal(recognizeOptions.playPrompt)
155
227
  : undefined,
@@ -173,13 +245,13 @@ class CallMedia {
173
245
  initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds
174
246
  ? recognizeOptions.initialSilenceTimeoutInSeconds
175
247
  : 5,
176
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
248
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
177
249
  speechOptions: speechOptions,
178
250
  speechLanguage: recognizeOptions.speechLanguage,
179
251
  speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,
180
252
  };
181
253
  return {
182
- recognizeInputType: index_js_2.KnownRecognizeInputType.Speech,
254
+ recognizeInputType: index_js_1.KnownRecognizeInputType.Speech,
183
255
  playPrompt: recognizeOptions.playPrompt
184
256
  ? this.createPlaySourceInternal(recognizeOptions.playPrompt)
185
257
  : undefined,
@@ -210,13 +282,13 @@ class CallMedia {
210
282
  initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds
211
283
  ? recognizeOptions.initialSilenceTimeoutInSeconds
212
284
  : 5,
213
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
285
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
214
286
  speechOptions: speechOptions,
215
287
  dtmfOptions: dtmfOptionsInternal,
216
288
  speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,
217
289
  };
218
290
  return {
219
- recognizeInputType: index_js_2.KnownRecognizeInputType.SpeechOrDtmf,
291
+ recognizeInputType: index_js_1.KnownRecognizeInputType.SpeechOrDtmf,
220
292
  playPrompt: recognizeOptions.playPrompt
221
293
  ? this.createPlaySourceInternal(recognizeOptions.playPrompt)
222
294
  : undefined,
@@ -243,7 +315,35 @@ class CallMedia {
243
315
  ? maxTonesOrOptions.operationContext
244
316
  : (0, core_util_1.randomUUID)();
245
317
  // New function signature logic
246
- return this.callMedia.recognize(this.callConnectionId, this.createRecognizeRequest(targetParticipant, maxTonesOrOptions), {});
318
+ await this.callMedia.recognize(this.callConnectionId, this.createRecognizeRequest(targetParticipant, maxTonesOrOptions), {});
319
+ const startRecognizingResult = {
320
+ waitForEventProcessor: async (abortSignal, timeoutInMs) => {
321
+ const startRecognizingEventResult = {
322
+ isSuccess: false,
323
+ };
324
+ await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
325
+ if (event.callConnectionId === this.callConnectionId &&
326
+ event.kind === "RecognizeCompleted" &&
327
+ event.operationContext === maxTonesOrOptions.operationContext) {
328
+ startRecognizingEventResult.isSuccess = true;
329
+ startRecognizingEventResult.successResult = event;
330
+ return true;
331
+ }
332
+ else if (event.callConnectionId === this.callConnectionId &&
333
+ event.kind === "RecognizeFailed" &&
334
+ event.operationContext === maxTonesOrOptions.operationContext) {
335
+ startRecognizingEventResult.isSuccess = false;
336
+ startRecognizingEventResult.failureResult = event;
337
+ return true;
338
+ }
339
+ else {
340
+ return false;
341
+ }
342
+ }, abortSignal, timeoutInMs);
343
+ return startRecognizingEventResult;
344
+ },
345
+ };
346
+ return startRecognizingResult;
247
347
  }
248
348
  throw new Error("Invalid params");
249
349
  }
@@ -251,7 +351,32 @@ class CallMedia {
251
351
  * Cancels all the queued media operations.
252
352
  */
253
353
  async cancelAllOperations() {
254
- return this.callMedia.cancelAllMediaOperations(this.callConnectionId, {});
354
+ await this.callMedia.cancelAllMediaOperations(this.callConnectionId, {});
355
+ const cancelAllMediaOperationsResult = {
356
+ waitForEventProcessor: async (abortSignal, timeoutInMs) => {
357
+ const cancelAllMediaOperationsEventResult = {
358
+ isSuccess: false,
359
+ };
360
+ await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
361
+ if (event.callConnectionId === this.callConnectionId && event.kind === "PlayCanceled") {
362
+ cancelAllMediaOperationsEventResult.isSuccess = true;
363
+ cancelAllMediaOperationsEventResult.playCanceledSuccessResult = event;
364
+ return true;
365
+ }
366
+ else if (event.callConnectionId === this.callConnectionId &&
367
+ event.kind === "RecognizeCanceled") {
368
+ cancelAllMediaOperationsEventResult.isSuccess = false;
369
+ cancelAllMediaOperationsEventResult.recognizeCanceledSuccessResult = event;
370
+ return true;
371
+ }
372
+ else {
373
+ return false;
374
+ }
375
+ }, abortSignal, timeoutInMs);
376
+ return cancelAllMediaOperationsEventResult;
377
+ },
378
+ };
379
+ return cancelAllMediaOperationsResult;
255
380
  }
256
381
  /**
257
382
  * Start continuous Dtmf recognition by subscribing to tones.
@@ -260,8 +385,8 @@ class CallMedia {
260
385
  * */
261
386
  async startContinuousDtmfRecognition(targetParticipant, options = {}) {
262
387
  const continuousDtmfRecognitionRequest = {
263
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
264
- operationContext: options.operationContext,
388
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
389
+ operationContext: options.operationContext ? options.operationContext : (0, core_util_1.randomUUID)(),
265
390
  };
266
391
  return this.callMedia.startContinuousDtmfRecognition(this.callConnectionId, continuousDtmfRecognitionRequest, {});
267
392
  }
@@ -272,8 +397,8 @@ class CallMedia {
272
397
  * */
273
398
  async stopContinuousDtmfRecognition(targetParticipant, options = {}) {
274
399
  const continuousDtmfRecognitionRequest = {
275
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
276
- operationContext: options.operationContext,
400
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
401
+ operationContext: options.operationContext ? options.operationContext : (0, core_util_1.randomUUID)(),
277
402
  operationCallbackUri: options.operationCallbackUrl,
278
403
  };
279
404
  return this.callMedia.stopContinuousDtmfRecognition(this.callConnectionId, continuousDtmfRecognitionRequest, {});
@@ -287,13 +412,38 @@ class CallMedia {
287
412
  async sendDtmfTones(tones, targetParticipant, options = {}) {
288
413
  const sendDtmfTonesRequest = {
289
414
  tones: tones,
290
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
291
- operationContext: options.operationContext,
415
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
416
+ operationContext: options.operationContext ? options.operationContext : (0, core_util_1.randomUUID)(),
292
417
  operationCallbackUri: options.operationCallbackUrl,
293
418
  };
294
- const optionsInternal = Object.assign(Object.assign({}, options), { repeatabilityFirstSent: new Date(), repeatabilityRequestID: (0, core_util_1.randomUUID)() });
295
- const result = await this.callMedia.sendDtmfTones(this.callConnectionId, sendDtmfTonesRequest, optionsInternal);
296
- const sendDtmfTonesResult = Object.assign({}, result);
419
+ await this.callMedia.sendDtmfTones(this.callConnectionId, sendDtmfTonesRequest, {});
420
+ const sendDtmfTonesResult = {
421
+ waitForEventProcessor: async (abortSignal, timeoutInMs) => {
422
+ const sendDtmfEventResult = {
423
+ isSuccess: false,
424
+ };
425
+ await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
426
+ if (event.callConnectionId === this.callConnectionId &&
427
+ event.kind === "SendDtmfTonesCompleted" &&
428
+ event.operationContext === sendDtmfTonesResult.operationContext) {
429
+ sendDtmfEventResult.isSuccess = true;
430
+ sendDtmfEventResult.successResult = event;
431
+ return true;
432
+ }
433
+ else if (event.callConnectionId === this.callConnectionId &&
434
+ event.kind === "SendDtmfTonesFailed" &&
435
+ event.operationContext === sendDtmfTonesResult.operationContext) {
436
+ sendDtmfEventResult.isSuccess = false;
437
+ sendDtmfEventResult.failureResult = event;
438
+ return true;
439
+ }
440
+ else {
441
+ return false;
442
+ }
443
+ }, abortSignal, timeoutInMs);
444
+ return sendDtmfEventResult;
445
+ },
446
+ };
297
447
  return sendDtmfTonesResult;
298
448
  }
299
449
  /**
@@ -304,12 +454,12 @@ class CallMedia {
304
454
  */
305
455
  async hold(targetParticipant, options = {}) {
306
456
  const holdRequest = {
307
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
457
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
308
458
  playSourceInfo: options.playSource !== undefined
309
459
  ? this.createPlaySourceInternal(options.playSource)
310
460
  : undefined,
311
461
  operationContext: options.operationContext !== undefined ? options.operationContext : undefined,
312
- operationCallbackUri: options.operationCallbackUrl !== undefined ? options.operationCallbackUrl : undefined,
462
+ operationCallbackUri: options.operationCallbackUri !== undefined ? options.operationCallbackUri : undefined,
313
463
  };
314
464
  return this.callMedia.hold(this.callConnectionId, holdRequest);
315
465
  }
@@ -321,7 +471,7 @@ class CallMedia {
321
471
  */
322
472
  async unhold(targetParticipant, options = {}) {
323
473
  const unholdRequest = {
324
- targetParticipant: (0, communication_common_2.serializeCommunicationIdentifier)(targetParticipant),
474
+ targetParticipant: (0, communication_common_1.serializeCommunicationIdentifier)(targetParticipant),
325
475
  operationContext: options.operationContext !== undefined ? options.operationContext : undefined,
326
476
  };
327
477
  return this.callMedia.unhold(this.callConnectionId, unholdRequest);
@@ -334,7 +484,8 @@ class CallMedia {
334
484
  const startTranscriptionRequest = {
335
485
  locale: options.locale,
336
486
  operationContext: options.operationContext,
337
- speechRecognitionModelEndpointId: options.speechRecognitionModelEndpointId,
487
+ speechModelEndpointId: options.speechRecognitionModelEndpointId,
488
+ operationCallbackUri: options.operationCallbackUrl,
338
489
  };
339
490
  return this.callMedia.startTranscription(this.callConnectionId, startTranscriptionRequest, {});
340
491
  }
@@ -345,6 +496,7 @@ class CallMedia {
345
496
  async stopTranscription(options = {}) {
346
497
  const stopTranscriptionRequest = {
347
498
  operationContext: options.operationContext,
499
+ operationCallbackUri: options.operationCallbackUrl,
348
500
  };
349
501
  return this.callMedia.stopTranscription(this.callConnectionId, stopTranscriptionRequest, {});
350
502
  }
@@ -355,8 +507,9 @@ class CallMedia {
355
507
  async updateTranscription(locale, options) {
356
508
  const updateTranscriptionRequest = {
357
509
  locale: locale,
358
- speechRecognitionModelEndpointId: options === null || options === void 0 ? void 0 : options.speechRecognitionModelEndpointId,
510
+ speechModelEndpointId: options === null || options === void 0 ? void 0 : options.speechRecognitionModelEndpointId,
359
511
  operationContext: options === null || options === void 0 ? void 0 : options.operationContext,
512
+ operationCallbackUri: options === null || options === void 0 ? void 0 : options.operationCallbackUrl,
360
513
  };
361
514
  return this.callMedia.updateTranscription(this.callConnectionId, updateTranscriptionRequest, {});
362
515
  }
@@ -382,6 +535,21 @@ class CallMedia {
382
535
  };
383
536
  return this.callMedia.stopMediaStreaming(this.callConnectionId, stopMediaStreamingRequest, options);
384
537
  }
538
+ /**
539
+ * Interrupt audio and announce to specific participant.
540
+ *
541
+ * @param playSources - A PlaySource representing the sources to play.
542
+ * @param playTo - The targets to play to.
543
+ * @param options - Additional attributes for interrupt audio and announce.
544
+ */
545
+ async interruptAudioAndAnnounce(playSources, playTo, options = {}) {
546
+ const interruptAudioAndAnnounceRequest = {
547
+ playSources: playSources.map((source) => this.createPlaySourceInternal(source)),
548
+ playTo: (0, communication_common_1.serializeCommunicationIdentifier)(playTo),
549
+ operationContext: options.operationContext,
550
+ };
551
+ return this.callMedia.interruptAudioAndAnnounce(this.callConnectionId, interruptAudioAndAnnounceRequest);
552
+ }
385
553
  }
386
554
  exports.CallMedia = CallMedia;
387
555
  //# sourceMappingURL=callMedia.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"callMedia.js","sourceRoot":"","sources":["../../src/callMedia.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,uDAsBkC;AAClC,uDAAwF;AAExF,kEAAoE;AAEpE,sEAGqC;AACrC,sEAA+E;AAsB/E,gDAA8C;AAE9C;;GAEG;AACH,MAAa,SAAS;IAIpB,YACE,gBAAwB,EACxB,QAAgB,EAChB,UAA2C,EAC3C,OAA+C;QAE/C,IAAI,CAAC,uBAAuB,GAAG,IAAI,kCAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9E,MAAM,UAAU,GAAG,IAAA,oDAA6B,EAAC,UAAU,CAAC,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OAGG;IACI,KAAK,CAAC,mBAAmB,CAAC,UAAsC,EAAE;QACvE,MAAM,0BAA0B,GAA+B;YAC7D,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;SACnD,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,mBAAmB,CACvC,IAAI,CAAC,gBAAgB,EACrB,0BAA0B,EAC1B,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,kBAAkB,CAAC,UAAqC,EAAE;QACrE,MAAM,yBAAyB,GAA8B;YAC3D,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;YAClD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;SAC3C,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,CACtC,IAAI,CAAC,gBAAgB,EACrB,yBAAyB,EACzB,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA/fD,8BA+fC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PlayRequest,\n PlaySourceInternal,\n FileSourceInternal,\n TextSourceInternal,\n SsmlSourceInternal,\n RecognizeRequest,\n RecognizeOptions,\n DtmfOptions,\n CallAutomationApiClient,\n CallAutomationApiClientOptionalParams,\n ContinuousDtmfRecognitionRequest,\n SendDtmfTonesRequest,\n Tone,\n SpeechOptions,\n StartTranscriptionRequest,\n StopTranscriptionRequest,\n UpdateTranscriptionRequest,\n HoldRequest,\n UnholdRequest,\n StartMediaStreamingRequest,\n StopMediaStreamingRequest,\n} from \"./generated/src/index.js\";\nimport { KnownPlaySourceType, KnownRecognizeInputType } from \"./generated/src/index.js\";\n\nimport { CallMediaImpl } from \"./generated/src/operations/index.js\";\n\nimport {\n CommunicationIdentifier,\n createCommunicationAuthPolicy,\n} from \"@azure/communication-common\";\nimport { serializeCommunicationIdentifier } from \"@azure/communication-common\";\n\nimport type { FileSource, TextSource, SsmlSource, DtmfTone } from \"./models/models.js\";\nimport type {\n PlayOptions,\n CallMediaRecognizeDtmfOptions,\n CallMediaRecognizeChoiceOptions,\n ContinuousDtmfRecognitionOptions,\n SendDtmfTonesOptions,\n CallMediaRecognizeSpeechOptions,\n CallMediaRecognizeSpeechOrDtmfOptions,\n StartTranscriptionOptions,\n StopTranscriptionOptions,\n HoldOptions,\n UnholdOptions,\n StartMediaStreamingOptions,\n StopMediaStreamingOptions,\n PlayToAllOptions,\n UpdateTranscriptionOptions,\n} from \"./models/options.js\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport type { SendDtmfTonesResult } from \"./models/responses.js\";\nimport { randomUUID } from \"@azure/core-util\";\n\n/**\n * CallMedia class represents call media related APIs.\n */\nexport class CallMedia {\n private readonly callConnectionId: string;\n private readonly callMedia: CallMediaImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n constructor(\n callConnectionId: string,\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = new CallAutomationApiClient(endpoint, options);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n this.callConnectionId = callConnectionId;\n this.callMedia = new CallMediaImpl(this.callAutomationApiClient);\n }\n\n private createPlaySourceInternal(\n playSource: FileSource | TextSource | SsmlSource,\n ): PlaySourceInternal {\n if (playSource.kind === \"fileSource\") {\n const fileSource: FileSourceInternal = {\n uri: playSource.url,\n };\n return {\n kind: KnownPlaySourceType.File,\n file: fileSource,\n };\n } else if (playSource.kind === \"textSource\") {\n const textSource: TextSourceInternal = {\n text: playSource.text,\n sourceLocale: playSource.sourceLocale,\n voiceKind: playSource.voiceKind,\n voiceName: playSource.voiceName,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Text,\n text: textSource,\n };\n } else if (playSource.kind === \"ssmlSource\") {\n const ssmlSource: SsmlSourceInternal = {\n ssmlText: playSource.ssmlText,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Ssml,\n ssml: ssmlSource,\n };\n }\n throw new Error(\"Invalid play source\");\n }\n\n /**\n * Play audio to a specific participant.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param playTo - The targets to play to.\n * @param options - Additional attributes for play.\n */\n public async play(\n playSources: (FileSource | TextSource | SsmlSource)[],\n playTo: CommunicationIdentifier[],\n options: PlayOptions = { loop: false },\n ): Promise<void> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: playTo.map((identifier) => serializeCommunicationIdentifier(identifier)),\n playOptions: {\n loop: false,\n },\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n return this.callMedia.play(this.callConnectionId, playRequest, options);\n }\n\n /**\n * Play to all participants.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param options - Additional attributes for play.\n */\n public async playToAll(\n playSources: (FileSource | TextSource | SsmlSource)[],\n options: PlayToAllOptions = { loop: false },\n ): Promise<void> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: [],\n playOptions: {\n loop: false,\n },\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n\n if (options.interruptCallMediaOperation !== undefined) {\n playRequest.playOptions = playRequest.playOptions || {\n loop: false,\n };\n playRequest.interruptCallMediaOperation = options.interruptCallMediaOperation;\n }\n\n return this.callMedia.play(this.callConnectionId, playRequest, options);\n }\n\n private createRecognizeRequest(\n targetParticipant: CommunicationIdentifier,\n recognizeOptions:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): RecognizeRequest {\n if (recognizeOptions.kind === \"callMediaRecognizeDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n dtmfOptions: dtmfOptionsInternal,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Dtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeChoiceOptions\") {\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n choices: recognizeOptions.choices,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Choices,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOptions\") {\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Speech,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOrDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n dtmfOptions: dtmfOptionsInternal,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.SpeechOrDtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n }\n throw new Error(\"Invalid recognizeOptions\");\n }\n\n /**\n * Recognize participant input.\n * @deprecated This method signature is deprecated. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\n * @param targetParticipant - Target participant.\n * @param maxTonesToCollect - Maximum number of DTMF tones to be collected.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesToCollect: number,\n options: CallMediaRecognizeDtmfOptions,\n ): Promise<void>;\n\n /**\n * Recognize participant input.\n * @param targetParticipant - Target participant.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n options:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): Promise<void>;\n async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesOrOptions:\n | number\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n options?: CallMediaRecognizeDtmfOptions,\n ): Promise<void> {\n if (typeof maxTonesOrOptions === \"number\" && options) {\n // Old function signature logic\n console.warn(\n \"Deprecated function signature used. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\",\n );\n options.maxTonesToCollect = maxTonesOrOptions;\n await this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, options),\n {},\n );\n } else if (typeof maxTonesOrOptions !== \"number\" && !options) {\n maxTonesOrOptions.operationContext = maxTonesOrOptions.operationContext\n ? maxTonesOrOptions.operationContext\n : randomUUID();\n // New function signature logic\n return this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, maxTonesOrOptions),\n {},\n );\n }\n throw new Error(\"Invalid params\");\n }\n\n /**\n * Cancels all the queued media operations.\n */\n public async cancelAllOperations(): Promise<void> {\n return this.callMedia.cancelAllMediaOperations(this.callConnectionId, {});\n }\n\n /**\n * Start continuous Dtmf recognition by subscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async startContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n };\n return this.callMedia.startContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Stop continuous Dtmf recognition by unsubscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async stopContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.stopContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Send Dtmf tones.\n * @param tones - List of tones to be sent to target participant.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for send Dtmf tones.\n * */\n public async sendDtmfTones(\n tones: Tone[] | DtmfTone[],\n targetParticipant: CommunicationIdentifier,\n options: SendDtmfTonesOptions = {},\n ): Promise<SendDtmfTonesResult> {\n const sendDtmfTonesRequest: SendDtmfTonesRequest = {\n tones: tones,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const result = await this.callMedia.sendDtmfTones(\n this.callConnectionId,\n sendDtmfTonesRequest,\n optionsInternal,\n );\n\n const sendDtmfTonesResult: SendDtmfTonesResult = {\n ...result,\n };\n\n return sendDtmfTonesResult;\n }\n\n /**\n * Put participant on hold while playing audio.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for hold participant.\n */\n public async hold(\n targetParticipant: CommunicationIdentifier,\n options: HoldOptions = {},\n ): Promise<void> {\n const holdRequest: HoldRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n playSourceInfo:\n options.playSource !== undefined\n ? this.createPlaySourceInternal(options.playSource)\n : undefined,\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n operationCallbackUri:\n options.operationCallbackUrl !== undefined ? options.operationCallbackUrl : undefined,\n };\n return this.callMedia.hold(this.callConnectionId, holdRequest);\n }\n\n /**\n * Remove participant from hold.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for unhold participant.\n */\n public async unhold(\n targetParticipant: CommunicationIdentifier,\n options: UnholdOptions = {},\n ): Promise<void> {\n const unholdRequest: UnholdRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n };\n return this.callMedia.unhold(this.callConnectionId, unholdRequest);\n }\n\n /**\n * Starts transcription in the call\n * @param options - Additional attributes for start transcription.\n */\n public async startTranscription(options: StartTranscriptionOptions = {}): Promise<void> {\n const startTranscriptionRequest: StartTranscriptionRequest = {\n locale: options.locale,\n operationContext: options.operationContext,\n speechRecognitionModelEndpointId: options.speechRecognitionModelEndpointId,\n };\n return this.callMedia.startTranscription(this.callConnectionId, startTranscriptionRequest, {});\n }\n\n /**\n * Stops transcription in the call.\n * @param options - Additional attributes for stop transcription.\n */\n public async stopTranscription(options: StopTranscriptionOptions = {}): Promise<void> {\n const stopTranscriptionRequest: StopTranscriptionRequest = {\n operationContext: options.operationContext,\n };\n return this.callMedia.stopTranscription(this.callConnectionId, stopTranscriptionRequest, {});\n }\n\n /**\n * Update transcription language.\n * @param locale - Defines new locale for transcription.\n */\n public async updateTranscription(\n locale: string,\n options?: UpdateTranscriptionOptions,\n ): Promise<void> {\n const updateTranscriptionRequest: UpdateTranscriptionRequest = {\n locale: locale,\n speechRecognitionModelEndpointId: options?.speechRecognitionModelEndpointId,\n operationContext: options?.operationContext,\n };\n return this.callMedia.updateTranscription(\n this.callConnectionId,\n updateTranscriptionRequest,\n {},\n );\n }\n /**\n * Starts media streaming in the call.\n * @param options - Additional attributes for start media streaming.\n */\n public async startMediaStreaming(options: StartMediaStreamingOptions = {}): Promise<void> {\n const startMediaStreamingRequest: StartMediaStreamingRequest = {\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.startMediaStreaming(\n this.callConnectionId,\n startMediaStreamingRequest,\n options,\n );\n }\n\n /**\n * Stops media streaming in the call.\n * @param options - Additional attributes for stop media streaming.\n */\n public async stopMediaStreaming(options: StopMediaStreamingOptions = {}): Promise<void> {\n const stopMediaStreamingRequest: StopMediaStreamingRequest = {\n operationCallbackUri: options.operationCallbackUrl,\n operationContext: options.operationContext,\n };\n return this.callMedia.stopMediaStreaming(\n this.callConnectionId,\n stopMediaStreamingRequest,\n options,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"callMedia.js","sourceRoot":"","sources":["../../src/callMedia.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAyBlC,uDAAwF;AAExF,kEAAoE;AAGpE,sEAA+E;AAmC/E,gDAA8C;AAC9C,0FAA+F;AAG/F;;GAEG;AACH,MAAa,SAAS;IAKpB,YACE,gBAAwB,EACxB,QAAgB,EAChB,UAA2C,EAC3C,cAA4C,EAC5C,OAA+C;QAE/C,IAAI,CAAC,uBAAuB,GAAG,IAAA,iEAAmC,EAChE,UAAU,EACV,OAAO,EACP,QAAQ,CACT,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,4BAA4B,GAAG,cAAc,CAAC;QACnD,IAAI,CAAC,SAAS,GAAG,IAAI,wBAAa,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACnE,CAAC;IAEO,wBAAwB,CAC9B,UAAgD;QAEhD,IAAI,UAAU,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACrC,MAAM,UAAU,GAAuB;gBACrC,GAAG,EAAE,UAAU,CAAC,GAAG;aACpB,CAAC;YACF,OAAO;gBACL,IAAI,EAAE,8BAAmB,CAAC,IAAI;gBAC9B,IAAI,EAAE,UAAU;gBAChB,iBA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,EAAE,IAAA,uDAAgC,EAAC,MAAM,CAAC;YAChD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;SAC3C,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAC7C,IAAI,CAAC,gBAAgB,EACrB,gCAAgC,CACjC,CAAC;IACJ,CAAC;CACF;AA1sBD,8BA0sBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PlayRequest,\n PlaySourceInternal,\n FileSourceInternal,\n TextSourceInternal,\n SsmlSourceInternal,\n RecognizeRequest,\n RecognizeOptions,\n DtmfOptions,\n CallAutomationApiClient,\n CallAutomationApiClientOptionalParams,\n ContinuousDtmfRecognitionRequest,\n SendDtmfTonesRequest,\n Tone,\n SpeechOptions,\n StartTranscriptionRequest,\n StopTranscriptionRequest,\n UpdateTranscriptionRequest,\n HoldRequest,\n UnholdRequest,\n StartMediaStreamingRequest,\n StopMediaStreamingRequest,\n} from \"./generated/src/index.js\";\nimport { KnownPlaySourceType, KnownRecognizeInputType } from \"./generated/src/index.js\";\n\nimport { CallMediaImpl } from \"./generated/src/operations/index.js\";\n\nimport type { CommunicationIdentifier } from \"@azure/communication-common\";\nimport { serializeCommunicationIdentifier } from \"@azure/communication-common\";\n\nimport type { FileSource, TextSource, SsmlSource, DtmfTone } from \"./models/models.js\";\nimport type {\n PlayOptions,\n CallMediaRecognizeDtmfOptions,\n CallMediaRecognizeChoiceOptions,\n ContinuousDtmfRecognitionOptions,\n SendDtmfTonesOptions,\n CallMediaRecognizeSpeechOptions,\n CallMediaRecognizeSpeechOrDtmfOptions,\n StartTranscriptionOptions,\n StopTranscriptionOptions,\n HoldOptions,\n UnholdOptions,\n StartMediaStreamingOptions,\n StopMediaStreamingOptions,\n PlayToAllOptions,\n UpdateTranscriptionOptions,\n InterruptAudioAndAnnounceOptions,\n} from \"./models/options.js\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport type {\n CancelAllMediaOperationsResult,\n PlayResult,\n SendDtmfTonesResult,\n StartRecognizingResult,\n} from \"./models/responses.js\";\nimport type {\n CancelAllMediaOperationsEventResult,\n PlayEventResult,\n SendDtmfEventResult,\n StartRecognizingEventResult,\n} from \"./eventprocessor/eventResponses.js\";\nimport type { CallAutomationEventProcessor } from \"./eventprocessor/callAutomationEventProcessor.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { createCustomCallAutomationApiClient } from \"./credential/callAutomationAuthPolicy.js\";\nimport { InterruptAudioAndAnnounceRequest } from \"./generated/src/models/index.js\";\n\n/**\n * CallMedia class represents call media related APIs.\n */\nexport class CallMedia {\n private readonly callConnectionId: string;\n private readonly callMedia: CallMediaImpl;\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly callAutomationEventProcessor: CallAutomationEventProcessor;\n constructor(\n callConnectionId: string,\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n eventProcessor: CallAutomationEventProcessor,\n options?: CallAutomationApiClientOptionalParams,\n ) {\n this.callAutomationApiClient = createCustomCallAutomationApiClient(\n credential,\n options,\n endpoint,\n );\n this.callConnectionId = callConnectionId;\n this.callAutomationEventProcessor = eventProcessor;\n this.callMedia = new CallMediaImpl(this.callAutomationApiClient);\n }\n\n private createPlaySourceInternal(\n playSource: FileSource | TextSource | SsmlSource,\n ): PlaySourceInternal {\n if (playSource.kind === \"fileSource\") {\n const fileSource: FileSourceInternal = {\n uri: playSource.url,\n };\n return {\n kind: KnownPlaySourceType.File,\n file: fileSource,\n playSourceCacheId: playSource.playSourceCacheId\n ? playSource.playSourceCacheId\n : playSource.playsourcacheid,\n };\n } else if (playSource.kind === \"textSource\") {\n const textSource: TextSourceInternal = {\n text: playSource.text,\n sourceLocale: playSource.sourceLocale,\n voiceKind: playSource.voiceKind,\n voiceName: playSource.voiceName,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Text,\n text: textSource,\n playSourceCacheId: playSource.playSourceCacheId\n ? playSource.playSourceCacheId\n : playSource.playsourcacheid,\n };\n } else if (playSource.kind === \"ssmlSource\") {\n const ssmlSource: SsmlSourceInternal = {\n ssmlText: playSource.ssmlText,\n customVoiceEndpointId: playSource.customVoiceEndpointId,\n };\n return {\n kind: KnownPlaySourceType.Ssml,\n ssml: ssmlSource,\n playSourceCacheId: playSource.playSourceCacheId\n ? playSource.playSourceCacheId\n : playSource.playsourcacheid,\n };\n }\n throw new Error(\"Invalid play source\");\n }\n\n /**\n * Play audio to a specific participant.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param playTo - The targets to play to.\n * @param options - Additional attributes for play.\n */\n public async play(\n playSources: (FileSource | TextSource | SsmlSource)[],\n playTo: CommunicationIdentifier[],\n options: PlayOptions = { loop: false },\n ): Promise<PlayResult> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: playTo.map((identifier) => serializeCommunicationIdentifier(identifier)),\n playOptions: {\n loop: false,\n interruptHoldAudio: false,\n },\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n if (options.interruptHoldAudio !== undefined) {\n playRequest.playOptions = playRequest.playOptions || {\n loop: false,\n interruptHoldAudio: false,\n }; // Ensure playOptions is defined\n playRequest.playOptions.interruptHoldAudio = options.interruptHoldAudio;\n }\n await this.callMedia.play(this.callConnectionId, playRequest, options);\n\n const playResult: PlayResult = {\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const playEventResult: PlayEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"PlayCompleted\" &&\n event.operationContext === playRequest.operationContext\n ) {\n playEventResult.isSuccess = true;\n playEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"PlayFailed\" &&\n event.operationContext === playRequest.operationContext\n ) {\n playEventResult.isSuccess = false;\n playEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return playEventResult;\n },\n };\n return playResult;\n }\n\n /**\n * Play to all participants.\n *\n * @param playSources - A PlaySource representing the sources to play. Currently only single play source per request is supported.\n * @param options - Additional attributes for play.\n */\n public async playToAll(\n playSources: (FileSource | TextSource | SsmlSource)[],\n options: PlayToAllOptions = { loop: false },\n ): Promise<PlayResult> {\n const playRequest: PlayRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: [],\n playOptions: {\n loop: false,\n },\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n\n if (options.loop !== undefined) {\n playRequest.playOptions = playRequest.playOptions || { loop: false }; // Ensure playOptions is defined\n playRequest.playOptions.loop = options.loop;\n }\n\n if (options.interruptCallMediaOperation !== undefined) {\n playRequest.playOptions = playRequest.playOptions || {\n loop: false,\n interruptCallMediaOperation: false,\n }; // Ensure playOptions is defined\n playRequest.playOptions.interruptCallMediaOperation = options.interruptCallMediaOperation;\n }\n\n await this.callMedia.play(this.callConnectionId, playRequest, options);\n\n const playResult: PlayResult = {\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const playEventResult: PlayEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"PlayCompleted\" &&\n event.operationContext === playRequest.operationContext\n ) {\n playEventResult.isSuccess = true;\n playEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"PlayFailed\" &&\n event.operationContext === playRequest.operationContext\n ) {\n playEventResult.isSuccess = false;\n playEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return playEventResult;\n },\n };\n return playResult;\n }\n\n private createRecognizeRequest(\n targetParticipant: CommunicationIdentifier,\n recognizeOptions:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): RecognizeRequest {\n if (recognizeOptions.kind === \"callMediaRecognizeDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n dtmfOptions: dtmfOptionsInternal,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Dtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeChoiceOptions\") {\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n choices: recognizeOptions.choices,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Choices,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOptions\") {\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n speechLanguage: recognizeOptions.speechLanguage,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.Speech,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n } else if (recognizeOptions.kind === \"callMediaRecognizeSpeechOrDtmfOptions\") {\n const dtmfOptionsInternal: DtmfOptions = {\n interToneTimeoutInSeconds: recognizeOptions.interToneTimeoutInSeconds\n ? recognizeOptions.interToneTimeoutInSeconds\n : 2,\n maxTonesToCollect: recognizeOptions.maxTonesToCollect,\n stopTones: recognizeOptions.stopDtmfTones,\n };\n const speechOptions: SpeechOptions = {\n endSilenceTimeoutInMs: recognizeOptions.endSilenceTimeoutInSeconds\n ? recognizeOptions.endSilenceTimeoutInSeconds * 1000\n : 2000,\n };\n const recognizeOptionsInternal: RecognizeOptions = {\n interruptPrompt: recognizeOptions.interruptPrompt,\n initialSilenceTimeoutInSeconds: recognizeOptions.initialSilenceTimeoutInSeconds\n ? recognizeOptions.initialSilenceTimeoutInSeconds\n : 5,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n speechOptions: speechOptions,\n dtmfOptions: dtmfOptionsInternal,\n speechRecognitionModelEndpointId: recognizeOptions.speechRecognitionModelEndpointId,\n };\n return {\n recognizeInputType: KnownRecognizeInputType.SpeechOrDtmf,\n playPrompt: recognizeOptions.playPrompt\n ? this.createPlaySourceInternal(recognizeOptions.playPrompt)\n : undefined,\n playPrompts:\n recognizeOptions.playPrompts !== undefined\n ? recognizeOptions.playPrompts.map((source) => this.createPlaySourceInternal(source))\n : undefined,\n interruptCallMediaOperation: recognizeOptions.interruptCallMediaOperation,\n recognizeOptions: recognizeOptionsInternal,\n operationContext: recognizeOptions.operationContext,\n operationCallbackUri: recognizeOptions.operationCallbackUrl,\n };\n }\n throw new Error(\"Invalid recognizeOptions\");\n }\n\n /**\n * Recognize participant input.\n * @deprecated This method signature is deprecated. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\n * @param targetParticipant - Target participant.\n * @param maxTonesToCollect - Maximum number of DTMF tones to be collected.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesToCollect: number,\n options: CallMediaRecognizeDtmfOptions,\n ): Promise<StartRecognizingResult>;\n\n /**\n * Recognize participant input.\n * @param targetParticipant - Target participant.\n * @param options - Different attributes for recognize.\n * */\n public async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n options:\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n ): Promise<StartRecognizingResult>;\n async startRecognizing(\n targetParticipant: CommunicationIdentifier,\n maxTonesOrOptions:\n | number\n | CallMediaRecognizeDtmfOptions\n | CallMediaRecognizeChoiceOptions\n | CallMediaRecognizeSpeechOptions\n | CallMediaRecognizeSpeechOrDtmfOptions,\n options?: CallMediaRecognizeDtmfOptions,\n ): Promise<StartRecognizingResult> {\n if (typeof maxTonesOrOptions === \"number\" && options) {\n // Old function signature logic\n console.warn(\n \"Deprecated function signature used. Please use the new signature with targetParticipant and options params instead, and set maxTonesToCollect in options.\",\n );\n options.maxTonesToCollect = maxTonesOrOptions;\n await this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, options),\n {},\n );\n } else if (typeof maxTonesOrOptions !== \"number\" && !options) {\n maxTonesOrOptions.operationContext = maxTonesOrOptions.operationContext\n ? maxTonesOrOptions.operationContext\n : randomUUID();\n // New function signature logic\n await this.callMedia.recognize(\n this.callConnectionId,\n this.createRecognizeRequest(targetParticipant, maxTonesOrOptions),\n {},\n );\n const startRecognizingResult: StartRecognizingResult = {\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const startRecognizingEventResult: StartRecognizingEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"RecognizeCompleted\" &&\n event.operationContext === maxTonesOrOptions.operationContext\n ) {\n startRecognizingEventResult.isSuccess = true;\n startRecognizingEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"RecognizeFailed\" &&\n event.operationContext === maxTonesOrOptions.operationContext\n ) {\n startRecognizingEventResult.isSuccess = false;\n startRecognizingEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return startRecognizingEventResult;\n },\n };\n return startRecognizingResult;\n }\n throw new Error(\"Invalid params\");\n }\n\n /**\n * Cancels all the queued media operations.\n */\n public async cancelAllOperations(): Promise<CancelAllMediaOperationsResult> {\n await this.callMedia.cancelAllMediaOperations(this.callConnectionId, {});\n\n const cancelAllMediaOperationsResult: CancelAllMediaOperationsResult = {\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const cancelAllMediaOperationsEventResult: CancelAllMediaOperationsEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === this.callConnectionId && event.kind === \"PlayCanceled\") {\n cancelAllMediaOperationsEventResult.isSuccess = true;\n cancelAllMediaOperationsEventResult.playCanceledSuccessResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"RecognizeCanceled\"\n ) {\n cancelAllMediaOperationsEventResult.isSuccess = false;\n cancelAllMediaOperationsEventResult.recognizeCanceledSuccessResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return cancelAllMediaOperationsEventResult;\n },\n };\n return cancelAllMediaOperationsResult;\n }\n\n /**\n * Start continuous Dtmf recognition by subscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async startContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n };\n return this.callMedia.startContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Stop continuous Dtmf recognition by unsubscribing to tones.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for continuous Dtmf recognition.\n * */\n public async stopContinuousDtmfRecognition(\n targetParticipant: CommunicationIdentifier,\n options: ContinuousDtmfRecognitionOptions = {},\n ): Promise<void> {\n const continuousDtmfRecognitionRequest: ContinuousDtmfRecognitionRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.stopContinuousDtmfRecognition(\n this.callConnectionId,\n continuousDtmfRecognitionRequest,\n {},\n );\n }\n\n /**\n * Send Dtmf tones.\n * @param tones - List of tones to be sent to target participant.\n * @param targetParticipant - Target participant.\n * @param options - Additional attributes for send Dtmf tones.\n * */\n public async sendDtmfTones(\n tones: Tone[] | DtmfTone[],\n targetParticipant: CommunicationIdentifier,\n options: SendDtmfTonesOptions = {},\n ): Promise<SendDtmfTonesResult> {\n const sendDtmfTonesRequest: SendDtmfTonesRequest = {\n tones: tones,\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext: options.operationContext ? options.operationContext : randomUUID(),\n operationCallbackUri: options.operationCallbackUrl,\n };\n await this.callMedia.sendDtmfTones(this.callConnectionId, sendDtmfTonesRequest, {});\n\n const sendDtmfTonesResult: SendDtmfTonesResult = {\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const sendDtmfEventResult: SendDtmfEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"SendDtmfTonesCompleted\" &&\n event.operationContext === sendDtmfTonesResult.operationContext\n ) {\n sendDtmfEventResult.isSuccess = true;\n sendDtmfEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === this.callConnectionId &&\n event.kind === \"SendDtmfTonesFailed\" &&\n event.operationContext === sendDtmfTonesResult.operationContext\n ) {\n sendDtmfEventResult.isSuccess = false;\n sendDtmfEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return sendDtmfEventResult;\n },\n };\n return sendDtmfTonesResult;\n }\n\n /**\n * Put participant on hold while playing audio.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for hold participant.\n */\n public async hold(\n targetParticipant: CommunicationIdentifier,\n options: HoldOptions = {},\n ): Promise<void> {\n const holdRequest: HoldRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n playSourceInfo:\n options.playSource !== undefined\n ? this.createPlaySourceInternal(options.playSource)\n : undefined,\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n operationCallbackUri:\n options.operationCallbackUri !== undefined ? options.operationCallbackUri : undefined,\n };\n return this.callMedia.hold(this.callConnectionId, holdRequest);\n }\n\n /**\n * Remove participant from hold.\n *\n * @param targetParticipant - The targets to play to.\n * @param options - Additional attributes for unhold participant.\n */\n public async unhold(\n targetParticipant: CommunicationIdentifier,\n options: UnholdOptions = {},\n ): Promise<void> {\n const unholdRequest: UnholdRequest = {\n targetParticipant: serializeCommunicationIdentifier(targetParticipant),\n operationContext:\n options.operationContext !== undefined ? options.operationContext : undefined,\n };\n return this.callMedia.unhold(this.callConnectionId, unholdRequest);\n }\n\n /**\n * Starts transcription in the call\n * @param options - Additional attributes for start transcription.\n */\n public async startTranscription(options: StartTranscriptionOptions = {}): Promise<void> {\n const startTranscriptionRequest: StartTranscriptionRequest = {\n locale: options.locale,\n operationContext: options.operationContext,\n speechModelEndpointId: options.speechRecognitionModelEndpointId,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.startTranscription(this.callConnectionId, startTranscriptionRequest, {});\n }\n\n /**\n * Stops transcription in the call.\n * @param options - Additional attributes for stop transcription.\n */\n public async stopTranscription(options: StopTranscriptionOptions = {}): Promise<void> {\n const stopTranscriptionRequest: StopTranscriptionRequest = {\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.stopTranscription(this.callConnectionId, stopTranscriptionRequest, {});\n }\n\n /**\n * Update transcription language.\n * @param locale - Defines new locale for transcription.\n */\n public async updateTranscription(\n locale: string,\n options?: UpdateTranscriptionOptions,\n ): Promise<void> {\n const updateTranscriptionRequest: UpdateTranscriptionRequest = {\n locale: locale,\n speechModelEndpointId: options?.speechRecognitionModelEndpointId,\n operationContext: options?.operationContext,\n operationCallbackUri: options?.operationCallbackUrl,\n };\n return this.callMedia.updateTranscription(\n this.callConnectionId,\n updateTranscriptionRequest,\n {},\n );\n }\n /**\n * Starts media streaming in the call.\n * @param options - Additional attributes for start media streaming.\n */\n public async startMediaStreaming(options: StartMediaStreamingOptions = {}): Promise<void> {\n const startMediaStreamingRequest: StartMediaStreamingRequest = {\n operationContext: options.operationContext,\n operationCallbackUri: options.operationCallbackUrl,\n };\n return this.callMedia.startMediaStreaming(\n this.callConnectionId,\n startMediaStreamingRequest,\n options,\n );\n }\n\n /**\n * Stops media streaming in the call.\n * @param options - Additional attributes for stop media streaming.\n */\n public async stopMediaStreaming(options: StopMediaStreamingOptions = {}): Promise<void> {\n const stopMediaStreamingRequest: StopMediaStreamingRequest = {\n operationCallbackUri: options.operationCallbackUrl,\n operationContext: options.operationContext,\n };\n return this.callMedia.stopMediaStreaming(\n this.callConnectionId,\n stopMediaStreamingRequest,\n options,\n );\n }\n\n /**\n * Interrupt audio and announce to specific participant.\n *\n * @param playSources - A PlaySource representing the sources to play.\n * @param playTo - The targets to play to.\n * @param options - Additional attributes for interrupt audio and announce.\n */\n public async interruptAudioAndAnnounce(\n playSources: (FileSource | TextSource | SsmlSource)[],\n playTo: CommunicationIdentifier,\n options: InterruptAudioAndAnnounceOptions = {},\n ): Promise<void> {\n const interruptAudioAndAnnounceRequest: InterruptAudioAndAnnounceRequest = {\n playSources: playSources.map((source) => this.createPlaySourceInternal(source)),\n playTo: serializeCommunicationIdentifier(playTo),\n operationContext: options.operationContext,\n };\n return this.callMedia.interruptAudioAndAnnounce(\n this.callConnectionId,\n interruptAudioAndAnnounceRequest,\n );\n }\n}\n"]}