Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temp #18528

Closed
wants to merge 46 commits into from
Closed

Temp #18528

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ac16f3f
Add CallingServer SDK project.
zihzhan-msft Aug 6, 2021
97c43e1
Add CallingServer SDK project.
zihzhan-msft Sep 27, 2021
ddf974f
Update APis with latest 11-15 swagger.
zihzhan-msft Sep 29, 2021
be40b82
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Sep 29, 2021
68a6fa2
Call recording APIs initial check in (#18061)
ravithanneeru Oct 13, 2021
f46a54a
Squashed commit of the following:
zihzhan-msft Oct 13, 2021
cd944a6
Update swagger to 11-15.
zihzhan-msft Oct 13, 2021
51aac4a
Update apis based on new swagger.
zihzhan-msft Oct 14, 2021
5744997
Adding Recording and Download APIs (#18147)
cochi2 Oct 15, 2021
fbbd2c5
Update apis based on new swagger.
zihzhan-msft Oct 14, 2021
61876eb
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Oct 15, 2021
930d374
Add CallConnection live test.
zihzhan-msft Oct 16, 2021
3a6fd3d
Applying some of the comments from internal Azure Review (#18256)
cochi2 Oct 19, 2021
e2dc6d5
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Oct 27, 2021
821b738
Update to latest version of 11-15 swagger.
zihzhan-msft Oct 28, 2021
4aae393
Change CallConnection from object to interface.
zihzhan-msft Oct 29, 2021
a9e1a75
Update Base64 decode encode method to fix test.
zihzhan-msft Oct 29, 2021
1984deb
Common SDK version update in CallingServer SDK (#18451)
ravithanneeru Nov 1, 2021
876cd01
Add comments for interface methods.
zihzhan-msft Nov 1, 2021
0bcf582
Fix api.md warning. update apis, add comments, refactoring
zihzhan-msft Nov 2, 2021
e98fd2e
Remove C-A apis params validation in SDK.
zihzhan-msft Nov 2, 2021
6628520
Remove every optional element from the methods and include them in th…
zihzhan-msft Nov 2, 2021
cb15a7b
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 2, 2021
c8839e5
update api.md
zihzhan-msft Nov 2, 2021
c92d656
Fix style check error.
zihzhan-msft Nov 2, 2021
436840f
Fix style check error.
zihzhan-msft Nov 2, 2021
8b4f8fb
clean up empty files.
zihzhan-msft Nov 2, 2021
222855c
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 2, 2021
41948f9
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 2, 2021
c4202a1
Update format and live test, let build pass.
zihzhan-msft Nov 2, 2021
7625d2b
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 2, 2021
4178ff5
Recording delete APIs in CallingServerClient (#18493)
melneubert Nov 2, 2021
df654d8
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 2, 2021
dd31b42
Fix call automation live test
zihzhan-msft Nov 3, 2021
008b3be
Feature/communication calling server preview (#18462)
zihzhan-msft Nov 3, 2021
6693fc0
update swagger.
zihzhan-msft Nov 4, 2021
e068166
update package name.
zihzhan-msft Nov 4, 2021
5bd0cf8
rename project.
zihzhan-msft Nov 4, 2021
9a93fa0
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 4, 2021
00b1c52
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 4, 2021
3bf608a
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 4, 2021
552a2a2
Feature/communication calling server preview (#18524)
zihzhan-msft Nov 4, 2021
f32cfab
Merge branch 'feature/communication-CallingServer-preview' of https:/…
zihzhan-msft Nov 4, 2021
611ab38
Move calling server project on top of main branch.
zihzhan-msft Nov 4, 2021
ff0b926
Update project related files.
zihzhan-msft Nov 4, 2021
932ed1c
Merge branch 'feature/communication-CallingServer-preview' into new
zihzhan-msft Nov 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/sdk/batch/ @dpwatrous @paterasMSFT @zfengms @deyaaeldeen

# PRLabel: %Communication
/sdk/communication/communication-calling-server/ @zihzhan-msft @cochi2
/sdk/communication/communication-identity/ @Azure/acs-identity-sdk
/sdk/communication/communication-chat/ @LuChen-Microsoft
/sdk/communication/communication-phone-numbers/ @miguhern @danielav7 @whisper6284 @AlonsoMondal
Expand Down
165 changes: 85 additions & 80 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,11 @@
"projectFolder": "sdk/quantum/quantum-jobs",
"versionPolicyName": "client"
},
{
"packageName": "@azure/communication-calling-server",
"projectFolder": "sdk/communication/communication-calling-server",
"versionPolicyName": "client"
},
{
"packageName": "@azure/communication-chat",
"projectFolder": "sdk/communication/communication-chat",
Expand Down Expand Up @@ -1042,4 +1047,4 @@
"versionPolicyName": "management"
}
]
}
}
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-calling-server
safeName: azurecommunicationcallingserver
- name: azure-communication-common
safeName: azurecommunicationcommon
- name: azure-communication-sms
Expand Down
14 changes: 14 additions & 0 deletions sdk/communication/communication-calling-server/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"include": ["dist-esm/src/**/*.js"],
"exclude": [
"**/*.d.ts",
"dist-esm/src/generated/*",
"dist-esm/src/RepeatableContentDownloadResponse.browser.js"
],
"reporter": ["text-summary", "html", "cobertura"],
"exclude-after-remap": false,
"sourceMap": true,
"produce-source-map": true,
"instrument": true,
"all": true
}
9 changes: 9 additions & 0 deletions sdk/communication/communication-calling-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Release History
## 1.0.0-beta.1 (2021-12-15)

The first preview of the Azure Communication CallingServer Client has the following features:

- create/get/update/delete a call
- add participants
- start/stop/pause/resume a recording of the call
- download the recording content
21 changes: 21 additions & 0 deletions sdk/communication/communication-calling-server/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-calling-server/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-calling-server)

## 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-calling-server
```

### 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-calling-server";

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-calling-server";

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-js), 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 -->
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-calling-server.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
142 changes: 142 additions & 0 deletions sdk/communication/communication-calling-server/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
require("dotenv").config();
const {
jsonRecordingFilterFunction,
isPlaybackMode,
isSoftRecordMode,
isRecordMode
} = require("@azure-tools/test-recorder");

module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "./",

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["mocha"],

plugins: [
"karma-mocha",
"karma-mocha-reporter",
"karma-chrome-launcher",
"karma-edge-launcher",
"karma-firefox-launcher",
"karma-ie-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-sourcemap-loader",
"karma-junit-reporter",
"karma-json-to-file-reporter",
"karma-json-preprocessor"
],

// list of files / patterns to load in the browser
files: ["dist-test/index.browser.js"].concat(
isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []
),

// list of files / patterns to exclude
exclude: [],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
"recordings/browsers/**/*.json": ["json"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
// environment values MUST be exported or set with same console running "karma start"
// https://www.npmjs.com/package/karma-env-preprocessor
envPreprocessor: [
"TEST_MODE",
"AZURE_PHONE_NUMBER",
"COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING",
"BASE_URL"
],

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "junit", "json-to-file"],

coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [
{ type: "json", subdir: ".", file: "coverage.json" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
{ type: "html", subdir: "html" },
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }
]
},

junitReporter: {
outputDir: "", // results will be saved as $outputDir/$browserName.xml
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: "", // suite will become the package name attribute in xml testsuite element
useBrowserName: false, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
},

jsonToFileReporter: {
filter: jsonRecordingFilterFunction,
outputPath: "."
},

// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE'
browsers: ["HeadlessChrome"],

customLaunchers: {
HeadlessChrome: {
base: "ChromeHeadless",
flags: ["--no-sandbox", "--disable-web-security"]
}
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
concurrency: 1,

browserNoActivityTimeout: 600000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserConsoleLogOptions: {
terminal: !isRecordMode()
},

client: {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000"
}
}
});
};
Loading