@azure/communication-call-automation 1.6.0-alpha.20250711.2 → 1.6.0-beta.1
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.
- package/README.md +0 -48
- package/dist/browser/callAutomationClient.d.ts +0 -8
- package/dist/browser/callAutomationClient.d.ts.map +1 -1
- package/dist/browser/callAutomationClient.js +87 -141
- package/dist/browser/callAutomationClient.js.map +1 -1
- package/dist/browser/callAutomationEventParser.d.ts.map +1 -1
- package/dist/browser/callAutomationEventParser.js +22 -54
- package/dist/browser/callAutomationEventParser.js.map +1 -1
- package/dist/browser/callConnection.d.ts +12 -14
- package/dist/browser/callConnection.d.ts.map +1 -1
- package/dist/browser/callConnection.js +111 -183
- package/dist/browser/callConnection.js.map +1 -1
- package/dist/browser/callMedia.d.ts +15 -20
- package/dist/browser/callMedia.d.ts.map +1 -1
- package/dist/browser/callMedia.js +58 -177
- package/dist/browser/callMedia.js.map +1 -1
- package/dist/browser/callRecording.d.ts +2 -8
- package/dist/browser/callRecording.d.ts.map +1 -1
- package/dist/browser/callRecording.js +16 -26
- package/dist/browser/callRecording.js.map +1 -1
- package/dist/browser/contentDownloader.js +11 -12
- package/dist/browser/contentDownloader.js.map +1 -1
- package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
- package/dist/browser/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/browser/credential/callAutomationAuthPolicy.js +1 -1
- package/dist/browser/credential/callAutomationAuthPolicy.js.map +1 -1
- package/dist/browser/credential/cryptoUtils-browser.mjs.map +1 -1
- package/dist/browser/credential/cryptoUtils.js +1 -2
- package/dist/browser/generated/src/callAutomationApiClient.d.ts +1 -2
- package/dist/browser/generated/src/callAutomationApiClient.d.ts.map +1 -1
- package/dist/browser/generated/src/callAutomationApiClient.js +14 -6
- package/dist/browser/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/browser/generated/src/models/index.d.ts +534 -1064
- package/dist/browser/generated/src/models/index.d.ts.map +1 -1
- package/dist/browser/generated/src/models/index.js +87 -159
- package/dist/browser/generated/src/models/index.js.map +1 -1
- package/dist/browser/generated/src/models/mappers.d.ts +58 -86
- package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/browser/generated/src/models/mappers.js +1173 -2159
- package/dist/browser/generated/src/models/mappers.js.map +1 -1
- package/dist/browser/generated/src/models/parameters.d.ts +2 -7
- package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/browser/generated/src/models/parameters.js +10 -41
- package/dist/browser/generated/src/models/parameters.js.map +1 -1
- package/dist/browser/generated/src/operations/callConnection.d.ts +2 -9
- package/dist/browser/generated/src/operations/callConnection.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/callConnection.js +24 -73
- package/dist/browser/generated/src/operations/callConnection.js.map +1 -1
- package/dist/browser/generated/src/operations/callMedia.d.ts +15 -15
- package/dist/browser/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/callMedia.js +51 -50
- package/dist/browser/generated/src/operations/callMedia.js.map +1 -1
- package/dist/browser/generated/src/operations/callRecording.d.ts +1 -7
- package/dist/browser/generated/src/operations/callRecording.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/callRecording.js +1 -24
- package/dist/browser/generated/src/operations/callRecording.js.map +1 -1
- package/dist/browser/generated/src/operations/index.d.ts +0 -1
- package/dist/browser/generated/src/operations/index.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/index.js +0 -1
- package/dist/browser/generated/src/operations/index.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
- package/dist/browser/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callConnection.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
- package/dist/browser/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callMedia.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
- package/dist/browser/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/callRecording.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/index.d.ts +0 -1
- package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/index.js +0 -1
- package/dist/browser/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/browser/generated/src/pagingHelper.js +2 -4
- package/dist/browser/generated/src/pagingHelper.js.map +1 -1
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +0 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/models/constants.js +1 -1
- package/dist/browser/models/constants.js.map +1 -1
- package/dist/browser/models/events.d.ts +136 -195
- package/dist/browser/models/events.d.ts.map +1 -1
- package/dist/browser/models/events.js.map +1 -1
- package/dist/browser/models/models.d.ts +76 -39
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +1 -3
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/models/options.d.ts +64 -30
- package/dist/browser/models/options.d.ts.map +1 -1
- package/dist/browser/models/options.js.map +1 -1
- package/dist/browser/models/responses.d.ts +19 -82
- package/dist/browser/models/responses.d.ts.map +1 -1
- package/dist/browser/models/responses.js.map +1 -1
- package/dist/browser/models/streaming.d.ts +38 -28
- package/dist/browser/models/streaming.d.ts.map +1 -1
- package/dist/browser/models/streaming.js +28 -57
- package/dist/browser/models/streaming.js.map +1 -1
- package/dist/browser/streamingData.d.ts.map +1 -1
- package/dist/browser/streamingData.js +15 -1
- package/dist/browser/streamingData.js.map +1 -1
- package/dist/browser/utli/converters.d.ts +1 -1
- package/dist/browser/utli/converters.d.ts.map +1 -1
- package/dist/browser/utli/converters.js +48 -9
- package/dist/browser/utli/converters.js.map +1 -1
- package/dist/commonjs/callAutomationClient.d.ts +0 -8
- package/dist/commonjs/callAutomationClient.d.ts.map +1 -1
- package/dist/commonjs/callAutomationClient.js +85 -139
- package/dist/commonjs/callAutomationClient.js.map +1 -1
- package/dist/commonjs/callAutomationEventParser.d.ts.map +1 -1
- package/dist/commonjs/callAutomationEventParser.js +21 -53
- package/dist/commonjs/callAutomationEventParser.js.map +1 -1
- package/dist/commonjs/callConnection.d.ts +12 -14
- package/dist/commonjs/callConnection.d.ts.map +1 -1
- package/dist/commonjs/callConnection.js +113 -185
- package/dist/commonjs/callConnection.js.map +1 -1
- package/dist/commonjs/callMedia.d.ts +15 -20
- package/dist/commonjs/callMedia.d.ts.map +1 -1
- package/dist/commonjs/callMedia.js +66 -185
- package/dist/commonjs/callMedia.js.map +1 -1
- package/dist/commonjs/callRecording.d.ts +2 -8
- package/dist/commonjs/callRecording.d.ts.map +1 -1
- package/dist/commonjs/callRecording.js +17 -27
- package/dist/commonjs/callRecording.js.map +1 -1
- package/dist/commonjs/contentDownloader.js +11 -12
- package/dist/commonjs/contentDownloader.js.map +1 -1
- package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
- package/dist/commonjs/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/commonjs/credential/callAutomationAuthPolicy.js +1 -1
- package/dist/commonjs/credential/callAutomationAuthPolicy.js.map +1 -1
- package/dist/commonjs/generated/src/callAutomationApiClient.d.ts +1 -2
- package/dist/commonjs/generated/src/callAutomationApiClient.d.ts.map +1 -1
- package/dist/commonjs/generated/src/callAutomationApiClient.js +13 -5
- package/dist/commonjs/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/commonjs/generated/src/models/index.d.ts +534 -1064
- package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/index.js +88 -160
- package/dist/commonjs/generated/src/models/index.js.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.d.ts +58 -86
- package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.js +1176 -2162
- package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.d.ts +2 -7
- package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.js +10 -41
- package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
- package/dist/commonjs/generated/src/operations/callConnection.d.ts +2 -9
- package/dist/commonjs/generated/src/operations/callConnection.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/callConnection.js +24 -72
- package/dist/commonjs/generated/src/operations/callConnection.js.map +1 -1
- package/dist/commonjs/generated/src/operations/callMedia.d.ts +15 -15
- package/dist/commonjs/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/callMedia.js +51 -50
- package/dist/commonjs/generated/src/operations/callMedia.js.map +1 -1
- package/dist/commonjs/generated/src/operations/callRecording.d.ts +1 -7
- package/dist/commonjs/generated/src/operations/callRecording.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/callRecording.js +1 -24
- package/dist/commonjs/generated/src/operations/callRecording.js.map +1 -1
- package/dist/commonjs/generated/src/operations/index.d.ts +0 -1
- package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/index.js +0 -1
- package/dist/commonjs/generated/src/operations/index.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callConnection.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callMedia.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callRecording.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +0 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.js +0 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/commonjs/generated/src/pagingHelper.js +2 -4
- package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
- package/dist/commonjs/index.d.ts +0 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/models/constants.js +1 -1
- package/dist/commonjs/models/constants.js.map +1 -1
- package/dist/commonjs/models/events.d.ts +136 -195
- package/dist/commonjs/models/events.d.ts.map +1 -1
- package/dist/commonjs/models/events.js.map +1 -1
- package/dist/commonjs/models/models.d.ts +76 -39
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +2 -21
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/models/options.d.ts +64 -30
- package/dist/commonjs/models/options.d.ts.map +1 -1
- package/dist/commonjs/models/options.js.map +1 -1
- package/dist/commonjs/models/responses.d.ts +19 -82
- package/dist/commonjs/models/responses.d.ts.map +1 -1
- package/dist/commonjs/models/responses.js.map +1 -1
- package/dist/commonjs/models/streaming.d.ts +38 -28
- package/dist/commonjs/models/streaming.d.ts.map +1 -1
- package/dist/commonjs/models/streaming.js +31 -59
- package/dist/commonjs/models/streaming.js.map +1 -1
- package/dist/commonjs/streamingData.d.ts.map +1 -1
- package/dist/commonjs/streamingData.js +15 -1
- package/dist/commonjs/streamingData.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utli/converters.d.ts +1 -1
- package/dist/commonjs/utli/converters.d.ts.map +1 -1
- package/dist/commonjs/utli/converters.js +47 -8
- package/dist/commonjs/utli/converters.js.map +1 -1
- package/dist/esm/callAutomationClient.d.ts +0 -8
- package/dist/esm/callAutomationClient.d.ts.map +1 -1
- package/dist/esm/callAutomationClient.js +87 -141
- package/dist/esm/callAutomationClient.js.map +1 -1
- package/dist/esm/callAutomationEventParser.d.ts.map +1 -1
- package/dist/esm/callAutomationEventParser.js +22 -54
- package/dist/esm/callAutomationEventParser.js.map +1 -1
- package/dist/esm/callConnection.d.ts +12 -14
- package/dist/esm/callConnection.d.ts.map +1 -1
- package/dist/esm/callConnection.js +111 -183
- package/dist/esm/callConnection.js.map +1 -1
- package/dist/esm/callMedia.d.ts +15 -20
- package/dist/esm/callMedia.d.ts.map +1 -1
- package/dist/esm/callMedia.js +58 -177
- package/dist/esm/callMedia.js.map +1 -1
- package/dist/esm/callRecording.d.ts +2 -8
- package/dist/esm/callRecording.d.ts.map +1 -1
- package/dist/esm/callRecording.js +16 -26
- package/dist/esm/callRecording.js.map +1 -1
- package/dist/esm/contentDownloader.js +11 -12
- package/dist/esm/contentDownloader.js.map +1 -1
- package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
- package/dist/esm/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/esm/credential/callAutomationAuthPolicy.js +1 -1
- package/dist/esm/credential/callAutomationAuthPolicy.js.map +1 -1
- package/dist/esm/generated/src/callAutomationApiClient.d.ts +1 -2
- package/dist/esm/generated/src/callAutomationApiClient.d.ts.map +1 -1
- package/dist/esm/generated/src/callAutomationApiClient.js +14 -6
- package/dist/esm/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/esm/generated/src/models/index.d.ts +534 -1064
- package/dist/esm/generated/src/models/index.d.ts.map +1 -1
- package/dist/esm/generated/src/models/index.js +87 -159
- package/dist/esm/generated/src/models/index.js.map +1 -1
- package/dist/esm/generated/src/models/mappers.d.ts +58 -86
- package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/esm/generated/src/models/mappers.js +1173 -2159
- package/dist/esm/generated/src/models/mappers.js.map +1 -1
- package/dist/esm/generated/src/models/parameters.d.ts +2 -7
- package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/esm/generated/src/models/parameters.js +10 -41
- package/dist/esm/generated/src/models/parameters.js.map +1 -1
- package/dist/esm/generated/src/operations/callConnection.d.ts +2 -9
- package/dist/esm/generated/src/operations/callConnection.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/callConnection.js +24 -73
- package/dist/esm/generated/src/operations/callConnection.js.map +1 -1
- package/dist/esm/generated/src/operations/callMedia.d.ts +15 -15
- package/dist/esm/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/callMedia.js +51 -50
- package/dist/esm/generated/src/operations/callMedia.js.map +1 -1
- package/dist/esm/generated/src/operations/callRecording.d.ts +1 -7
- package/dist/esm/generated/src/operations/callRecording.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/callRecording.js +1 -24
- package/dist/esm/generated/src/operations/callRecording.js.map +1 -1
- package/dist/esm/generated/src/operations/index.d.ts +0 -1
- package/dist/esm/generated/src/operations/index.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/index.js +0 -1
- package/dist/esm/generated/src/operations/index.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
- package/dist/esm/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callConnection.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
- package/dist/esm/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callMedia.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
- package/dist/esm/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/callRecording.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/index.d.ts +0 -1
- package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/index.js +0 -1
- package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/esm/generated/src/pagingHelper.js +2 -4
- package/dist/esm/generated/src/pagingHelper.js.map +1 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/constants.js +1 -1
- package/dist/esm/models/constants.js.map +1 -1
- package/dist/esm/models/events.d.ts +136 -195
- package/dist/esm/models/events.d.ts.map +1 -1
- package/dist/esm/models/events.js.map +1 -1
- package/dist/esm/models/models.d.ts +76 -39
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +1 -3
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/models/options.d.ts +64 -30
- package/dist/esm/models/options.d.ts.map +1 -1
- package/dist/esm/models/options.js.map +1 -1
- package/dist/esm/models/responses.d.ts +19 -82
- package/dist/esm/models/responses.d.ts.map +1 -1
- package/dist/esm/models/responses.js.map +1 -1
- package/dist/esm/models/streaming.d.ts +38 -28
- package/dist/esm/models/streaming.d.ts.map +1 -1
- package/dist/esm/models/streaming.js +28 -57
- package/dist/esm/models/streaming.js.map +1 -1
- package/dist/esm/streamingData.d.ts.map +1 -1
- package/dist/esm/streamingData.js +15 -1
- package/dist/esm/streamingData.js.map +1 -1
- package/dist/esm/utli/converters.d.ts +1 -1
- package/dist/esm/utli/converters.d.ts.map +1 -1
- package/dist/esm/utli/converters.js +48 -9
- package/dist/esm/utli/converters.js.map +1 -1
- package/dist/react-native/callAutomationClient.d.ts +0 -8
- package/dist/react-native/callAutomationClient.d.ts.map +1 -1
- package/dist/react-native/callAutomationClient.js +87 -141
- package/dist/react-native/callAutomationClient.js.map +1 -1
- package/dist/react-native/callAutomationEventParser.d.ts.map +1 -1
- package/dist/react-native/callAutomationEventParser.js +22 -54
- package/dist/react-native/callAutomationEventParser.js.map +1 -1
- package/dist/react-native/callConnection.d.ts +12 -14
- package/dist/react-native/callConnection.d.ts.map +1 -1
- package/dist/react-native/callConnection.js +111 -183
- package/dist/react-native/callConnection.js.map +1 -1
- package/dist/react-native/callMedia.d.ts +15 -20
- package/dist/react-native/callMedia.d.ts.map +1 -1
- package/dist/react-native/callMedia.js +58 -177
- package/dist/react-native/callMedia.js.map +1 -1
- package/dist/react-native/callRecording.d.ts +2 -8
- package/dist/react-native/callRecording.d.ts.map +1 -1
- package/dist/react-native/callRecording.js +16 -26
- package/dist/react-native/callRecording.js.map +1 -1
- package/dist/react-native/contentDownloader.js +11 -12
- package/dist/react-native/contentDownloader.js.map +1 -1
- package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js +1 -2
- package/dist/react-native/credential/callAutomationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/react-native/credential/callAutomationAuthPolicy.js +1 -1
- package/dist/react-native/credential/callAutomationAuthPolicy.js.map +1 -1
- package/dist/react-native/generated/src/callAutomationApiClient.d.ts +1 -2
- package/dist/react-native/generated/src/callAutomationApiClient.d.ts.map +1 -1
- package/dist/react-native/generated/src/callAutomationApiClient.js +14 -6
- package/dist/react-native/generated/src/callAutomationApiClient.js.map +1 -1
- package/dist/react-native/generated/src/models/index.d.ts +534 -1064
- package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/index.js +87 -159
- package/dist/react-native/generated/src/models/index.js.map +1 -1
- package/dist/react-native/generated/src/models/mappers.d.ts +58 -86
- package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/mappers.js +1173 -2159
- package/dist/react-native/generated/src/models/mappers.js.map +1 -1
- package/dist/react-native/generated/src/models/parameters.d.ts +2 -7
- package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/parameters.js +10 -41
- package/dist/react-native/generated/src/models/parameters.js.map +1 -1
- package/dist/react-native/generated/src/operations/callConnection.d.ts +2 -9
- package/dist/react-native/generated/src/operations/callConnection.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/callConnection.js +24 -73
- package/dist/react-native/generated/src/operations/callConnection.js.map +1 -1
- package/dist/react-native/generated/src/operations/callMedia.d.ts +15 -15
- package/dist/react-native/generated/src/operations/callMedia.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/callMedia.js +51 -50
- package/dist/react-native/generated/src/operations/callMedia.js.map +1 -1
- package/dist/react-native/generated/src/operations/callRecording.d.ts +1 -7
- package/dist/react-native/generated/src/operations/callRecording.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/callRecording.js +1 -24
- package/dist/react-native/generated/src/operations/callRecording.js.map +1 -1
- package/dist/react-native/generated/src/operations/index.d.ts +0 -1
- package/dist/react-native/generated/src/operations/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/index.js +0 -1
- package/dist/react-native/generated/src/operations/index.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts +2 -9
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callConnection.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts +15 -15
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callMedia.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts +1 -7
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/callRecording.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +0 -1
- package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/index.js +0 -1
- package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/react-native/generated/src/pagingHelper.js +2 -4
- package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
- package/dist/react-native/index.d.ts +0 -2
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +0 -2
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/models/constants.js +1 -1
- package/dist/react-native/models/constants.js.map +1 -1
- package/dist/react-native/models/events.d.ts +136 -195
- package/dist/react-native/models/events.d.ts.map +1 -1
- package/dist/react-native/models/events.js.map +1 -1
- package/dist/react-native/models/models.d.ts +76 -39
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +1 -3
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/models/options.d.ts +64 -30
- package/dist/react-native/models/options.d.ts.map +1 -1
- package/dist/react-native/models/options.js.map +1 -1
- package/dist/react-native/models/responses.d.ts +19 -82
- package/dist/react-native/models/responses.d.ts.map +1 -1
- package/dist/react-native/models/responses.js.map +1 -1
- package/dist/react-native/models/streaming.d.ts +38 -28
- package/dist/react-native/models/streaming.d.ts.map +1 -1
- package/dist/react-native/models/streaming.js +28 -57
- package/dist/react-native/models/streaming.js.map +1 -1
- package/dist/react-native/streamingData.d.ts.map +1 -1
- package/dist/react-native/streamingData.js +15 -1
- package/dist/react-native/streamingData.js.map +1 -1
- package/dist/react-native/utli/converters.d.ts +1 -1
- package/dist/react-native/utli/converters.d.ts.map +1 -1
- package/dist/react-native/utli/converters.js +48 -9
- package/dist/react-native/utli/converters.js.map +1 -1
- package/package.json +35 -36
- package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
- package/dist/browser/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
- package/dist/browser/eventprocessor/callAutomationEventProcessor.js +0 -137
- package/dist/browser/eventprocessor/callAutomationEventProcessor.js.map +0 -1
- package/dist/browser/eventprocessor/eventResponses.d.ts +0 -134
- package/dist/browser/eventprocessor/eventResponses.d.ts.map +0 -1
- package/dist/browser/eventprocessor/eventResponses.js +0 -4
- package/dist/browser/eventprocessor/eventResponses.js.map +0 -1
- package/dist/browser/generated/src/operations/callDialog.d.ts +0 -35
- package/dist/browser/generated/src/operations/callDialog.d.ts.map +0 -1
- package/dist/browser/generated/src/operations/callDialog.js +0 -111
- package/dist/browser/generated/src/operations/callDialog.js.map +0 -1
- package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
- package/dist/browser/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
- package/dist/browser/generated/src/operationsInterfaces/callDialog.js +0 -9
- package/dist/browser/generated/src/operationsInterfaces/callDialog.js.map +0 -1
- package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
- package/dist/commonjs/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
- package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js +0 -141
- package/dist/commonjs/eventprocessor/callAutomationEventProcessor.js.map +0 -1
- package/dist/commonjs/eventprocessor/eventResponses.d.ts +0 -134
- package/dist/commonjs/eventprocessor/eventResponses.d.ts.map +0 -1
- package/dist/commonjs/eventprocessor/eventResponses.js +0 -5
- package/dist/commonjs/eventprocessor/eventResponses.js.map +0 -1
- package/dist/commonjs/generated/src/operations/callDialog.d.ts +0 -35
- package/dist/commonjs/generated/src/operations/callDialog.d.ts.map +0 -1
- package/dist/commonjs/generated/src/operations/callDialog.js +0 -116
- package/dist/commonjs/generated/src/operations/callDialog.js.map +0 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
- package/dist/commonjs/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
- package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js +0 -10
- package/dist/commonjs/generated/src/operationsInterfaces/callDialog.js.map +0 -1
- package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
- package/dist/esm/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
- package/dist/esm/eventprocessor/callAutomationEventProcessor.js +0 -137
- package/dist/esm/eventprocessor/callAutomationEventProcessor.js.map +0 -1
- package/dist/esm/eventprocessor/eventResponses.d.ts +0 -134
- package/dist/esm/eventprocessor/eventResponses.d.ts.map +0 -1
- package/dist/esm/eventprocessor/eventResponses.js +0 -4
- package/dist/esm/eventprocessor/eventResponses.js.map +0 -1
- package/dist/esm/generated/src/operations/callDialog.d.ts +0 -35
- package/dist/esm/generated/src/operations/callDialog.d.ts.map +0 -1
- package/dist/esm/generated/src/operations/callDialog.js +0 -111
- package/dist/esm/generated/src/operations/callDialog.js.map +0 -1
- package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
- package/dist/esm/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
- package/dist/esm/generated/src/operationsInterfaces/callDialog.js +0 -9
- package/dist/esm/generated/src/operationsInterfaces/callDialog.js.map +0 -1
- package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts +0 -39
- package/dist/react-native/eventprocessor/callAutomationEventProcessor.d.ts.map +0 -1
- package/dist/react-native/eventprocessor/callAutomationEventProcessor.js +0 -137
- package/dist/react-native/eventprocessor/callAutomationEventProcessor.js.map +0 -1
- package/dist/react-native/eventprocessor/eventResponses.d.ts +0 -134
- package/dist/react-native/eventprocessor/eventResponses.d.ts.map +0 -1
- package/dist/react-native/eventprocessor/eventResponses.js +0 -4
- package/dist/react-native/eventprocessor/eventResponses.js.map +0 -1
- package/dist/react-native/generated/src/operations/callDialog.d.ts +0 -35
- package/dist/react-native/generated/src/operations/callDialog.d.ts.map +0 -1
- package/dist/react-native/generated/src/operations/callDialog.js +0 -111
- package/dist/react-native/generated/src/operations/callDialog.js.map +0 -1
- package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts +0 -27
- package/dist/react-native/generated/src/operationsInterfaces/callDialog.d.ts.map +0 -1
- package/dist/react-native/generated/src/operationsInterfaces/callDialog.js +0 -9
- package/dist/react-native/generated/src/operationsInterfaces/callDialog.js.map +0 -1
package/README.md
CHANGED
|
@@ -33,7 +33,6 @@ To use this client library in the browser, first you need to use a bundler. For
|
|
|
33
33
|
| CallRecording | `CallRecording` can be used to do recording related actions, such as `startRecording`. This can be retrieved from `CallAutomationClient`. |
|
|
34
34
|
| Callback Events | Callback events are events sent back during duration of the call. It gives information and state of the call, such as `CallConnected`. `CallbackUrl` must be provided during `createCall` and `answerCall`, and callback events will be sent to this url. You can use `callAutomationEventParser` to parse these events when it arrives. |
|
|
35
35
|
| Incoming Call Event | When incoming call happens (that can be answered with `answerCall`), incoming call eventgrid event will be sent. This is different from Callback events above, and should be setup on Azure portal. See [Incoming Call][incomingcall] for detail. |
|
|
36
|
-
| CallAutomationEventProcessor | `CallAutomationEventProcessor` is a convinient way to handle mid-call callback events such as `CallConnected`. This will ensure correlation between call and events more easily. See below example for its usage. |
|
|
37
36
|
|
|
38
37
|
## Examples
|
|
39
38
|
|
|
@@ -99,53 +98,6 @@ const myFile: FileSource = { url: "https://<FILE-SOURCE>/<SOME-FILE>.wav", kind:
|
|
|
99
98
|
const response = await callConnection.getCallMedia().playToAll([myFile]);
|
|
100
99
|
```
|
|
101
100
|
|
|
102
|
-
### Handle Mid-Connection callback events
|
|
103
|
-
|
|
104
|
-
To easily handle mid-connection events, Call Automation's SDK provides easier way to handle these events. Take a look at CallAutomationEventProcessor. This will ensure correlation between call and events more easily.
|
|
105
|
-
|
|
106
|
-
```ts snippet:ReadmeSampleEventProcessor
|
|
107
|
-
import { DefaultAzureCredential } from "@azure/identity";
|
|
108
|
-
import { CallAutomationClient } from "@azure/communication-call-automation";
|
|
109
|
-
|
|
110
|
-
// Your unique Azure Communication service endpoint
|
|
111
|
-
const credential = new DefaultAzureCredential();
|
|
112
|
-
const endpointUrl = "<ENDPOINT>";
|
|
113
|
-
const callAutomationClient = new CallAutomationClient(endpointUrl, credential);
|
|
114
|
-
|
|
115
|
-
const eventProcessor = callAutomationClient.getEventProcessor();
|
|
116
|
-
eventProcessor.processEvents("CallConnected");
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
ProcessEvents is required for EventProcessor to work. After event is being consumed by EventProcessor, you can start using its feature.
|
|
120
|
-
|
|
121
|
-
See below for example: where you are making a call with CreateCall, and wait for CallConnected event of the call.
|
|
122
|
-
|
|
123
|
-
```ts snippet:ReadmeSampleEventProcessorExample
|
|
124
|
-
import { DefaultAzureCredential } from "@azure/identity";
|
|
125
|
-
import { CallAutomationClient } from "@azure/communication-call-automation";
|
|
126
|
-
|
|
127
|
-
// Your unique Azure Communication service endpoint
|
|
128
|
-
const credential = new DefaultAzureCredential();
|
|
129
|
-
const endpointUrl = "<ENDPOINT>";
|
|
130
|
-
const callAutomationClient = new CallAutomationClient(endpointUrl, credential);
|
|
131
|
-
|
|
132
|
-
// send out the invitation, creating call
|
|
133
|
-
const target = { communicationUserId: "8:acs:..." };
|
|
134
|
-
const callInvite = { targetParticipant: target };
|
|
135
|
-
const callbackUrl = "https://<MY-EVENT-HANDLER-URL>/events";
|
|
136
|
-
const callResult = await callAutomationClient.createCall(callInvite, callbackUrl);
|
|
137
|
-
|
|
138
|
-
// giving 30 seconds timeout for waiting on createCall's event, 'CallConnected'
|
|
139
|
-
const createCallEventResult = await callResult.waitForEventProcessor(undefined, 30000);
|
|
140
|
-
// once this returns, call is now established!
|
|
141
|
-
|
|
142
|
-
// check if it was successful
|
|
143
|
-
if (createCallEventResult.isSuccess) {
|
|
144
|
-
// work with callConnected event
|
|
145
|
-
const callConnectedEvent = createCallEventResult.successResult!;
|
|
146
|
-
}
|
|
147
|
-
```
|
|
148
|
-
|
|
149
101
|
## Troubleshooting
|
|
150
102
|
|
|
151
103
|
### Logging
|
|
@@ -6,7 +6,6 @@ import { CallRecording } from "./callRecording.js";
|
|
|
6
6
|
import type { AnswerCallOptions, ConnectCallOptions, CreateCallOptions, RedirectCallOptions, RejectCallOptions } from "./models/options.js";
|
|
7
7
|
import type { AnswerCallResult, ConnectCallResult, CreateCallResult } from "./models/responses.js";
|
|
8
8
|
import { type CallInvite, type CallLocator } from "./models/models.js";
|
|
9
|
-
import { CallAutomationEventProcessor } from "./eventprocessor/callAutomationEventProcessor.js";
|
|
10
9
|
/**
|
|
11
10
|
* Client options used to configure CallAutomation Client API requests.
|
|
12
11
|
*/
|
|
@@ -24,8 +23,6 @@ export declare class CallAutomationClient {
|
|
|
24
23
|
private readonly sourceIdentity?;
|
|
25
24
|
private readonly credential;
|
|
26
25
|
private readonly internalPipelineOptions;
|
|
27
|
-
private readonly callAutomationEventProcessor;
|
|
28
|
-
private readonly endpoint;
|
|
29
26
|
/**
|
|
30
27
|
* Initializes a new instance of the CallAutomationClient class.
|
|
31
28
|
* @param connectionString - Connection string to connect to an Azure Communication Service resource.
|
|
@@ -53,10 +50,6 @@ export declare class CallAutomationClient {
|
|
|
53
50
|
* Get Source Identity that is used for create and answer call
|
|
54
51
|
*/
|
|
55
52
|
getSourceIdentity(): CommunicationUserIdentifier | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Get event processor to work with call automation events
|
|
58
|
-
*/
|
|
59
|
-
getEventProcessor(): CallAutomationEventProcessor;
|
|
60
53
|
private createCallInternal;
|
|
61
54
|
/**
|
|
62
55
|
* Create an outgoing call from source to a target identity.
|
|
@@ -94,7 +87,6 @@ export declare class CallAutomationClient {
|
|
|
94
87
|
* @param options - Additional request options contains rejectCall api options.
|
|
95
88
|
*/
|
|
96
89
|
rejectCall(incomingCallContext: string, options?: RejectCallOptions): Promise<void>;
|
|
97
|
-
private createCustomCallingContextInternal;
|
|
98
90
|
/**
|
|
99
91
|
* Create connection to room call.
|
|
100
92
|
* @param callLocator - Call locator to create connection.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callAutomationClient.d.ts","sourceRoot":"","sources":["../../src/callAutomationClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EACV,uBAAuB,EACvB,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A2B;IAmCvC;;;OAGG;IACI,iBAAiB,CAAC,gBAAgB,EAAE,MAAM,GAAG,cAAc;IASlE;;OAEG;IACI,gBAAgB,IAAI,aAAa;IAQxC;;OAEG;IACI,iBAAiB,IAAI,2BAA2B,GAAG,SAAS;YAIrD,kBAAkB;IAgDhC;;;;;OAKG;IACU,UAAU,CACrB,iBAAiB,EAAE,UAAU,EAC7B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IAoB5B;;;;;OAKG;IACU,eAAe,CAC1B,kBAAkB,EAAE,uBAAuB,EAAE,EAC7C,WAAW,EAAE,MAAM,EAEnB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IAkB5B;;;;;OAKG;IACU,UAAU,CACrB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IA4D5B;;;;;;OAMG;IACU,YAAY,CACvB,mBAAmB,EAAE,MAAM,EAC3B,iBAAiB,EAAE,UAAU,EAC7B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC;IAchB;;;;;OAKG;IACU,UAAU,CACrB,mBAAmB,EAAE,MAAM,EAC3B,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAchB;;;;;OAKG;IACU,WAAW,CACtB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC;CA+D9B"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import { isTokenCredential } from "@azure/core-auth";
|
|
3
|
-
import { parseClientArguments, isKeyCredential } from "@azure/communication-common";
|
|
2
|
+
import { parseClientArguments, isKeyCredential, createCommunicationAuthPolicy, } from "@azure/communication-common";
|
|
4
3
|
import { logger } from "./models/logger.js";
|
|
4
|
+
import { CallAutomationApiClient, } from "./generated/src/index.js";
|
|
5
5
|
import { CallConnection } from "./callConnection.js";
|
|
6
6
|
import { CallRecording } from "./callRecording.js";
|
|
7
|
-
import { communicationIdentifierConverter, communicationIdentifierModelConverter, communicationUserIdentifierConverter, communicationUserIdentifierModelConverter,
|
|
7
|
+
import { communicationIdentifierConverter, communicationIdentifierModelConverter, communicationUserIdentifierConverter, communicationUserIdentifierModelConverter, phoneNumberIdentifierConverter, microsoftTeamsAppIdentifierModelConverter, PhoneNumberIdentifierModelConverter, } from "./utli/converters.js";
|
|
8
8
|
import { randomUUID } from "@azure/core-util";
|
|
9
|
-
import { createCustomCallAutomationApiClient } from "./credential/callAutomationAuthPolicy.js";
|
|
10
|
-
import { CallAutomationEventProcessor } from "./eventprocessor/callAutomationEventProcessor.js";
|
|
11
9
|
/**
|
|
12
10
|
* Checks whether the type of a value is CallAutomationClientOptions or not.
|
|
13
11
|
*
|
|
@@ -18,25 +16,30 @@ const isCallAutomationClientOptions = (options) => !!options && !isTokenCredenti
|
|
|
18
16
|
* A CallAutomationClient represents a Client to the Azure Communication CallAutomation service.
|
|
19
17
|
*/
|
|
20
18
|
export class CallAutomationClient {
|
|
19
|
+
callAutomationApiClient;
|
|
20
|
+
sourceIdentity;
|
|
21
|
+
credential;
|
|
22
|
+
internalPipelineOptions;
|
|
21
23
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
22
24
|
const options = isCallAutomationClientOptions(credentialOrOptions)
|
|
23
25
|
? credentialOrOptions
|
|
24
26
|
: maybeOptions;
|
|
25
|
-
if (!
|
|
27
|
+
if (!options?.userAgentOptions) {
|
|
26
28
|
options.userAgentOptions = {};
|
|
27
29
|
}
|
|
28
|
-
this.internalPipelineOptions =
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
this.internalPipelineOptions = {
|
|
31
|
+
...options,
|
|
32
|
+
...{
|
|
33
|
+
loggingOptions: {
|
|
34
|
+
logger: logger.info,
|
|
35
|
+
},
|
|
31
36
|
},
|
|
32
|
-
}
|
|
37
|
+
};
|
|
33
38
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
34
|
-
|
|
39
|
+
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
35
40
|
this.credential = credential;
|
|
36
|
-
|
|
37
|
-
this.
|
|
38
|
-
// create api client (using custom api endpoint if available)
|
|
39
|
-
this.callAutomationApiClient = createCustomCallAutomationApiClient(credential, this.internalPipelineOptions, this.endpoint);
|
|
41
|
+
this.callAutomationApiClient = new CallAutomationApiClient(url, this.internalPipelineOptions);
|
|
42
|
+
this.callAutomationApiClient.pipeline.addPolicy(authPolicy);
|
|
40
43
|
this.sourceIdentity = communicationUserIdentifierModelConverter(options.sourceIdentity);
|
|
41
44
|
}
|
|
42
45
|
/**
|
|
@@ -44,13 +47,13 @@ export class CallAutomationClient {
|
|
|
44
47
|
* @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: 421CONTOSO-cRD6-4RDc-a078-99dRANDOMf).
|
|
45
48
|
*/
|
|
46
49
|
getCallConnection(callConnectionId) {
|
|
47
|
-
return new CallConnection(callConnectionId, this.endpoint, this.credential, this.
|
|
50
|
+
return new CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
|
|
48
51
|
}
|
|
49
52
|
/**
|
|
50
53
|
* Initializes a new instance of CallRecording.
|
|
51
54
|
*/
|
|
52
55
|
getCallRecording() {
|
|
53
|
-
return new CallRecording(this.endpoint, this.credential, this.internalPipelineOptions);
|
|
56
|
+
return new CallRecording(this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Get Source Identity that is used for create and answer call
|
|
@@ -58,45 +61,29 @@ export class CallAutomationClient {
|
|
|
58
61
|
getSourceIdentity() {
|
|
59
62
|
return communicationUserIdentifierConverter(this.sourceIdentity);
|
|
60
63
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Get event processor to work with call automation events
|
|
63
|
-
*/
|
|
64
|
-
getEventProcessor() {
|
|
65
|
-
return this.callAutomationEventProcessor;
|
|
66
|
-
}
|
|
67
64
|
async createCallInternal(request, options) {
|
|
68
|
-
const optionsInternal =
|
|
69
|
-
|
|
65
|
+
const optionsInternal = {
|
|
66
|
+
...options,
|
|
67
|
+
repeatabilityFirstSent: new Date(),
|
|
68
|
+
repeatabilityRequestID: randomUUID(),
|
|
69
|
+
};
|
|
70
|
+
const { callConnectionId, answeredBy, targets, sourceCallerIdNumber, source, answeredFor, ...result } = await this.callAutomationApiClient.createCall(request, optionsInternal);
|
|
70
71
|
if (callConnectionId) {
|
|
71
|
-
const callConnectionPropertiesDto =
|
|
72
|
+
const callConnectionPropertiesDto = {
|
|
73
|
+
...result,
|
|
74
|
+
callConnectionId: callConnectionId,
|
|
75
|
+
source: source ? communicationIdentifierConverter(source) : undefined,
|
|
76
|
+
answeredby: communicationUserIdentifierConverter(answeredBy),
|
|
77
|
+
answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,
|
|
78
|
+
targetParticipants: targets?.map((returnedTarget) => communicationIdentifierConverter(returnedTarget)),
|
|
79
|
+
sourceCallerIdNumber: sourceCallerIdNumber
|
|
72
80
|
? phoneNumberIdentifierConverter(sourceCallerIdNumber)
|
|
73
|
-
: undefined
|
|
74
|
-
|
|
81
|
+
: undefined,
|
|
82
|
+
};
|
|
83
|
+
const callConnection = new CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
|
|
75
84
|
const createCallResult = {
|
|
76
85
|
callConnectionProperties: callConnectionPropertiesDto,
|
|
77
86
|
callConnection: callConnection,
|
|
78
|
-
waitForEventProcessor: async (abortSignal, timeoutInMs) => {
|
|
79
|
-
const createCallEventResult = {
|
|
80
|
-
isSuccess: false,
|
|
81
|
-
};
|
|
82
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
83
|
-
if (event.callConnectionId === callConnectionId && event.kind === "CallConnected") {
|
|
84
|
-
createCallEventResult.isSuccess = true;
|
|
85
|
-
createCallEventResult.successResult = event;
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
else if (event.callConnectionId === callConnectionId &&
|
|
89
|
-
event.kind === "CreateCallFailed") {
|
|
90
|
-
createCallEventResult.isSuccess = false;
|
|
91
|
-
createCallEventResult.failureResult = event;
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
}, abortSignal, timeoutInMs);
|
|
98
|
-
return createCallEventResult;
|
|
99
|
-
},
|
|
100
87
|
};
|
|
101
88
|
return createCallResult;
|
|
102
89
|
}
|
|
@@ -111,16 +98,16 @@ export class CallAutomationClient {
|
|
|
111
98
|
async createCall(targetParticipant, callbackUrl, options = {}) {
|
|
112
99
|
const request = {
|
|
113
100
|
source: this.sourceIdentity,
|
|
114
|
-
teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),
|
|
115
101
|
targets: [communicationIdentifierModelConverter(targetParticipant.targetParticipant)],
|
|
116
102
|
callbackUri: callbackUrl,
|
|
117
103
|
operationContext: options.operationContext,
|
|
118
104
|
callIntelligenceOptions: options.callIntelligenceOptions,
|
|
119
105
|
mediaStreamingOptions: options.mediaStreamingOptions,
|
|
120
106
|
transcriptionOptions: options.transcriptionOptions,
|
|
121
|
-
customCallingContext: this.createCustomCallingContextInternal(targetParticipant.customCallingContext),
|
|
122
107
|
sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(targetParticipant.sourceCallIdNumber),
|
|
123
108
|
sourceDisplayName: targetParticipant.sourceDisplayName,
|
|
109
|
+
teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),
|
|
110
|
+
enableLoopbackAudio: options.enableLoopbackAudio,
|
|
124
111
|
};
|
|
125
112
|
return this.createCallInternal(request, options);
|
|
126
113
|
}
|
|
@@ -135,7 +122,6 @@ export class CallAutomationClient {
|
|
|
135
122
|
options = {}) {
|
|
136
123
|
const request = {
|
|
137
124
|
source: this.sourceIdentity,
|
|
138
|
-
teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),
|
|
139
125
|
targets: targetParticipants.map((target) => communicationIdentifierModelConverter(target)),
|
|
140
126
|
callbackUri: callbackUrl,
|
|
141
127
|
operationContext: options.operationContext,
|
|
@@ -144,6 +130,8 @@ export class CallAutomationClient {
|
|
|
144
130
|
transcriptionOptions: options.transcriptionOptions,
|
|
145
131
|
sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),
|
|
146
132
|
sourceDisplayName: options.sourceDisplayName,
|
|
133
|
+
teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),
|
|
134
|
+
enableLoopbackAudio: options.enableLoopbackAudio,
|
|
147
135
|
};
|
|
148
136
|
return this.createCallInternal(request, options);
|
|
149
137
|
}
|
|
@@ -154,48 +142,39 @@ export class CallAutomationClient {
|
|
|
154
142
|
* @param options - Additional request options contains answerCall api options.
|
|
155
143
|
*/
|
|
156
144
|
async answerCall(incomingCallContext, callbackUrl, options = {}) {
|
|
157
|
-
const { callIntelligenceOptions, mediaStreamingOptions, transcriptionOptions, operationContext
|
|
145
|
+
const { callIntelligenceOptions, mediaStreamingOptions, transcriptionOptions, operationContext, ...operationOptions } = options;
|
|
158
146
|
const request = {
|
|
159
147
|
incomingCallContext: incomingCallContext,
|
|
160
148
|
mediaStreamingOptions: mediaStreamingOptions,
|
|
161
149
|
transcriptionOptions: transcriptionOptions,
|
|
162
150
|
callIntelligenceOptions: callIntelligenceOptions,
|
|
163
|
-
customCallingContext: this.createCustomCallingContextInternal(options.customCallingContext),
|
|
164
151
|
operationContext: operationContext,
|
|
165
152
|
callbackUri: callbackUrl,
|
|
166
153
|
answeredBy: this.sourceIdentity,
|
|
154
|
+
enableLoopbackAudio: options.enableLoopbackAudio,
|
|
167
155
|
};
|
|
168
|
-
const optionsInternal =
|
|
169
|
-
|
|
156
|
+
const optionsInternal = {
|
|
157
|
+
...operationOptions,
|
|
158
|
+
repeatabilityFirstSent: new Date(),
|
|
159
|
+
repeatabilityRequestID: randomUUID(),
|
|
160
|
+
};
|
|
161
|
+
const { callConnectionId, targets, sourceCallerIdNumber, answeredBy, source, answeredFor, ...result } = await this.callAutomationApiClient.answerCall(request, optionsInternal);
|
|
170
162
|
if (callConnectionId) {
|
|
171
|
-
const callConnectionProperties =
|
|
163
|
+
const callConnectionProperties = {
|
|
164
|
+
...result,
|
|
165
|
+
callConnectionId: callConnectionId,
|
|
166
|
+
source: source ? communicationIdentifierConverter(source) : undefined,
|
|
167
|
+
answeredby: communicationUserIdentifierConverter(answeredBy),
|
|
168
|
+
answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,
|
|
169
|
+
targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),
|
|
170
|
+
sourceCallerIdNumber: sourceCallerIdNumber
|
|
172
171
|
? phoneNumberIdentifierConverter(sourceCallerIdNumber)
|
|
173
|
-
: undefined
|
|
174
|
-
|
|
172
|
+
: undefined,
|
|
173
|
+
};
|
|
174
|
+
const callConnection = new CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
|
|
175
175
|
const answerCallResult = {
|
|
176
176
|
callConnectionProperties: callConnectionProperties,
|
|
177
177
|
callConnection: callConnection,
|
|
178
|
-
waitForEventProcessor: async (abortSignal, timeoutInMs) => {
|
|
179
|
-
const answerCallEventResult = {
|
|
180
|
-
isSuccess: false,
|
|
181
|
-
};
|
|
182
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
183
|
-
if (event.callConnectionId === callConnectionId && event.kind === "CallConnected") {
|
|
184
|
-
answerCallEventResult.isSuccess = true;
|
|
185
|
-
answerCallEventResult.successResult = event;
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
if (event.callConnectionId === callConnectionId && event.kind === "AnswerFailed") {
|
|
189
|
-
answerCallEventResult.isSuccess = false;
|
|
190
|
-
answerCallEventResult.failureResult = event;
|
|
191
|
-
return true;
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
196
|
-
}, abortSignal, timeoutInMs);
|
|
197
|
-
return answerCallEventResult;
|
|
198
|
-
},
|
|
199
178
|
};
|
|
200
179
|
return answerCallResult;
|
|
201
180
|
}
|
|
@@ -212,9 +191,12 @@ export class CallAutomationClient {
|
|
|
212
191
|
const request = {
|
|
213
192
|
incomingCallContext: incomingCallContext,
|
|
214
193
|
target: communicationIdentifierModelConverter(targetParticipant.targetParticipant),
|
|
215
|
-
customCallingContext: this.createCustomCallingContextInternal(targetParticipant.customCallingContext),
|
|
216
194
|
};
|
|
217
|
-
const optionsInternal =
|
|
195
|
+
const optionsInternal = {
|
|
196
|
+
...options,
|
|
197
|
+
repeatabilityFirstSent: new Date(),
|
|
198
|
+
repeatabilityRequestID: randomUUID(),
|
|
199
|
+
};
|
|
218
200
|
return this.callAutomationApiClient.redirectCall(request, optionsInternal);
|
|
219
201
|
}
|
|
220
202
|
/**
|
|
@@ -228,39 +210,12 @@ export class CallAutomationClient {
|
|
|
228
210
|
incomingCallContext: incomingCallContext,
|
|
229
211
|
callRejectReason: options.callRejectReason,
|
|
230
212
|
};
|
|
231
|
-
const optionsInternal =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const sipHeaders = {};
|
|
236
|
-
const voipHeaders = {};
|
|
237
|
-
let teamsPhoneCallDetails = undefined;
|
|
238
|
-
if (customCallingContext) {
|
|
239
|
-
for (const header of customCallingContext) {
|
|
240
|
-
if (header.kind === "sipuui") {
|
|
241
|
-
sipHeaders[`User-To-User`] = header.value;
|
|
242
|
-
}
|
|
243
|
-
else if (header.kind === "sipx") {
|
|
244
|
-
if (header.sipHeaderPrefix === "X-") {
|
|
245
|
-
sipHeaders[`X-${header.key}`] = header.value;
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
sipHeaders[`X-MS-Custom-${header.key}`] = header.value;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
else if (header.kind === "voip") {
|
|
252
|
-
voipHeaders[`${header.key}`] = header.value;
|
|
253
|
-
}
|
|
254
|
-
else if (header.kind === "teamsPhoneCallDetails") {
|
|
255
|
-
teamsPhoneCallDetails = teamsPhoneCallDetailsModelConverter(header);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
return {
|
|
260
|
-
sipHeaders: sipHeaders,
|
|
261
|
-
voipHeaders: voipHeaders,
|
|
262
|
-
teamsPhoneCallDetails: teamsPhoneCallDetails,
|
|
213
|
+
const optionsInternal = {
|
|
214
|
+
...options,
|
|
215
|
+
repeatabilityFirstSent: new Date(),
|
|
216
|
+
repeatabilityRequestID: randomUUID(),
|
|
263
217
|
};
|
|
218
|
+
return this.callAutomationApiClient.rejectCall(request, optionsInternal);
|
|
264
219
|
}
|
|
265
220
|
/**
|
|
266
221
|
* Create connection to room call.
|
|
@@ -289,37 +244,28 @@ export class CallAutomationClient {
|
|
|
289
244
|
connectRequest.callLocator.kind = "serverCallLocator";
|
|
290
245
|
connectRequest.callLocator.serverCallId = callLocator.id;
|
|
291
246
|
}
|
|
292
|
-
const optionsInternal =
|
|
293
|
-
|
|
247
|
+
const optionsInternal = {
|
|
248
|
+
...options,
|
|
249
|
+
repeatabilityFirstSent: new Date(),
|
|
250
|
+
repeatabilityRequestID: randomUUID(),
|
|
251
|
+
};
|
|
252
|
+
const { callConnectionId, targets, sourceCallerIdNumber, answeredBy, source, answeredFor, ...result } = await this.callAutomationApiClient.connect(connectRequest, optionsInternal);
|
|
294
253
|
if (callConnectionId) {
|
|
295
|
-
const callConnectionProperties =
|
|
254
|
+
const callConnectionProperties = {
|
|
255
|
+
...result,
|
|
256
|
+
callConnectionId: callConnectionId,
|
|
257
|
+
source: source ? communicationIdentifierConverter(source) : undefined,
|
|
258
|
+
answeredby: answeredBy ? communicationUserIdentifierConverter(answeredBy) : undefined,
|
|
259
|
+
targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),
|
|
260
|
+
answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,
|
|
261
|
+
sourceCallerIdNumber: sourceCallerIdNumber
|
|
296
262
|
? phoneNumberIdentifierConverter(sourceCallerIdNumber)
|
|
297
|
-
: undefined
|
|
298
|
-
|
|
263
|
+
: undefined,
|
|
264
|
+
};
|
|
265
|
+
const callConnection = new CallConnection(callConnectionId, this.callAutomationApiClient.endpoint, this.credential, this.internalPipelineOptions);
|
|
299
266
|
const connectResult = {
|
|
300
267
|
callConnectionProperties: callConnectionProperties,
|
|
301
268
|
callConnection: callConnection,
|
|
302
|
-
waitForEventProcessor: async (abortSignal, timeoutInMs) => {
|
|
303
|
-
const connectCallEventResult = {
|
|
304
|
-
isSuccess: false,
|
|
305
|
-
};
|
|
306
|
-
await this.callAutomationEventProcessor.waitForEventProcessor((event) => {
|
|
307
|
-
if (event.callConnectionId === callConnectionId && event.kind === "CallConnected") {
|
|
308
|
-
connectCallEventResult.isSuccess = true;
|
|
309
|
-
connectCallEventResult.successResult = event;
|
|
310
|
-
return true;
|
|
311
|
-
}
|
|
312
|
-
if (event.callConnectionId === callConnectionId && event.kind === "ConnectFailed") {
|
|
313
|
-
connectCallEventResult.isSuccess = false;
|
|
314
|
-
connectCallEventResult.failureResult = event;
|
|
315
|
-
return true;
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
return false;
|
|
319
|
-
}
|
|
320
|
-
}, abortSignal, timeoutInMs);
|
|
321
|
-
return connectCallEventResult;
|
|
322
|
-
},
|
|
323
269
|
};
|
|
324
270
|
return connectResult;
|
|
325
271
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callAutomationClient.js","sourceRoot":"","sources":["../../src/callAutomationClient.ts"],"names":[],"mapp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,CAC7B,CAAC;YACF,MAAM,aAAa,GAAsB;gBACvC,wBAAwB,EAAE,wBAAwB;gBAClD,cAAc,EAAE,cAAc;gBAC9B,qBAAqB,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE;oBACxD,MAAM,sBAAsB,GAA2B;wBACrD,SAAS,EAAE,KAAK;qBACjB,CAAC;oBACF,MAAM,IAAI,CAAC,4BAA4B,CAAC,qBAAqB,CAC3D,CAAC,KAAK,EAAE,EAAE;wBACR,IAAI,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;4BAClF,sBAAsB,CAAC,SAAS,GAAG,IAAI,CAAC;4BACxC,sBAAsB,CAAC,aAAa,GAAG,KAAK,CAAC;4BAC7C,OAAO,IAAI,CAAC;wBACd,CAAC;wBACD,IAAI,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;4BAClF,sBAAsB,CAAC,SAAS,GAAG,KAAK,CAAC;4BACzC,sBAAsB,CAAC,aAAa,GAAG,KAAK,CAAC;4BAC7C,OAAO,IAAI,CAAC;wBACd,CAAC;6BAAM,CAAC;4BACN,OAAO,KAAK,CAAC;wBACf,CAAC;oBACH,CAAC,EACD,WAAW,EACX,WAAW,CACZ,CAAC;oBACF,OAAO,sBAAsB,CAAC;gBAChC,CAAC;aACF,CAAC;YACF,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,MAAM,0EAA0E,CAAC;IACnF,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions } from \"@azure/core-client\";\nimport type { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n} from \"@azure/communication-common\";\nimport { parseClientArguments, isKeyCredential } from \"@azure/communication-common\";\nimport { logger } from \"./models/logger.js\";\nimport type {\n AnswerCallRequest,\n CallAutomationApiClient,\n CommunicationUserIdentifierModel,\n CreateCallRequest,\n RedirectCallRequest,\n RejectCallRequest,\n CustomCallingContextInternal,\n ConnectRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnection } from \"./callConnection.js\";\nimport { CallRecording } from \"./callRecording.js\";\nimport type {\n AnswerCallOptions,\n ConnectCallOptions,\n CreateCallOptions,\n RedirectCallOptions,\n RejectCallOptions,\n} from \"./models/options.js\";\nimport type { AnswerCallResult, ConnectCallResult, CreateCallResult } from \"./models/responses.js\";\nimport {\n type CallConnectionProperties,\n type CallInvite,\n type CallLocator,\n type CustomCallingContext,\n} from \"./models/models.js\";\nimport {\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n communicationUserIdentifierModelConverter,\n microsoftTeamsAppIdentifierModelConverter,\n phoneNumberIdentifierConverter,\n PhoneNumberIdentifierModelConverter,\n teamsPhoneCallDetailsModelConverter,\n} from \"./utli/converters.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { createCustomCallAutomationApiClient } from \"./credential/callAutomationAuthPolicy.js\";\nimport { CallAutomationEventProcessor } from \"./eventprocessor/callAutomationEventProcessor.js\";\nimport type {\n AnswerCallEventResult,\n ConnectCallEventResult,\n CreateCallEventResult,\n} from \"./eventprocessor/eventResponses.js\";\n/**\n * Client options used to configure CallAutomation Client API requests.\n */\nexport interface CallAutomationClientOptions extends CommonClientOptions {\n /**\n * The identifier of the source of the call for call creating/answering/inviting operation.\n */\n sourceIdentity?: CommunicationUserIdentifier;\n}\n\n/**\n * Checks whether the type of a value is CallAutomationClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isCallAutomationClientOptions = (options: any): options is CallAutomationClientOptions =>\n !!options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * A CallAutomationClient represents a Client to the Azure Communication CallAutomation service.\n */\nexport class CallAutomationClient {\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly sourceIdentity?: CommunicationUserIdentifierModel;\n private readonly credential: TokenCredential | KeyCredential;\n private readonly internalPipelineOptions: InternalPipelineOptions;\n private readonly callAutomationEventProcessor: CallAutomationEventProcessor;\n private readonly endpoint: string;\n /**\n * Initializes a new instance of the CallAutomationClient class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(connectionString: string, options?: CallAutomationClientOptions);\n\n /**\n * Initializes a new instance of the CallAutomationClient class using a TokenCredential or KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential or KeyCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n endpoint: string,\n credential: TokenCredential | KeyCredential,\n options?: CallAutomationClientOptions,\n );\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | CallAutomationClientOptions,\n maybeOptions: CallAutomationClientOptions = {},\n ) {\n const options = isCallAutomationClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n if (!options?.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n this.internalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n this.endpoint = url;\n\n this.credential = credential;\n\n // create event processor\n this.callAutomationEventProcessor = new CallAutomationEventProcessor();\n\n // create api client (using custom api endpoint if available)\n this.callAutomationApiClient = createCustomCallAutomationApiClient(\n credential,\n this.internalPipelineOptions,\n this.endpoint,\n );\n\n this.sourceIdentity = communicationUserIdentifierModelConverter(options.sourceIdentity);\n }\n\n /**\n * Initializes a new instance of CallConnection.\n * @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: 421CONTOSO-cRD6-4RDc-a078-99dRANDOMf).\n */\n public getCallConnection(callConnectionId: string): CallConnection {\n return new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n }\n\n /**\n * Initializes a new instance of CallRecording.\n */\n public getCallRecording(): CallRecording {\n return new CallRecording(this.endpoint, this.credential, this.internalPipelineOptions);\n }\n\n /**\n * Get Source Identity that is used for create and answer call\n */\n public getSourceIdentity(): CommunicationUserIdentifier | undefined {\n return communicationUserIdentifierConverter(this.sourceIdentity);\n }\n\n /**\n * Get event processor to work with call automation events\n */\n public getEventProcessor(): CallAutomationEventProcessor {\n return this.callAutomationEventProcessor;\n }\n\n private async createCallInternal(\n request: CreateCallRequest,\n options?: CreateCallOptions,\n ): Promise<CreateCallResult> {\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n answeredBy,\n targets,\n sourceCallerIdNumber,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.createCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionPropertiesDto: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((returnedTarget) =>\n communicationIdentifierConverter(returnedTarget),\n ),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const createCallResult: CreateCallResult = {\n callConnectionProperties: callConnectionPropertiesDto,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const createCallEventResult: CreateCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n createCallEventResult.isSuccess = true;\n createCallEventResult.successResult = event;\n return true;\n } else if (\n event.callConnectionId === callConnectionId &&\n event.kind === \"CreateCallFailed\"\n ) {\n createCallEventResult.isSuccess = false;\n createCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n\n return createCallEventResult;\n },\n };\n return createCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Create an outgoing call from source to a target identity.\n * @param targetParticipant - A single target.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createCall(\n targetParticipant: CallInvite,\n callbackUrl: string,\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n targets: [communicationIdentifierModelConverter(targetParticipant.targetParticipant)],\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n customCallingContext: this.createCustomCallingContextInternal(\n targetParticipant.customCallingContext!,\n ),\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(\n targetParticipant.sourceCallIdNumber,\n ),\n sourceDisplayName: targetParticipant.sourceDisplayName,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Create an outgoing call from source to a group of targets identities.\n * @param targetParticipants - A group of targets identities.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createGroupCall(\n targetParticipants: CommunicationIdentifier[],\n callbackUrl: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n targets: targetParticipants.map((target) => communicationIdentifierModelConverter(target)),\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),\n sourceDisplayName: options.sourceDisplayName,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Answer the call.\n * @param incomingCallContext - The context associated with the call.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains answerCall api options.\n */\n public async answerCall(\n incomingCallContext: string,\n callbackUrl: string,\n options: AnswerCallOptions = {},\n ): Promise<AnswerCallResult> {\n const {\n callIntelligenceOptions,\n mediaStreamingOptions,\n transcriptionOptions,\n operationContext,\n ...operationOptions\n } = options;\n const request: AnswerCallRequest = {\n incomingCallContext: incomingCallContext,\n mediaStreamingOptions: mediaStreamingOptions,\n transcriptionOptions: transcriptionOptions,\n callIntelligenceOptions: callIntelligenceOptions,\n customCallingContext: this.createCustomCallingContextInternal(options.customCallingContext!),\n operationContext: operationContext,\n callbackUri: callbackUrl,\n answeredBy: this.sourceIdentity,\n };\n const optionsInternal = {\n ...operationOptions,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.answerCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const answerCallResult: AnswerCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const answerCallEventResult: AnswerCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n answerCallEventResult.isSuccess = true;\n answerCallEventResult.successResult = event;\n return true;\n }\n if (event.callConnectionId === callConnectionId && event.kind === \"AnswerFailed\") {\n answerCallEventResult.isSuccess = false;\n answerCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return answerCallEventResult;\n },\n };\n return answerCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Redirect the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param targetParticipant - The target identity to redirect the call to.\n * @param options - Additional request options contains redirectCall api options.\n */\n public async redirectCall(\n incomingCallContext: string,\n targetParticipant: CallInvite,\n options: RedirectCallOptions = {},\n ): Promise<void> {\n const request: RedirectCallRequest = {\n incomingCallContext: incomingCallContext,\n target: communicationIdentifierModelConverter(targetParticipant.targetParticipant),\n customCallingContext: this.createCustomCallingContextInternal(\n targetParticipant.customCallingContext!,\n ),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.redirectCall(request, optionsInternal);\n }\n\n /**\n * Reject the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param options - Additional request options contains rejectCall api options.\n */\n public async rejectCall(\n incomingCallContext: string,\n options: RejectCallOptions = {},\n ): Promise<void> {\n const request: RejectCallRequest = {\n incomingCallContext: incomingCallContext,\n callRejectReason: options.callRejectReason,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.rejectCall(request, optionsInternal);\n }\n\n private createCustomCallingContextInternal(\n customCallingContext: CustomCallingContext,\n ): CustomCallingContextInternal {\n const sipHeaders: { [key: string]: string } = {};\n const voipHeaders: { [key: string]: string } = {};\n let teamsPhoneCallDetails: any = undefined;\n\n if (customCallingContext) {\n for (const header of customCallingContext) {\n if (header.kind === \"sipuui\") {\n sipHeaders[`User-To-User`] = header.value;\n } else if (header.kind === \"sipx\") {\n if (header.sipHeaderPrefix === \"X-\") {\n sipHeaders[`X-${header.key}`] = header.value;\n } else {\n sipHeaders[`X-MS-Custom-${header.key}`] = header.value;\n }\n } else if (header.kind === \"voip\") {\n voipHeaders[`${header.key}`] = header.value;\n } else if (header.kind === \"teamsPhoneCallDetails\") {\n teamsPhoneCallDetails = teamsPhoneCallDetailsModelConverter(header);\n }\n }\n }\n return {\n sipHeaders: sipHeaders,\n voipHeaders: voipHeaders,\n teamsPhoneCallDetails: teamsPhoneCallDetails,\n };\n }\n\n /**\n * Create connection to room call.\n * @param callLocator - Call locator to create connection.\n * @param callbackUrl - The callback url\n * @param options - Additional request options contains connect api options.\n */\n public async connectCall(\n callLocator: CallLocator,\n callbackUrl: string,\n options: ConnectCallOptions = {},\n ): Promise<ConnectCallResult> {\n const connectRequest: ConnectRequest = {\n callLocator: callLocator,\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n };\n\n if (callLocator.kind === \"groupCallLocator\") {\n connectRequest.callLocator.kind = \"groupCallLocator\";\n connectRequest.callLocator.groupCallId = callLocator.id;\n } else if (callLocator.kind === \"roomCallLocator\") {\n connectRequest.callLocator.kind = \"roomCallLocator\";\n connectRequest.callLocator.roomId = callLocator.id;\n } else {\n connectRequest.callLocator.kind = \"serverCallLocator\";\n connectRequest.callLocator.serverCallId = callLocator.id;\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.connect(connectRequest, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: answeredBy ? communicationUserIdentifierConverter(answeredBy) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.callAutomationEventProcessor,\n this.internalPipelineOptions,\n );\n const connectResult: ConnectCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n waitForEventProcessor: async (abortSignal, timeoutInMs) => {\n const connectCallEventResult: ConnectCallEventResult = {\n isSuccess: false,\n };\n await this.callAutomationEventProcessor.waitForEventProcessor(\n (event) => {\n if (event.callConnectionId === callConnectionId && event.kind === \"CallConnected\") {\n connectCallEventResult.isSuccess = true;\n connectCallEventResult.successResult = event;\n return true;\n }\n if (event.callConnectionId === callConnectionId && event.kind === \"ConnectFailed\") {\n connectCallEventResult.isSuccess = false;\n connectCallEventResult.failureResult = event;\n return true;\n } else {\n return false;\n }\n },\n abortSignal,\n timeoutInMs,\n );\n return connectCallEventResult;\n },\n };\n return connectResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in connect result\";\n }\n}\n"]}
|
|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O,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QAEhF,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,wBAAwB,GAA6B;gBACzD,GAAG,MAAM;gBACT,gBAAgB,EAAE,gBAAgB;gBAClC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,gCAAgC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;gBACrE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,oCAAoC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;gBACrF,kBAAkB,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,gCAAgC,CAAC,MAAM,CAAC,CAAC;gBACtF,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;gBAClF,oBAAoB,EAAE,oBAAoB;oBACxC,CAAC,CAAC,8BAA8B,CAAC,oBAAoB,CAAC;oBACtD,CAAC,CAAC,SAAS;aACd,CAAC;YACF,MAAM,cAAc,GAAG,IAAI,cAAc,CACvC,gBAAgB,EAChB,IAAI,CAAC,uBAAuB,CAAC,QAAQ,EACrC,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,uBAAuB,CAC7B,CAAC;YACF,MAAM,aAAa,GAAsB;gBACvC,wBAAwB,EAAE,wBAAwB;gBAClD,cAAc,EAAE,cAAc;aAC/B,CAAC;YACF,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,MAAM,0EAA0E,CAAC;IACnF,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions } from \"@azure/core-client\";\nimport type { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n} from \"@azure/communication-common\";\nimport {\n parseClientArguments,\n isKeyCredential,\n createCommunicationAuthPolicy,\n} from \"@azure/communication-common\";\nimport { logger } from \"./models/logger.js\";\nimport {\n AnswerCallRequest,\n CallAutomationApiClient,\n CommunicationUserIdentifierModel,\n CreateCallRequest,\n RedirectCallRequest,\n RejectCallRequest,\n ConnectRequest,\n} from \"./generated/src/index.js\";\nimport { CallConnection } from \"./callConnection.js\";\nimport { CallRecording } from \"./callRecording.js\";\nimport type {\n AnswerCallOptions,\n ConnectCallOptions,\n CreateCallOptions,\n RedirectCallOptions,\n RejectCallOptions,\n} from \"./models/options.js\";\nimport type { AnswerCallResult, ConnectCallResult, CreateCallResult } from \"./models/responses.js\";\nimport {\n type CallConnectionProperties,\n type CallInvite,\n type CallLocator,\n} from \"./models/models.js\";\nimport {\n communicationIdentifierConverter,\n communicationIdentifierModelConverter,\n communicationUserIdentifierConverter,\n communicationUserIdentifierModelConverter,\n phoneNumberIdentifierConverter,\n microsoftTeamsAppIdentifierModelConverter,\n PhoneNumberIdentifierModelConverter,\n} from \"./utli/converters.js\";\nimport { randomUUID } from \"@azure/core-util\";\n/**\n * Client options used to configure CallAutomation Client API requests.\n */\nexport interface CallAutomationClientOptions extends CommonClientOptions {\n /**\n * The identifier of the source of the call for call creating/answering/inviting operation.\n */\n sourceIdentity?: CommunicationUserIdentifier;\n}\n\n/**\n * Checks whether the type of a value is CallAutomationClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isCallAutomationClientOptions = (options: any): options is CallAutomationClientOptions =>\n !!options && !isTokenCredential(options) && !isKeyCredential(options);\n\n/**\n * A CallAutomationClient represents a Client to the Azure Communication CallAutomation service.\n */\nexport class CallAutomationClient {\n private readonly callAutomationApiClient: CallAutomationApiClient;\n private readonly sourceIdentity?: CommunicationUserIdentifierModel;\n private readonly credential: TokenCredential | KeyCredential;\n private readonly internalPipelineOptions: InternalPipelineOptions;\n\n /**\n * Initializes a new instance of the CallAutomationClient class.\n * @param connectionString - Connection string to connect to an Azure Communication Service resource.\n * Example: \"endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret\";\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(connectionString: string, options?: CallAutomationClientOptions);\n\n /**\n * Initializes a new instance of the CallAutomationClient class using a TokenCredential or KeyCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential or KeyCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n endpoint: string,\n credential: TokenCredential | KeyCredential,\n options?: CallAutomationClientOptions,\n );\n\n constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | CallAutomationClientOptions,\n maybeOptions: CallAutomationClientOptions = {},\n ) {\n const options = isCallAutomationClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n if (!options?.userAgentOptions) {\n options.userAgentOptions = {};\n }\n\n this.internalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n\n this.credential = credential;\n this.callAutomationApiClient = new CallAutomationApiClient(url, this.internalPipelineOptions);\n this.callAutomationApiClient.pipeline.addPolicy(authPolicy);\n\n this.sourceIdentity = communicationUserIdentifierModelConverter(options.sourceIdentity);\n }\n\n /**\n * Initializes a new instance of CallConnection.\n * @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: 421CONTOSO-cRD6-4RDc-a078-99dRANDOMf).\n */\n public getCallConnection(callConnectionId: string): CallConnection {\n return new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n }\n\n /**\n * Initializes a new instance of CallRecording.\n */\n public getCallRecording(): CallRecording {\n return new CallRecording(\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n }\n\n /**\n * Get Source Identity that is used for create and answer call\n */\n public getSourceIdentity(): CommunicationUserIdentifier | undefined {\n return communicationUserIdentifierConverter(this.sourceIdentity);\n }\n\n private async createCallInternal(\n request: CreateCallRequest,\n options?: CreateCallOptions,\n ): Promise<CreateCallResult> {\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n answeredBy,\n targets,\n sourceCallerIdNumber,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.createCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionPropertiesDto: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((returnedTarget) =>\n communicationIdentifierConverter(returnedTarget),\n ),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const createCallResult: CreateCallResult = {\n callConnectionProperties: callConnectionPropertiesDto,\n callConnection: callConnection,\n };\n return createCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Create an outgoing call from source to a target identity.\n * @param targetParticipant - A single target.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createCall(\n targetParticipant: CallInvite,\n callbackUrl: string,\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n targets: [communicationIdentifierModelConverter(targetParticipant.targetParticipant)],\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(\n targetParticipant.sourceCallIdNumber,\n ),\n sourceDisplayName: targetParticipant.sourceDisplayName,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n enableLoopbackAudio: options.enableLoopbackAudio,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Create an outgoing call from source to a group of targets identities.\n * @param targetParticipants - A group of targets identities.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains createCallConnection api options.\n */\n public async createGroupCall(\n targetParticipants: CommunicationIdentifier[],\n callbackUrl: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: CreateCallOptions = {},\n ): Promise<CreateCallResult> {\n const request: CreateCallRequest = {\n source: this.sourceIdentity,\n targets: targetParticipants.map((target) => communicationIdentifierModelConverter(target)),\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n sourceCallerIdNumber: PhoneNumberIdentifierModelConverter(options.sourceCallIdNumber),\n sourceDisplayName: options.sourceDisplayName,\n teamsAppSource: microsoftTeamsAppIdentifierModelConverter(options.teamsAppSource),\n enableLoopbackAudio: options.enableLoopbackAudio,\n };\n\n return this.createCallInternal(request, options);\n }\n\n /**\n * Answer the call.\n * @param incomingCallContext - The context associated with the call.\n * @param callbackUrl - The callback url.\n * @param options - Additional request options contains answerCall api options.\n */\n public async answerCall(\n incomingCallContext: string,\n callbackUrl: string,\n options: AnswerCallOptions = {},\n ): Promise<AnswerCallResult> {\n const {\n callIntelligenceOptions,\n mediaStreamingOptions,\n transcriptionOptions,\n operationContext,\n ...operationOptions\n } = options;\n const request: AnswerCallRequest = {\n incomingCallContext: incomingCallContext,\n mediaStreamingOptions: mediaStreamingOptions,\n transcriptionOptions: transcriptionOptions,\n callIntelligenceOptions: callIntelligenceOptions,\n operationContext: operationContext,\n callbackUri: callbackUrl,\n answeredBy: this.sourceIdentity,\n enableLoopbackAudio: options.enableLoopbackAudio,\n };\n const optionsInternal = {\n ...operationOptions,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.answerCall(request, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: communicationUserIdentifierConverter(answeredBy),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const answerCallResult: AnswerCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n };\n return answerCallResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in createCall result\";\n }\n\n /**\n * Redirect the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param targetParticipant - The target identity to redirect the call to.\n * @param options - Additional request options contains redirectCall api options.\n */\n public async redirectCall(\n incomingCallContext: string,\n targetParticipant: CallInvite,\n options: RedirectCallOptions = {},\n ): Promise<void> {\n const request: RedirectCallRequest = {\n incomingCallContext: incomingCallContext,\n target: communicationIdentifierModelConverter(targetParticipant.targetParticipant),\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.redirectCall(request, optionsInternal);\n }\n\n /**\n * Reject the call.\n *\n * @param incomingCallContext - The context associated with the call.\n * @param options - Additional request options contains rejectCall api options.\n */\n public async rejectCall(\n incomingCallContext: string,\n options: RejectCallOptions = {},\n ): Promise<void> {\n const request: RejectCallRequest = {\n incomingCallContext: incomingCallContext,\n callRejectReason: options.callRejectReason,\n };\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n return this.callAutomationApiClient.rejectCall(request, optionsInternal);\n }\n\n /**\n * Create connection to room call.\n * @param callLocator - Call locator to create connection.\n * @param callbackUrl - The callback url\n * @param options - Additional request options contains connect api options.\n */\n public async connectCall(\n callLocator: CallLocator,\n callbackUrl: string,\n options: ConnectCallOptions = {},\n ): Promise<ConnectCallResult> {\n const connectRequest: ConnectRequest = {\n callLocator: callLocator,\n callbackUri: callbackUrl,\n operationContext: options.operationContext,\n callIntelligenceOptions: options.callIntelligenceOptions,\n mediaStreamingOptions: options.mediaStreamingOptions,\n transcriptionOptions: options.transcriptionOptions,\n };\n\n if (callLocator.kind === \"groupCallLocator\") {\n connectRequest.callLocator.kind = \"groupCallLocator\";\n connectRequest.callLocator.groupCallId = callLocator.id;\n } else if (callLocator.kind === \"roomCallLocator\") {\n connectRequest.callLocator.kind = \"roomCallLocator\";\n connectRequest.callLocator.roomId = callLocator.id;\n } else {\n connectRequest.callLocator.kind = \"serverCallLocator\";\n connectRequest.callLocator.serverCallId = callLocator.id;\n }\n\n const optionsInternal = {\n ...options,\n repeatabilityFirstSent: new Date(),\n repeatabilityRequestID: randomUUID(),\n };\n\n const {\n callConnectionId,\n targets,\n sourceCallerIdNumber,\n answeredBy,\n source,\n answeredFor,\n ...result\n } = await this.callAutomationApiClient.connect(connectRequest, optionsInternal);\n\n if (callConnectionId) {\n const callConnectionProperties: CallConnectionProperties = {\n ...result,\n callConnectionId: callConnectionId,\n source: source ? communicationIdentifierConverter(source) : undefined,\n answeredby: answeredBy ? communicationUserIdentifierConverter(answeredBy) : undefined,\n targetParticipants: targets?.map((target) => communicationIdentifierConverter(target)),\n answeredFor: answeredFor ? phoneNumberIdentifierConverter(answeredFor) : undefined,\n sourceCallerIdNumber: sourceCallerIdNumber\n ? phoneNumberIdentifierConverter(sourceCallerIdNumber)\n : undefined,\n };\n const callConnection = new CallConnection(\n callConnectionId,\n this.callAutomationApiClient.endpoint,\n this.credential,\n this.internalPipelineOptions,\n );\n const connectResult: ConnectCallResult = {\n callConnectionProperties: callConnectionProperties,\n callConnection: callConnection,\n };\n return connectResult;\n }\n throw \"callConnectionProperties / callConnectionId is missing in connect result\";\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callAutomationEventParser.d.ts","sourceRoot":"","sources":["../../src/callAutomationEventParser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"callAutomationEventParser.d.ts","sourceRoot":"","sources":["../../src/callAutomationEventParser.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EAwCpB,MAAM,oBAAoB,CAAC;AAO5B;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9C,mBAAmB,CAuJrB"}
|