@azure/communication-call-automation 1.0.0-alpha.20230315.3
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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/index.js +3754 -0
- package/dist/index.js.map +1 -0
- package/dist-esm/src/callAutomationClient.js +177 -0
- package/dist-esm/src/callAutomationClient.js.map +1 -0
- package/dist-esm/src/callAutomationEventParser.js +100 -0
- package/dist-esm/src/callAutomationEventParser.js.map +1 -0
- package/dist-esm/src/callConnection.js +129 -0
- package/dist-esm/src/callConnection.js.map +1 -0
- package/dist-esm/src/callMedia.js +97 -0
- package/dist-esm/src/callMedia.js.map +1 -0
- package/dist-esm/src/callRecording.js +73 -0
- package/dist-esm/src/callRecording.js.map +1 -0
- package/dist-esm/src/generated/src/callAutomationApiClient.js +195 -0
- package/dist-esm/src/generated/src/callAutomationApiClient.js.map +1 -0
- package/dist-esm/src/generated/src/index.js +11 -0
- package/dist-esm/src/generated/src/index.js.map +1 -0
- package/dist-esm/src/generated/src/models/index.js +196 -0
- package/dist-esm/src/generated/src/models/index.js.map +1 -0
- package/dist-esm/src/generated/src/models/mappers.js +1761 -0
- package/dist-esm/src/generated/src/models/mappers.js.map +1 -0
- package/dist-esm/src/generated/src/models/parameters.js +149 -0
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -0
- package/dist-esm/src/generated/src/operations/callConnection.js +308 -0
- package/dist-esm/src/generated/src/operations/callConnection.js.map +1 -0
- package/dist-esm/src/generated/src/operations/callMedia.js +95 -0
- package/dist-esm/src/generated/src/operations/callMedia.js.map +1 -0
- package/dist-esm/src/generated/src/operations/callRecording.js +144 -0
- package/dist-esm/src/generated/src/operations/callRecording.js.map +1 -0
- package/dist-esm/src/generated/src/operations/index.js +11 -0
- package/dist-esm/src/generated/src/operations/index.js.map +1 -0
- package/dist-esm/src/generated/src/operationsInterfaces/callConnection.js +9 -0
- package/dist-esm/src/generated/src/operationsInterfaces/callConnection.js.map +1 -0
- package/dist-esm/src/generated/src/operationsInterfaces/callMedia.js +9 -0
- package/dist-esm/src/generated/src/operationsInterfaces/callMedia.js.map +1 -0
- package/dist-esm/src/generated/src/operationsInterfaces/callRecording.js +9 -0
- package/dist-esm/src/generated/src/operationsInterfaces/callRecording.js.map +1 -0
- package/dist-esm/src/generated/src/operationsInterfaces/index.js +11 -0
- package/dist-esm/src/generated/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/models/constants.js +4 -0
- package/dist-esm/src/models/constants.js.map +1 -0
- package/dist-esm/src/models/events.js +4 -0
- package/dist-esm/src/models/events.js.map +1 -0
- package/dist-esm/src/models/logger.js +8 -0
- package/dist-esm/src/models/logger.js.map +1 -0
- package/dist-esm/src/models/mapper.js +76 -0
- package/dist-esm/src/models/mapper.js.map +1 -0
- package/dist-esm/src/models/models.js +93 -0
- package/dist-esm/src/models/models.js.map +1 -0
- package/dist-esm/src/models/options.js +4 -0
- package/dist-esm/src/models/options.js.map +1 -0
- package/dist-esm/src/models/responses.js +4 -0
- package/dist-esm/src/models/responses.js.map +1 -0
- package/dist-esm/src/utli/converters.js +98 -0
- package/dist-esm/src/utli/converters.js.map +1 -0
- package/package.json +124 -0
- package/types/communication-call-automation.d.ts +1998 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Microsoft
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Azure Communication Call Automation client library for JavaScript
|
|
2
|
+
|
|
3
|
+
This package contains a JavaScript SDK for Azure Communication Call Automation. Call Automation provides developers the ability to build server-based, intelligent call workflows, and call recording for voice and PSTN channels.
|
|
4
|
+
|
|
5
|
+
[Overview of Call Automation][overview] | [Product documentation][product_docs]
|
|
6
|
+
|
|
7
|
+
## Getting started
|
|
8
|
+
### Prerequisites
|
|
9
|
+
|
|
10
|
+
- An [Azure subscription][azure_sub].
|
|
11
|
+
- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the [Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].
|
|
12
|
+
|
|
13
|
+
### Installing
|
|
14
|
+
```bash
|
|
15
|
+
npm install @azure/communication-call-automation
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Browser support
|
|
19
|
+
#### JavaScript Bundle
|
|
20
|
+
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation][build_doc].
|
|
21
|
+
|
|
22
|
+
## Key concepts
|
|
23
|
+
| Name | Description |
|
|
24
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| CallAutomationClient | `CallAutomationClient` is the primary interface for developers using this client library. It can be used to initiate calls by `createCall` or `answerCall`. |
|
|
26
|
+
| CallConnection | `CallConnection` represents a ongoing call. Once the call is established with `createCall` or `answerCall`, further actions can be performed for the call, such as `transfer` or `addParticipant`. |
|
|
27
|
+
| CallMedia | `CallMedia` can be used to do media related actions, such as `play`, to play media file. This can be retrieved from established `CallConnection`. |
|
|
28
|
+
| CallRecording | `CallRecording` can be used to do recording related actions, such as `startRecording`. This can be retrieved from `CallAutomationClient`. |
|
|
29
|
+
| 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. |
|
|
30
|
+
| 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. |
|
|
31
|
+
|
|
32
|
+
## Examples
|
|
33
|
+
### Initialize CallAutomationClient
|
|
34
|
+
```JavaScript
|
|
35
|
+
import { CallAutomationClient } from '@azure/communication-call-automation';
|
|
36
|
+
|
|
37
|
+
// Your unique Azure Communication service endpoint
|
|
38
|
+
const endpointUrl = '<ENDPOINT>';
|
|
39
|
+
const callAutomationClient = new CallAutomationClient(endpointUrl);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Create Call
|
|
43
|
+
```JavaScript
|
|
44
|
+
import { CommunicationUserIdentifier } from "@azure/communication-common";
|
|
45
|
+
import { CallAutomationClient, CallInvite } from '@azure/communication-call-automation';
|
|
46
|
+
|
|
47
|
+
// target endpoint for ACS User
|
|
48
|
+
const target: CommunicationUserIdentifier = {
|
|
49
|
+
communicationUserId:
|
|
50
|
+
"8:acs:...",
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// make invitation
|
|
54
|
+
const callInvite = new CallInvite(target);
|
|
55
|
+
|
|
56
|
+
// callback url to recieve callback events
|
|
57
|
+
const callbackUrl = "https://<MY-EVENT-HANDLER-URL>/events";
|
|
58
|
+
|
|
59
|
+
// send out the invitation, creating call
|
|
60
|
+
const response = callAutomationClient.createCall(callInvite, callbackUrl);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Play Media
|
|
64
|
+
```JavaScript
|
|
65
|
+
// from callconnection of response above, play media of media file
|
|
66
|
+
const myFile: FileSource = { uri: "https://<FILE-SOURCE>/<SOME-FILE>.wav" }
|
|
67
|
+
const response = callConnection.getCallMedia().playToAll(myFile);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Troubleshooting
|
|
71
|
+
## Next steps
|
|
72
|
+
- [Call Automation Overview][overview]
|
|
73
|
+
- [Incoming Call Concept][incomingcall]
|
|
74
|
+
- [Build a customer interaction workflow using Call Automation][build1]
|
|
75
|
+
- [Redirect inbound telephony calls with Call Automation][build2]
|
|
76
|
+
- [Quickstart: Play action][build3]
|
|
77
|
+
- [Quickstart: Recognize action][build4]
|
|
78
|
+
- [Read more about Call Recording in Azure Communication Services][recording1]
|
|
79
|
+
- [Record and download calls with Event Grid][recording2]
|
|
80
|
+
|
|
81
|
+
## Contributing
|
|
82
|
+
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.
|
|
83
|
+
|
|
84
|
+
<!-- LINKS -->
|
|
85
|
+
[overview]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-automation
|
|
86
|
+
[product_docs]: https://docs.microsoft.com/azure/communication-services/overview
|
|
87
|
+
[azure_cli]: https://docs.microsoft.com/cli/azure
|
|
88
|
+
[azure_sub]: https://azure.microsoft.com/free/
|
|
89
|
+
[azure_portal]: https://portal.azure.com
|
|
90
|
+
[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice
|
|
91
|
+
[build_doc]: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/Bundling.md
|
|
92
|
+
[incomingcall]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/incoming-call-notification
|
|
93
|
+
[build1]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/callflows-for-customer-interactions?pivots=programming-language-csha
|
|
94
|
+
[build2]: https://learn.microsoft.com/azure/communication-services/how-tos/call-automation-sdk/redirect-inbound-telephony-calls?pivots=programming-language-csharp
|
|
95
|
+
[build3]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/play-action?pivots=programming-language-csharp
|
|
96
|
+
[build4]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/recognize-action?pivots=programming-language-csharp
|
|
97
|
+
[recording1]: https://learn.microsoft.com/azure/communication-services/concepts/voice-video-calling/call-recording
|
|
98
|
+
[recording2]: https://learn.microsoft.com/azure/communication-services/quickstarts/voice-video-calling/get-started-call-recording?pivots=programming-language-csharp
|