Skip to content

Commit

Permalink
Add CallingServer SDK project.
Browse files Browse the repository at this point in the history
  • Loading branch information
zihzhan-msft committed Aug 7, 2021
1 parent 535e026 commit ac16f3f
Show file tree
Hide file tree
Showing 36 changed files with 3,670 additions and 0 deletions.
55 changes: 55 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,11 @@
"projectFolder": "sdk/quantum/quantum-jobs",
"versionPolicyName": "client"
},
{
"packageName": "@azure/communication-callingserver",
"projectFolder": "sdk/communication/communication-callingserver",
"versionPolicyName": "client"
},
{
"packageName": "@azure/communication-chat",
"projectFolder": "sdk/communication/communication-chat",
Expand Down
2 changes: 2 additions & 0 deletions sdk/communication/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ extends:
parameters:
ServiceDirectory: communication
Artifacts:
- name: azure-communication-callingserver
safeName: azurecommunicationcallingserver
- name: azure-communication-common
safeName: azurecommunicationcommon
- name: azure-communication-sms
Expand Down
1 change: 1 addition & 0 deletions sdk/communication/communication-callingserver/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/**/code-model-v*
10 changes: 10 additions & 0 deletions sdk/communication/communication-callingserver/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": ["dist-esm/src/**/*.js"],
"exclude": ["**/*.d.ts", "dist-esm/src/generated/*"],
"reporter": ["text-summary", "html", "cobertura"],
"exclude-after-remap": false,
"sourceMap": true,
"produce-source-map": true,
"instrument": true,
"all": true
}
21 changes: 21 additions & 0 deletions sdk/communication/communication-callingserver/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
106 changes: 106 additions & 0 deletions sdk/communication/communication-callingserver/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Azure Communication CallingServer client library for JavaScript

This package contains a JavaScript SDK for Azure Communication Services for CallingServer.
Read more about Azure Communication Services [here](https://docs.microsoft.com/azure/communication-services/overview)

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/communication/communication-callingserver)

## Getting started

### Prerequisites

- An [Azure subscription][azure_sub].
- 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].

- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up.
- You must have a phone number configured that is associated with an Azure subscription

### Installing
```bash
npm install @azure/communication-callingserver
```

### Browser support

#### JavaScript Bundle

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](https://aka.ms/AzureSDKBundling).
In `rollup.config.js`, add following customized name exports in `cjs` plugin.

```JavaScript

cjs({
namedExports: {
events: ["EventEmitter"],
"@azure/communication-signaling": ["CommunicationSignalingClient", "SignalingClient"],
"@opentelemetry/api": ["CanonicalCode", "SpanKind", "TraceFlags"]
}
})

```

## Key concepts

`CallingServerClient` provides the functionality to make call connection, join call connection or initialize a server call.

## Examples

The following section provides several code snippets covering some of the most common Azure Communication Services tasks, including:

- [Client Initialization](#client-initialization)
- [Make a call to a phone number recipient](#make-a-call-to-a-phone-number-recipient)

### Client Initialization

To initialize the CallingServer Client, the connection string can be used to instantiate.

```typescript
import { CallingServerClient } from "@azure/communication-callingserver";

const connectionString = `endpoint=https://<resource-name>.communication.azure.com/;accessKey=<Base64-Encoded-Key>`;
const client = new CallingServerClient(connectionString);
```

### Make a call to a phone number recipient

Once the client is initialized, the `createCallConnection` method can be invoked:

```typescript
import { CreateCallOptions } from "@azure/communication-callingserver";

const createCallResponse = callingserver_client.createCallConnection(
source="<from-phone-number>",
targets="<to-phone-number-1>",
createCallOptions=Something
);

```

- `from_`: Something.
- `to`: Something.
- `createCallOptions`: Something.

## Troubleshooting

Running into issues? This section should contain details as to what to do there.

## Next steps

More sample code should go [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/communication/azure-communication-callingserver/samples), along with links out to the appropriate example tests.

## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-js/issues) section of the project

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the
PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

<!-- LINKS -->
31 changes: 31 additions & 0 deletions sdk/communication/communication-callingserver/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "types/src/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/communication-callingserver.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
Loading

0 comments on commit ac16f3f

Please sign in to comment.