diff --git a/sdk/communication/communication-callingserver/karma.conf.js b/sdk/communication/communication-callingserver/karma.conf.js index 4de7e2108e56..eb70e227cdd0 100644 --- a/sdk/communication/communication-callingserver/karma.conf.js +++ b/sdk/communication/communication-callingserver/karma.conf.js @@ -53,7 +53,12 @@ module.exports = function(config) { // 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", "COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING", "BASE_URL"], + envPreprocessor: [ + "TEST_MODE", + "AZURE_PHONE_NUMBER", + "COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING", + "BASE_URL" + ], // test results reporter to use // possible values: 'dots', 'progress' diff --git a/sdk/communication/communication-callingserver/package.json b/sdk/communication/communication-callingserver/package.json index 3d988483b9ef..2ef8c5a9153a 100644 --- a/sdk/communication/communication-callingserver/package.json +++ b/sdk/communication/communication-callingserver/package.json @@ -34,7 +34,7 @@ "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", - "test": "npm run build:test && npm run unit-test && npm run integration-test", + "test": "npm run clean && npm run build:test && npm run unit-test", "unit-test:browser": "karma start --single-run", "unit-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js", "unit-test": "npm run unit-test:node && npm run unit-test:browser", diff --git a/sdk/communication/communication-callingserver/recordings/browsers/call_connection_live_test_call_automation_operations/recording_run_create_play_cancel_hangup_scenario.json b/sdk/communication/communication-callingserver/recordings/browsers/call_connection_live_test_call_automation_operations/recording_run_create_play_cancel_hangup_scenario.json new file mode 100644 index 000000000000..f6737bb7a50c --- /dev/null +++ b/sdk/communication/communication-callingserver/recordings/browsers/call_connection_live_test_call_automation_operations/recording_run_create_play_cancel_hangup_scenario.json @@ -0,0 +1,109 @@ +{ + "recordings": [ + { + "method": "POST", + "url": "https://endpoint/identities", + "query": { + "api-version": "2021-03-07" + }, + "requestBody": null, + "status": 201, + "response": "{\"identity\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-8205-baa7-ab49-094822000bb2\"}}", + "responseHeaders": { + "api-supported-versions": "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, 2021-10-31-preview", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 02 Nov 2021 19:33:07 GMT", + "ms-cv": "u3VxHoKgk0iYPdKYa3CYbQ.0", + "request-context": "appId=", + "strict-transport-security": "max-age=2592000", + "x-azure-ref": "0dJKBYQAAAABefUl91ILvTp1ImqJ+Qh+YV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "x-cache": "CONFIG_NOCACHE", + "x-ms-client-request-id": "fe2a3d99-2794-4dae-b99c-25f647c5b077", + "x-processing-time": "44ms" + } + }, + { + "method": "POST", + "url": "https://endpoint/calling/callConnections", + "query": { + "api-version": "2021-11-15-preview" + }, + "requestBody": "{\"alternateCallerId\":{\"value\":\"+18445764430\"},\"targets\":[{\"phoneNumber\":{\"value\":\"+15512477863\"}}],\"source\":{\"communicationUser\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-8205-baa7-ab49-094822000bb2\"}},\"callbackUri\":\"https://endpoint/callback\",\"requestedMediaTypes\":[\"audio\"],\"requestedCallEvents\":[\"participantsUpdated\",\"toneReceived\"]}", + "status": 201, + "response": "{\"callConnectionId\":\"f21f1300-8f34-4130-86d9-810da2f6e6a5\"}", + "responseHeaders": { + "content-length": "59", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 02 Nov 2021 19:33:08 GMT", + "x-azure-ref": "0dJKBYQAAAAAOmVBkPdyNQbZe9ZfLwjw5V1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "x-cache": "CONFIG_NOCACHE", + "x-microsoft-skype-chain-id": "422def29-aa62-4441-9896-059200470ba4", + "x-ms-client-request-id": "6ffc57cd-117f-43f4-8f80-6f33ab32eed8" + } + }, + { + "method": "POST", + "url": "https://endpoint/calling/callConnections/f21f1300-8f34-4130-86d9-810da2f6e6a5/:playAudio", + "query": { + "api-version": "2021-11-15-preview" + }, + "requestBody": "{\"audioFileUri\":\"https://endpoint/audio/sample-message.wav\",\"loop\":true,\"operationContext\":\"operationContext163588158921406416\",\"audioFileId\":\"audioFileId163588158921401351\",\"callbackUri\":\"https://endpoint/callback\"}", + "status": 202, + "response": "{\"operationId\":\"db9ec0f7-4336-4c49-8263-6e91ba2f88be\",\"status\":\"running\",\"operationContext\":\"operationContext163588158921406416\"}", + "responseHeaders": { + "content-length": "129", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 02 Nov 2021 19:33:19 GMT", + "x-azure-ref": "0f5KBYQAAAAC6EqFPKSKtRrVGhs3FgYr/V1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "x-cache": "CONFIG_NOCACHE", + "x-microsoft-skype-chain-id": "1c2f2f40-c036-47a3-9c60-9c5798bf4177", + "x-ms-client-request-id": "23c26182-7b58-4bbc-b9c1-22f2205b4094" + } + }, + { + "method": "POST", + "url": "https://endpoint/calling/callConnections/f21f1300-8f34-4130-86d9-810da2f6e6a5/:cancelAllMediaOperations", + "query": { + "api-version": "2021-11-15-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"operationId\":\"0f7d3e2e-f1a0-4025-a252-a879c09780a2\",\"status\":\"completed\"}", + "responseHeaders": { + "content-length": "75", + "content-type": "application/json; charset=utf-8", + "date": "Tue, 02 Nov 2021 19:33:20 GMT", + "x-azure-ref": "0gJKBYQAAAADIqwUQ1l3yQZXLJRcgax8YV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "x-cache": "CONFIG_NOCACHE", + "x-microsoft-skype-chain-id": "7c9d18bb-8730-4008-a37e-fab272eca023", + "x-ms-client-request-id": "7b6e3fd2-a26f-4eaa-a2d8-c1ef1d902011" + } + }, + { + "method": "POST", + "url": "https://endpoint/calling/callConnections/f21f1300-8f34-4130-86d9-810da2f6e6a5/:hangup", + "query": { + "api-version": "2021-11-15-preview" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Tue, 02 Nov 2021 19:33:30 GMT", + "x-azure-ref": "0i5KBYQAAAACtc28a9gFFQpHH1MRirDfJV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "x-cache": "CONFIG_NOCACHE", + "x-microsoft-skype-chain-id": "1a7a49af-dfa6-4f71-8cbd-d47032aeb7bb", + "x-ms-client-request-id": "96854e0f-816f-49d5-aa1b-88fed6068718" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "audioFileId": "audioFileId163588158921401351", + "operationContext": "operationContext163588158921406416" + }, + "newDate": {} + }, + "hash": "e38f862b35b3985445f9beb2e603ec25" +} \ No newline at end of file diff --git a/sdk/communication/communication-callingserver/recordings/browsers/server_call_live_test_recording_operations/recording_run_all_client_recording_operations.json b/sdk/communication/communication-callingserver/recordings/browsers/server_call_live_test_recording_operations/recording_run_all_client_recording_operations.json index 32d3f9bcd4fd..e884f0061fa7 100644 --- a/sdk/communication/communication-callingserver/recordings/browsers/server_call_live_test_recording_operations/recording_run_all_client_recording_operations.json +++ b/sdk/communication/communication-callingserver/recordings/browsers/server_call_live_test_recording_operations/recording_run_all_client_recording_operations.json @@ -6,17 +6,17 @@ "query": { "api-version": "2021-11-15-preview" }, - "requestBody": "{\"callLocator\":{\"groupCallId\":\"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc\",\"kind\":\"groupCallLocator\"},\"source\":{\"communicationUser\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_6f8c191d-f701-58b7-a744-35bac2a8f074\"}},\"callbackUri\":\"https://bot.contoso.io/callback\",\"requestedMediaTypes\":[\"audio\"],\"requestedCallEvents\":[\"participantsUpdated\"]}", + "requestBody": "{\"callLocator\":{\"groupCallId\":\"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc\",\"kind\":\"groupCallLocator\"},\"source\":{\"communicationUser\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_6f8c191d-f701-58b7-a744-35bac2a8f074\"}},\"callbackUri\":\"https://endpoint/callback\",\"requestedMediaTypes\":[\"audio\"],\"requestedCallEvents\":[\"participantsUpdated\"]}", "status": 202, - "response": "{\"callConnectionId\":\"54201300-becd-49f8-b6dd-942ea7b319eb\"}", + "response": "{\"callConnectionId\":\"c51f1300-9c7f-47f3-a9ad-fe7a135c7abf\"}", "responseHeaders": { "content-length": "59", "content-type": "application/json; charset=utf-8", - "date": "Thu, 14 Oct 2021 22:52:45 GMT", - "x-azure-ref": "0vrRoYQAAAAB+nM0Yry62TogVtyu0dRI7UERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:42:18 GMT", + "x-azure-ref": "0mZSBYQAAAAAYvQ+BB5CmQK7YCbqAO+/4V1NURURHRTA4MDgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "f5882099-b8fc-401a-8d10-469c50e9f49f", - "x-ms-client-request-id": "7c1ca6c6-96ef-44dc-9685-a320e6aea02d" + "x-microsoft-skype-chain-id": "f0a183d0-2ff8-4ef5-ba9b-01410494f48b", + "x-ms-client-request-id": "95b6ea34-4042-405d-b06c-ae0810d56ae6" } }, { @@ -25,17 +25,17 @@ "query": { "api-version": "2021-11-15-preview" }, - "requestBody": "{\"callLocator\":{\"groupCallId\":\"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc\",\"kind\":\"groupCallLocator\"},\"source\":{\"communicationUser\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_ff23b678-5b97-564d-b6c4-6bb53068c498\"}},\"callbackUri\":\"https://bot.contoso.io/callback\",\"requestedMediaTypes\":[\"audio\"],\"requestedCallEvents\":[\"participantsUpdated\"]}", + "requestBody": "{\"callLocator\":{\"groupCallId\":\"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc\",\"kind\":\"groupCallLocator\"},\"source\":{\"communicationUser\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_ff23b678-5b97-564d-b6c4-6bb53068c498\"}},\"callbackUri\":\"https://endpoint/callback\",\"requestedMediaTypes\":[\"audio\"],\"requestedCallEvents\":[\"participantsUpdated\"]}", "status": 202, - "response": "{\"callConnectionId\":\"54201300-10d4-4d80-ace5-302160121a9f\"}", + "response": "{\"callConnectionId\":\"c51f1300-1520-4845-bd29-f6002ad7fb0b\"}", "responseHeaders": { "content-length": "59", "content-type": "application/json; charset=utf-8", - "date": "Thu, 14 Oct 2021 22:52:46 GMT", - "x-azure-ref": "0vrRoYQAAAACoO3Qwu/UOT7ew3pALnRLcUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:42:19 GMT", + "x-azure-ref": "0m5SBYQAAAACYjRand2fASaZcwMgvO2isV1NURURHRTA4MDgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "fb2aaeae-ad3f-4f2f-9fa3-d6df441d8a80", - "x-ms-client-request-id": "beec234f-d2b7-4ef6-932f-9628525e7a76" + "x-microsoft-skype-chain-id": "b57aeca9-e1e2-4601-a279-ff9ad5668a96", + "x-ms-client-request-id": "ddbec267-fce0-46f3-a4e2-94d00896d74a" } }, { @@ -44,22 +44,22 @@ "query": { "api-version": "2021-11-15-preview" }, - "requestBody": "{\"callLocator\":{\"groupCallId\":\"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc\",\"kind\":\"groupCallLocator\"},\"recordingStateCallbackUri\":\"https://bot.contoso.io/callback\"}", + "requestBody": "{\"callLocator\":{\"groupCallId\":\"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc\",\"kind\":\"groupCallLocator\"},\"recordingStateCallbackUri\":\"https://endpoint/callback\"}", "status": 200, - "response": "{\"recordingId\":\"eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI1NDIwMTMwMC04ZGJhLTQyZjQtODY0ZS0yNDcwMzM3MjA0MWIiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1MzY3NTY4Mi03ZThmLTRhOGYtYTcyMS1mMmM1NmI3YThhNzUifQ\"}", + "response": "{\"recordingId\":\"eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiJjNTFmMTMwMC1jODZmLTQ2M2UtOWEzMi1jMTBjZTgzZDhmNjciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1YTMyMmNhNi1hOWI4LTQ1ZWEtYTJiMi00MWQ4MjlhODc4YmIifQ\"}", "responseHeaders": { "content-length": "180", "content-type": "application/json; charset=utf-8", - "date": "Thu, 14 Oct 2021 22:52:52 GMT", - "x-azure-ref": "0v7RoYQAAAACvqYRKhgdxS4FZ/zpXBDQNUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:42:25 GMT", + "x-azure-ref": "0m5SBYQAAAABPMh8+ahNwQqOzXyf7xo29V1NURURHRTA4MDgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "54428484-4cf3-4754-93a2-795a5bcb079d", - "x-ms-client-request-id": "8a0181f3-b27c-45af-9d39-9c2b5f02fbf9" + "x-microsoft-skype-chain-id": "17a54790-abfe-4b74-ad2e-e833a73bda05", + "x-ms-client-request-id": "f3fa2c72-d928-40de-a4e8-74fbc9cb6c66" } }, { "method": "GET", - "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI1NDIwMTMwMC04ZGJhLTQyZjQtODY0ZS0yNDcwMzM3MjA0MWIiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1MzY3NTY4Mi03ZThmLTRhOGYtYTcyMS1mMmM1NmI3YThhNzUifQ", + "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiJjNTFmMTMwMC1jODZmLTQ2M2UtOWEzMi1jMTBjZTgzZDhmNjciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1YTMyMmNhNi1hOWI4LTQ1ZWEtYTJiMi00MWQ4MjlhODc4YmIifQ", "query": { "api-version": "2021-11-15-preview" }, @@ -69,16 +69,16 @@ "responseHeaders": { "content-length": "27", "content-type": "application/json; charset=utf-8", - "date": "Thu, 14 Oct 2021 22:53:02 GMT", - "x-azure-ref": "0zrRoYQAAAAAVWNnymQ+rT6cN+7xexlruUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:42:40 GMT", + "x-azure-ref": "0sZSBYQAAAABRa9LN2IPaR7FOvczllXSBV1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "13ad46ba-c78d-42db-a168-86d37dafc683", - "x-ms-client-request-id": "a4dd635b-ef92-4a91-8180-54e605bc4019" + "x-microsoft-skype-chain-id": "d922b2f8-55e3-4403-be4b-885f85c24836", + "x-ms-client-request-id": "91bcfc86-0273-4e5f-865c-7dda92adbc95" } }, { "method": "POST", - "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI1NDIwMTMwMC04ZGJhLTQyZjQtODY0ZS0yNDcwMzM3MjA0MWIiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1MzY3NTY4Mi03ZThmLTRhOGYtYTcyMS1mMmM1NmI3YThhNzUifQ/:pause", + "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiJjNTFmMTMwMC1jODZmLTQ2M2UtOWEzMi1jMTBjZTgzZDhmNjciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1YTMyMmNhNi1hOWI4LTQ1ZWEtYTJiMi00MWQ4MjlhODc4YmIifQ/:pause", "query": { "api-version": "2021-11-15-preview" }, @@ -87,16 +87,16 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Thu, 14 Oct 2021 22:53:03 GMT", - "x-azure-ref": "0zrRoYQAAAADHbsU6RVVvTZjkee+Z8MqCUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:42:41 GMT", + "x-azure-ref": "0sZSBYQAAAAAo2dFt+dnwTLAnTclsJvW9V1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "cc3c0b14-9655-4482-b870-70e467e105dc", - "x-ms-client-request-id": "694a1772-3e47-4ab7-94c4-aca63c43a5da" + "x-microsoft-skype-chain-id": "8d449bb6-8813-4d9c-8d83-bc87a4b43ef0", + "x-ms-client-request-id": "6c1a4e71-042a-4602-8357-bfa117aecb02" } }, { "method": "GET", - "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI1NDIwMTMwMC04ZGJhLTQyZjQtODY0ZS0yNDcwMzM3MjA0MWIiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1MzY3NTY4Mi03ZThmLTRhOGYtYTcyMS1mMmM1NmI3YThhNzUifQ", + "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiJjNTFmMTMwMC1jODZmLTQ2M2UtOWEzMi1jMTBjZTgzZDhmNjciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1YTMyMmNhNi1hOWI4LTQ1ZWEtYTJiMi00MWQ4MjlhODc4YmIifQ", "query": { "api-version": "2021-11-15-preview" }, @@ -106,16 +106,16 @@ "responseHeaders": { "content-length": "29", "content-type": "application/json; charset=utf-8", - "date": "Thu, 14 Oct 2021 22:53:13 GMT", - "x-azure-ref": "02bRoYQAAAABE337N9ystRrBNizegrYoRUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:42:51 GMT", + "x-azure-ref": "0vJSBYQAAAADkGWWrabQCQqdiGpmHwcGpV1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "26b7331b-f542-40da-bc25-8eff25c051c6", - "x-ms-client-request-id": "52f98b38-2c0e-44c7-91dd-cd36effa54d9" + "x-microsoft-skype-chain-id": "bf0b6aca-a438-4947-a41e-2ebafbda7ec4", + "x-ms-client-request-id": "dbf40a88-1385-4e2f-ba12-fe7ec1d4003e" } }, { "method": "POST", - "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI1NDIwMTMwMC04ZGJhLTQyZjQtODY0ZS0yNDcwMzM3MjA0MWIiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1MzY3NTY4Mi03ZThmLTRhOGYtYTcyMS1mMmM1NmI3YThhNzUifQ/:resume", + "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiJjNTFmMTMwMC1jODZmLTQ2M2UtOWEzMi1jMTBjZTgzZDhmNjciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1YTMyMmNhNi1hOWI4LTQ1ZWEtYTJiMi00MWQ4MjlhODc4YmIifQ/:resume", "query": { "api-version": "2021-11-15-preview" }, @@ -124,16 +124,16 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Thu, 14 Oct 2021 22:53:13 GMT", - "x-azure-ref": "02bRoYQAAAAAUk4a3ykqZSIVDAnlwb1HEUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:42:51 GMT", + "x-azure-ref": "0vJSBYQAAAADznCC16DdlR5YARnu+CEACV1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "dfd38085-5601-4931-9708-d52b03f38b4e", - "x-ms-client-request-id": "c6e2109e-21da-4bbc-8378-80bfa7ce7aa9" + "x-microsoft-skype-chain-id": "ce79b3df-93c8-4628-8feb-2961c33eae71", + "x-ms-client-request-id": "f1f515d8-3a45-4d8b-be85-bdd25d40d34f" } }, { "method": "GET", - "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI1NDIwMTMwMC04ZGJhLTQyZjQtODY0ZS0yNDcwMzM3MjA0MWIiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1MzY3NTY4Mi03ZThmLTRhOGYtYTcyMS1mMmM1NmI3YThhNzUifQ", + "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiJjNTFmMTMwMC1jODZmLTQ2M2UtOWEzMi1jMTBjZTgzZDhmNjciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1YTMyMmNhNi1hOWI4LTQ1ZWEtYTJiMi00MWQ4MjlhODc4YmIifQ", "query": { "api-version": "2021-11-15-preview" }, @@ -143,16 +143,16 @@ "responseHeaders": { "content-length": "27", "content-type": "application/json; charset=utf-8", - "date": "Thu, 14 Oct 2021 22:53:24 GMT", - "x-azure-ref": "05LRoYQAAAAB8FugTGD9MS4miKnkUviBzUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:43:02 GMT", + "x-azure-ref": "0xpSBYQAAAABuN293uG6SQIVpM+huSXp9V1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "3346f8e1-2b31-4ac6-b833-ff2b6e237fe9", - "x-ms-client-request-id": "55d7febe-e6dc-43bc-9a64-62dbbd3978af" + "x-microsoft-skype-chain-id": "855afe55-b989-40c0-a857-8f04d80c333c", + "x-ms-client-request-id": "526aadbf-ef9f-48c7-a7b8-715c58df314b" } }, { "method": "DELETE", - "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiI1NDIwMTMwMC04ZGJhLTQyZjQtODY0ZS0yNDcwMzM3MjA0MWIiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1MzY3NTY4Mi03ZThmLTRhOGYtYTcyMS1mMmM1NmI3YThhNzUifQ", + "url": "https://endpoint/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiJjNTFmMTMwMC1jODZmLTQ2M2UtOWEzMi1jMTBjZTgzZDhmNjciLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI1YTMyMmNhNi1hOWI4LTQ1ZWEtYTJiMi00MWQ4MjlhODc4YmIifQ", "query": { "api-version": "2021-11-15-preview" }, @@ -161,16 +161,16 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Thu, 14 Oct 2021 22:53:24 GMT", - "x-azure-ref": "05LRoYQAAAAAwjWwtBegxRqPstLattVjuUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:43:02 GMT", + "x-azure-ref": "0xpSBYQAAAABCPYHGS6EBRKM7S63CjSRUV1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "55bcccd0-e8be-42b4-ad0a-f83636820945", - "x-ms-client-request-id": "28b2f5f3-dd26-499b-9acb-3511714c3e57" + "x-microsoft-skype-chain-id": "4d6727c9-6ba5-4aa9-a0c1-0a067a5de8ee", + "x-ms-client-request-id": "b2655eab-3973-489e-877a-1e35ccd3e087" } }, { "method": "POST", - "url": "https://endpoint/calling/callConnections/54201300-becd-49f8-b6dd-942ea7b319eb/:hangup", + "url": "https://endpoint/calling/callConnections/c51f1300-9c7f-47f3-a9ad-fe7a135c7abf/:hangup", "query": { "api-version": "2021-11-15-preview" }, @@ -179,16 +179,16 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Thu, 14 Oct 2021 22:53:24 GMT", - "x-azure-ref": "05LRoYQAAAADT7mqOMIo2TLK0u0QlVLtDUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:43:02 GMT", + "x-azure-ref": "0x5SBYQAAAADgbTCrL5ELQ6njaSsP0o2OV1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "246da490-499a-49ec-ba31-701487ce6519", - "x-ms-client-request-id": "5805b724-3059-4972-a851-b31f11285abc" + "x-microsoft-skype-chain-id": "b20560e4-8a8f-404c-bb4d-9bd8acff1bba", + "x-ms-client-request-id": "2fc5e740-376d-4274-9678-e2833c4f61db" } }, { "method": "POST", - "url": "https://endpoint/calling/callConnections/54201300-10d4-4d80-ace5-302160121a9f/:hangup", + "url": "https://endpoint/calling/callConnections/c51f1300-1520-4845-bd29-f6002ad7fb0b/:hangup", "query": { "api-version": "2021-11-15-preview" }, @@ -197,11 +197,11 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Thu, 14 Oct 2021 22:53:24 GMT", - "x-azure-ref": "05LRoYQAAAABLfxDi9THgR7C30LzQp1JmUERYMzFFREdFMDIxOQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "date": "Tue, 02 Nov 2021 19:43:02 GMT", + "x-azure-ref": "0x5SBYQAAAAALIVyemai1TaBfsms1+RPnV1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "736a77c3-29b4-441c-8216-eba7a62c82cc", - "x-ms-client-request-id": "21082aa1-5ab1-4d53-9a15-5feca5ff55a1" + "x-microsoft-skype-chain-id": "52396fcf-d229-48b8-a119-e9fc87ec2211", + "x-ms-client-request-id": "921f0a4f-c07f-458a-aab7-9350516f8858" } } ], diff --git a/sdk/communication/communication-callingserver/recordings/node/call_connection_live_test_call_automation_operations/recording_run_create_play_cancel_hangup_scenario.js b/sdk/communication/communication-callingserver/recordings/node/call_connection_live_test_call_automation_operations/recording_run_create_play_cancel_hangup_scenario.js new file mode 100644 index 000000000000..509908b530a1 --- /dev/null +++ b/sdk/communication/communication-callingserver/recordings/node/call_connection_live_test_call_automation_operations/recording_run_create_play_cancel_hangup_scenario.js @@ -0,0 +1,111 @@ +let nock = require('nock'); + +module.exports.hash = "a408222633e95f57d4cb6d9b42356c6b"; + +module.exports.testInfo = {"uniqueName":{"audioFileId":"audioFileId163588155539809897","operationContext":"operationContext163588155539803449"},"newDate":{}} + +nock('https://endpoint', {"encodedQueryParams":true}) + .post('/identities') + .query(true) + .reply(201, {"identity":{"id":"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-8205-3533-e141-094822000959"}}, [ + 'Content-Length', + '101', + 'Content-Type', + 'application/json; charset=utf-8', + 'Request-Context', + 'appId=', + 'MS-CV', + 'HKkbAq7dqkiWz8fRgwJh7Q.0', + 'Strict-Transport-Security', + 'max-age=2592000', + 'x-ms-client-request-id', + 'fbbc6295-e8e2-4dcb-ad98-fa9e6f89e74a', + 'api-supported-versions', + '2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, 2021-10-31-preview', + 'X-Processing-Time', + '39ms', + 'X-Cache', + 'CONFIG_NOCACHE', + 'X-Azure-Ref', + '0UpKBYQAAAAC7PBUWZYh+TqzhtmUyMNKvV1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + 'Date', + 'Tue, 02 Nov 2021 19:32:33 GMT' +]); + +nock('https://endpoint', {"encodedQueryParams":true}) + .post('/calling/callConnections', {"alternateCallerId":{"value":"+18445764430"},"targets":[{"phoneNumber":{"value":"+15512477863"}}],"source":{"communicationUser":{"id":"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-8205-3533-e141-094822000959"}},"callbackUri":"https://endpoint/callback","requestedMediaTypes":["audio"],"requestedCallEvents":["participantsUpdated","toneReceived"]}) + .query(true) + .reply(201, {"callConnectionId":"4f1f1300-e88f-4307-b278-c0a8b9bcbba3"}, [ + 'Content-Length', + '59', + 'Content-Type', + 'application/json; charset=utf-8', + 'x-ms-client-request-id', + '68ae3cb4-7d81-4517-90c7-b816c770db35', + 'X-Microsoft-Skype-Chain-ID', + 'b5313621-bba4-4b1c-9238-c6998970c9c8', + 'X-Cache', + 'CONFIG_NOCACHE', + 'X-Azure-Ref', + '0UpKBYQAAAACDEGd//e8fT7PgnjxRhYzuV1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + 'Date', + 'Tue, 02 Nov 2021 19:32:35 GMT' +]); + +nock('https://endpoint', {"encodedQueryParams":true}) + .post('/calling/callConnections/4f1f1300-e88f-4307-b278-c0a8b9bcbba3/:playAudio', {"audioFileUri":"https://endpoint/audio/sample-message.wav","loop":true,"operationContext":"operationContext163588155539803449","audioFileId":"audioFileId163588155539809897","callbackUri":"https://endpoint/callback"}) + .query(true) + .reply(202, {"operationId":"3e9d155e-0e7f-46a9-9a29-9eb3ddcbc9a2","status":"running","operationContext":"operationContext163588155539803449"}, [ + 'Content-Length', + '129', + 'Content-Type', + 'application/json; charset=utf-8', + 'X-Microsoft-Skype-Chain-ID', + '435821fb-7594-4d3f-a3b2-01e87bef0758', + 'x-ms-client-request-id', + '70e7fc5a-46ed-4810-b44e-660c5701e0ba', + 'X-Cache', + 'CONFIG_NOCACHE', + 'X-Azure-Ref', + '0XZKBYQAAAAAQ3sODUG78Q4M8Yv5R2Cn1V1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + 'Date', + 'Tue, 02 Nov 2021 19:32:45 GMT' +]); + +nock('https://endpoint', {"encodedQueryParams":true}) + .post('/calling/callConnections/4f1f1300-e88f-4307-b278-c0a8b9bcbba3/:cancelAllMediaOperations') + .query(true) + .reply(200, {"operationId":"4465dd3b-ab2a-4809-a6b6-768b29644972","status":"completed"}, [ + 'Content-Length', + '75', + 'Content-Type', + 'application/json; charset=utf-8', + 'X-Microsoft-Skype-Chain-ID', + '49ba713e-e471-46de-aa07-89fd456873bc', + 'x-ms-client-request-id', + 'e5a5874d-2304-49b1-bdfb-2068e7bdc695', + 'X-Cache', + 'CONFIG_NOCACHE', + 'X-Azure-Ref', + '0XZKBYQAAAAA3Dpayn01MRqPW3l8W7bHKV1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + 'Date', + 'Tue, 02 Nov 2021 19:32:45 GMT' +]); + +nock('https://endpoint', {"encodedQueryParams":true}) + .post('/calling/callConnections/4f1f1300-e88f-4307-b278-c0a8b9bcbba3/:hangup') + .query(true) + .reply(202, "", [ + 'X-Microsoft-Skype-Chain-ID', + '33fbca87-1154-41f0-95d0-93b829c9573e', + 'x-ms-client-request-id', + '6069c56f-aa4e-4050-a4d0-881cc513e34c', + 'X-Cache', + 'CONFIG_NOCACHE', + 'X-Azure-Ref', + '0aJKBYQAAAAA6Z6ERZ0ZrRYN2HDTK0YhGV1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + 'Date', + 'Tue, 02 Nov 2021 19:32:56 GMT', + 'Content-Length', + '0' +]); diff --git a/sdk/communication/communication-callingserver/recordings/node/server_call_live_test_recording_operations/recording_run_all_client_recording_operations.js b/sdk/communication/communication-callingserver/recordings/node/server_call_live_test_recording_operations/recording_run_all_client_recording_operations.js index aab516dfcd94..ec983620ea09 100644 --- a/sdk/communication/communication-callingserver/recordings/node/server_call_live_test_recording_operations/recording_run_all_client_recording_operations.js +++ b/sdk/communication/communication-callingserver/recordings/node/server_call_live_test_recording_operations/recording_run_all_client_recording_operations.js @@ -5,67 +5,67 @@ module.exports.hash = "11ac49147386d3fc94db14f3b0ab509f"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling:join', {"callLocator":{"groupCallId":"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc","kind":"groupCallLocator"},"source":{"communicationUser":{"id":"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_6f8c191d-f701-58b7-a744-35bac2a8f074"}},"callbackUri":"https://bot.contoso.io/callback","requestedMediaTypes":["audio"],"requestedCallEvents":["participantsUpdated"]}) + .post('/calling:join', {"callLocator":{"groupCallId":"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc","kind":"groupCallLocator"},"source":{"communicationUser":{"id":"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_6f8c191d-f701-58b7-a744-35bac2a8f074"}},"callbackUri":"https://endpoint/callback","requestedMediaTypes":["audio"],"requestedCallEvents":["participantsUpdated"]}) .query(true) - .reply(202, {"callConnectionId":"26201300-710b-458f-a68d-0c51579a3569"}, [ + .reply(202, {"callConnectionId":"18201300-1d89-4624-af66-1d9ae49d41ed"}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-ms-client-request-id', - '1bad0e5b-7f92-429a-a87a-334b6778dff8', + '8d880e17-5cb4-45e2-836a-32b0203148d6', 'X-Microsoft-Skype-Chain-ID', - '5efdba4c-ee46-467c-af57-5c3ce574cace', + '82457443-f4e6-4368-9a45-e3eee72ea886', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0/GJoYQAAAAAsNlgem84xS6i37oTlOOYBUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0X5SBYQAAAADg09vsqEupQrlQqHKWEslSV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:03:57 GMT' + 'Tue, 02 Nov 2021 19:41:20 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling:join', {"callLocator":{"groupCallId":"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc","kind":"groupCallLocator"},"source":{"communicationUser":{"id":"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_ff23b678-5b97-564d-b6c4-6bb53068c498"}},"callbackUri":"https://bot.contoso.io/callback","requestedMediaTypes":["audio"],"requestedCallEvents":["participantsUpdated"]}) + .post('/calling:join', {"callLocator":{"groupCallId":"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc","kind":"groupCallLocator"},"source":{"communicationUser":{"id":"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_ff23b678-5b97-564d-b6c4-6bb53068c498"}},"callbackUri":"https://endpoint/callback","requestedMediaTypes":["audio"],"requestedCallEvents":["participantsUpdated"]}) .query(true) - .reply(202, {"callConnectionId":"26201300-e14c-44a9-82bc-6d67a4aea1e9"}, [ + .reply(202, {"callConnectionId":"18201300-b646-49dd-911a-70303cc6df27"}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-ms-client-request-id', - '6d5e4fde-aec7-4d1a-a49c-96c912f8ae75', + '42a5e342-2559-4049-ada5-006773fdeca3', 'X-Microsoft-Skype-Chain-ID', - '018eafe5-173e-4b6f-88ea-f1f3a4965422', + 'a6905978-1ce6-41bb-a468-e249b3e7ca3c', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0/WJoYQAAAAB0m42Y30FiSIQpuPnMQhz9UERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0YZSBYQAAAABDtHpEOQylTbuPq08cVhGJV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:03:58 GMT' + 'Tue, 02 Nov 2021 19:41:21 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling/recordings', {"callLocator":{"groupCallId":"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc", "kind":"groupCallLocator"}, "recordingStateCallbackUri":"https://bot.contoso.io/callback"}) + .post('/calling/recordings', {"callLocator":{"groupCallId":"31fccfc0-d804-5e92-9d9e-900b7b3eb6cc","kind":"groupCallLocator"},"recordingStateCallbackUri":"https://endpoint/callback"}) .query(true) - .reply(200, {"recordingId":"eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyNjIwMTMwMC01NWNhLTQ3NzAtOTc5Yy01MzIwNjA1MjkxZDkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI3ZTg5ZDU0My0yNmY2LTQ4M2YtYTg0MS1kNDkxNTc2MzlkMDMifQ"}, [ + .reply(200, {"recordingId":"eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIxODIwMTMwMC0yMTdlLTRmYTAtOWYzMC01MjFlYWQxZGZkNjEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJjZDcxM2Q1YS05ZDcxLTQ5NDUtYjkwYS03OGJlYTY1MTBhNDQifQ"}, [ 'Content-Length', '180', 'Content-Type', 'application/json; charset=utf-8', 'x-ms-client-request-id', - 'fe698f3e-bb63-41a8-95c8-ac7eafcec5a4', + '33d12f20-3e31-47a7-8b0f-573237971133', 'X-Microsoft-Skype-Chain-ID', - '1643a5d3-6e2f-453c-a036-61a8dc54859c', + '612a0231-72f9-4a33-ab75-d343c8596736', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0/2JoYQAAAADNJBP2ohVtR4/bZalZpx/jUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0YpSBYQAAAADKcR/ZsivLTqND8TwV64s7V1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:05 GMT' + 'Tue, 02 Nov 2021 19:41:26 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .get('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyNjIwMTMwMC01NWNhLTQ3NzAtOTc5Yy01MzIwNjA1MjkxZDkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI3ZTg5ZDU0My0yNmY2LTQ4M2YtYTg0MS1kNDkxNTc2MzlkMDMifQ') + .get('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIxODIwMTMwMC0yMTdlLTRmYTAtOWYzMC01MjFlYWQxZGZkNjEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJjZDcxM2Q1YS05ZDcxLTQ5NDUtYjkwYS03OGJlYTY1MTBhNDQifQ') .query(true) .reply(200, {"recordingState":"active"}, [ 'Content-Length', @@ -73,37 +73,37 @@ nock('https://endpoint', {"encodedQueryParams":true}) 'Content-Type', 'application/json; charset=utf-8', 'X-Microsoft-Skype-Chain-ID', - '99cfa820-5464-41c2-b467-7c30e91d69e8', + '04ea09da-f574-46fd-b1c8-fd8969f40ba9', 'x-ms-client-request-id', - 'de699442-f344-4bc5-9a69-86c4bf6396a9', + '79307aa7-0f59-4aa3-afd7-d35ca5094c2e', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0D2NoYQAAAABRTdPtLg3dRo+JgcQuXW/4UERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0cJSBYQAAAAD2+h4wTQggQpPnN5G1q8rlV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:15 GMT' + 'Tue, 02 Nov 2021 19:41:36 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyNjIwMTMwMC01NWNhLTQ3NzAtOTc5Yy01MzIwNjA1MjkxZDkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI3ZTg5ZDU0My0yNmY2LTQ4M2YtYTg0MS1kNDkxNTc2MzlkMDMifQ/:pause') + .post('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIxODIwMTMwMC0yMTdlLTRmYTAtOWYzMC01MjFlYWQxZGZkNjEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJjZDcxM2Q1YS05ZDcxLTQ5NDUtYjkwYS03OGJlYTY1MTBhNDQifQ/:pause') .query(true) .reply(200, "", [ 'X-Microsoft-Skype-Chain-ID', - 'd048eb5e-2abb-43c9-a497-b5ae2cd3fc2a', + '8a51e4bd-ad06-48e5-818a-125e4877ea27', 'x-ms-client-request-id', - 'd3c251ae-d721-4e26-9ef8-c7cfdad4a3fe', + 'ae80d139-d7dd-4ef7-88fb-446a2ebd8d21', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0D2NoYQAAAACLHwqA2yAqQ7duS83V8gyRUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0cZSBYQAAAAAOJbNz/cULTLNuI2N/5qdiV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:15 GMT', + 'Tue, 02 Nov 2021 19:41:36 GMT', 'Content-Length', '0' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .get('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyNjIwMTMwMC01NWNhLTQ3NzAtOTc5Yy01MzIwNjA1MjkxZDkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI3ZTg5ZDU0My0yNmY2LTQ4M2YtYTg0MS1kNDkxNTc2MzlkMDMifQ') + .get('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIxODIwMTMwMC0yMTdlLTRmYTAtOWYzMC01MjFlYWQxZGZkNjEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJjZDcxM2Q1YS05ZDcxLTQ5NDUtYjkwYS03OGJlYTY1MTBhNDQifQ') .query(true) .reply(200, {"recordingState":"inactive"}, [ 'Content-Length', @@ -111,37 +111,37 @@ nock('https://endpoint', {"encodedQueryParams":true}) 'Content-Type', 'application/json; charset=utf-8', 'X-Microsoft-Skype-Chain-ID', - '20cb67df-cd94-4469-80bf-c239e2ba17db', + '3c73e3dc-2074-4d44-abf4-eae49675a31f', 'x-ms-client-request-id', - 'f932e6bb-91e9-4fef-93ff-b756988e1bd9', + 'a40c513b-5f62-4d39-81a0-ef8721726bfb', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0GmNoYQAAAABZ/XDy+Cf+SI5yrGe6IjZrUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0e5SBYQAAAAC+8xDF0pZaTLcT4hX/ofYOV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:26 GMT' + 'Tue, 02 Nov 2021 19:41:47 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyNjIwMTMwMC01NWNhLTQ3NzAtOTc5Yy01MzIwNjA1MjkxZDkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI3ZTg5ZDU0My0yNmY2LTQ4M2YtYTg0MS1kNDkxNTc2MzlkMDMifQ/:resume') + .post('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIxODIwMTMwMC0yMTdlLTRmYTAtOWYzMC01MjFlYWQxZGZkNjEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJjZDcxM2Q1YS05ZDcxLTQ5NDUtYjkwYS03OGJlYTY1MTBhNDQifQ/:resume') .query(true) .reply(200, "", [ 'X-Microsoft-Skype-Chain-ID', - '46cd1a18-9522-4282-a6d5-3b4b9e0b574b', + 'b206a1d8-558c-4a8e-bfca-46c68b1e59df', 'x-ms-client-request-id', - '272b295f-88c9-4873-bcf2-ddac8ca2b7f6', + 'df4eb977-3821-4813-9120-78f3ed0b6151', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0GmNoYQAAAAAjgPhFdohSRrUMmbg2wrCKUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0e5SBYQAAAAArDV9XJpgeQ6ApYl62sstiV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:26 GMT', + 'Tue, 02 Nov 2021 19:41:47 GMT', 'Content-Length', '0' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .get('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyNjIwMTMwMC01NWNhLTQ3NzAtOTc5Yy01MzIwNjA1MjkxZDkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI3ZTg5ZDU0My0yNmY2LTQ4M2YtYTg0MS1kNDkxNTc2MzlkMDMifQ') + .get('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIxODIwMTMwMC0yMTdlLTRmYTAtOWYzMC01MjFlYWQxZGZkNjEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJjZDcxM2Q1YS05ZDcxLTQ5NDUtYjkwYS03OGJlYTY1MTBhNDQifQ') .query(true) .reply(200, {"recordingState":"active"}, [ 'Content-Length', @@ -149,67 +149,67 @@ nock('https://endpoint', {"encodedQueryParams":true}) 'Content-Type', 'application/json; charset=utf-8', 'X-Microsoft-Skype-Chain-ID', - '6d6f2b48-6b69-4deb-8340-dcef71a2e4ad', + '95029a1c-bffc-4247-8a5d-5e62ee954d97', 'x-ms-client-request-id', - 'ab4d3cd4-7abc-4237-afe6-c84c7a3b98ab', + '3bc2c036-29e6-408d-9424-27e77e9bbe4f', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0JGNoYQAAAAD+unp91bRERrZEV1awtQSdUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0hZSBYQAAAAAOKAxpNrkMSIDeECT4rwwjV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:36 GMT' + 'Tue, 02 Nov 2021 19:41:57 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .delete('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIyNjIwMTMwMC01NWNhLTQ3NzAtOTc5Yy01MzIwNjA1MjkxZDkiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiI3ZTg5ZDU0My0yNmY2LTQ4M2YtYTg0MS1kNDkxNTc2MzlkMDMifQ') + .delete('/calling/recordings/eyJQbGF0Zm9ybUVuZHBvaW50SWQiOiIxODIwMTMwMC0yMTdlLTRmYTAtOWYzMC01MjFlYWQxZGZkNjEiLCJSZXNvdXJjZVNwZWNpZmljSWQiOiJjZDcxM2Q1YS05ZDcxLTQ5NDUtYjkwYS03OGJlYTY1MTBhNDQifQ') .query(true) .reply(200, "", [ 'X-Microsoft-Skype-Chain-ID', - '611596ac-653b-49f2-88ad-9f93bbfe7e15', + 'ac6efd75-32cd-45a1-b1ce-00ee529f714a', 'x-ms-client-request-id', - '2fced4f2-dfb1-4920-912c-00478f6c6de7', + '89455cf2-255d-4dfc-b7df-9d4b327f7b44', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0JGNoYQAAAACXrImDuFBQSbmmivta1uZsUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0hZSBYQAAAAA0x1cYZzPYQJ0QLZamvhdVV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:36 GMT', + 'Tue, 02 Nov 2021 19:41:57 GMT', 'Content-Length', '0' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling/callConnections/26201300-710b-458f-a68d-0c51579a3569/:hangup') + .post('/calling/callConnections/18201300-1d89-4624-af66-1d9ae49d41ed/:hangup') .query(true) .reply(202, "", [ 'X-Microsoft-Skype-Chain-ID', - 'fad877f0-9ab2-43f5-9dc3-721f1dd0dcc9', + '31306d71-62a9-48c3-893a-3fdcd7d0e7dc', 'x-ms-client-request-id', - 'f2610778-c07a-4236-bedf-b365410796c5', + '1e2f6ea0-e05b-4fe3-b39e-b0de4ea29d6c', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0JWNoYQAAAACETS64mYFHRJrgrbLnoI9SUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0hpSBYQAAAADFC3/yN4iVT5JecI4EyBVRV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:36 GMT', + 'Tue, 02 Nov 2021 19:41:57 GMT', 'Content-Length', '0' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling/callConnections/26201300-e14c-44a9-82bc-6d67a4aea1e9/:hangup') + .post('/calling/callConnections/18201300-b646-49dd-911a-70303cc6df27/:hangup') .query(true) .reply(202, "", [ 'X-Microsoft-Skype-Chain-ID', - 'c08fad32-a2e0-460b-96fb-3057788d3c31', + '465dcafc-0832-4baa-a080-7d52e1933617', 'x-ms-client-request-id', - 'b532beb4-0e38-4417-ab68-46bb8a54e199', + 'd850299e-7e51-4ffa-8da0-c3f1f4c279e1', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0JWNoYQAAAAAYeK8dhWeIQ4H9U5ujmj8BUERYMzFFREdFMDIwNgA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=', + '0hpSBYQAAAABnEtJER0Y+Q7WPei0UMNNMV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Thu, 14 Oct 2021 17:04:36 GMT', + 'Tue, 02 Nov 2021 19:41:57 GMT', 'Content-Length', '0' ]); diff --git a/sdk/communication/communication-callingserver/review/communication-callingserver.api.md b/sdk/communication/communication-callingserver/review/communication-callingserver.api.md index 0fa0d6f4709c..48c6356cb04b 100644 --- a/sdk/communication/communication-callingserver/review/communication-callingserver.api.md +++ b/sdk/communication/communication-callingserver/review/communication-callingserver.api.md @@ -17,7 +17,10 @@ import { TokenCredential } from '@azure/core-auth'; import { TransferProgressEvent } from '@azure/core-http'; // @public -export type AddParticipantOptions = OperationOptions; +export interface AddParticipantOptions extends OperationOptions { + alternateCallerId?: string; + operationContext?: string; +} // @public export interface AddParticipantResult { @@ -27,17 +30,13 @@ export interface AddParticipantResult { // @public (undocumented) export interface AddParticipantResultEvent { operationContext?: string; - // Warning: (ae-forgotten-export) The symbol "CallingOperationResultDetails" needs to be exported by the entry point index.d.ts resultInfo?: CallingOperationResultDetails; - // Warning: (ae-forgotten-export) The symbol "CallingOperationStatus" needs to be exported by the entry point index.d.ts status: CallingOperationStatus; } // @public -export class CallConnection { - // Warning: (ae-forgotten-export) The symbol "CallConnections" needs to be exported by the entry point index.d.ts - constructor(callConnectionId: string, callConnectionRestClient: CallConnections); - addParticipant(participant: CommunicationIdentifier, alternateCallerId?: string, operationContext?: string, options?: AddParticipantOptions): Promise; +export interface CallConnection { + addParticipant(participant: CommunicationIdentifier, options?: AddParticipantOptions): Promise; cancelAllMediaOperations(options?: CancelAllMediaOperationsOptions): Promise; cancelParticipantMediaOperation(participant: CommunicationIdentifier, mediaOperationId: string, options?: CancelMediaOperationOptions): Promise; getCallConnectionId(): string; @@ -64,35 +63,41 @@ export type CallConnectionsPlayAudioResponse = PlayAudioResult & { }; }; +// @public +export type CallConnectionState = string; + // @public export interface CallConnectionStateChangedEvent { callConnectionId?: string; - // Warning: (ae-forgotten-export) The symbol "CallConnectionState" needs to be exported by the entry point index.d.ts callConnectionState: CallConnectionState; - // Warning: (ae-forgotten-export) The symbol "CallLocatorModel" needs to be exported by the entry point index.d.ts callLocator?: CallLocatorModel; } // @public export type CallingEventSubscriptionType = string; +// @public +export interface CallingOperationResultDetails { + code: number; + message?: string; + subcode: number; +} + +// @public +export type CallingOperationStatus = string; + // @public export class CallingServerClient { constructor(connectionString: string, options?: CallingServerClientOptions); constructor(endpoint: string, credential: TokenCredential, options?: CallingServerClientOptions); - // Warning: (ae-forgotten-export) The symbol "ServerCallsAddParticipantResponse" needs to be exported by the entry point index.d.ts - addParticipant(callLocator: CallLocator, participant: CommunicationIdentifier, callbackUri: string, alternateCallerId?: string, operationContext?: string, options?: AddParticipantOptions): Promise; + addParticipant(callLocator: CallLocator, participant: CommunicationIdentifier, callbackUri: string, options?: AddParticipantOptions): Promise; cancelMediaOperation(callLocator: CallLocator, mediaOperationId: string, options?: CancelMediaOperationOptions): Promise; cancelParticipantMediaOperation(callLocator: CallLocator, participant: CommunicationIdentifier, mediaOperationId: string, options?: CancelMediaOperationOptions): Promise; createCallConnection(source: CommunicationIdentifier, targets: CommunicationIdentifier[], options: CreateCallConnectionOptions): Promise; delete(deleteUri: string, options?: DeleteOptions): Promise; download(uri: string, offset?: number, options?: DownloadOptions): Promise; getCallConnection(callConnectionId: string): CallConnection; - // Warning: (ae-forgotten-export) The symbol "CallRecordingProperties" needs to be exported by the entry point index.d.ts getRecordingProperties(recordingId: string, options?: GetRecordingPropertiesOptions): Promise; - // Warning: (ae-forgotten-export) The symbol "ContentDownloader" needs to be exported by the entry point index.d.ts - // - // (undocumented) initializeContentDownloader(): ContentDownloader; joinCall(callLocator: CallLocator, source: CommunicationIdentifier, options: JoinCallOptions): Promise; pauseRecording(recordingId: string, options?: PauseRecordingOptions): Promise; @@ -100,7 +105,6 @@ export class CallingServerClient { playAudioToParticipant(callLocator: CallLocator, participant: CommunicationIdentifier, audioFileUri: string, options: PlayAudioToParticipantOptions): Promise; removeParticipant(callLocator: CallLocator, participant: CommunicationIdentifier, options?: RemoveParticipantOptions): Promise; resumeRecording(recordingId: string, options?: ResumeRecordingOptions): Promise; - // Warning: (ae-forgotten-export) The symbol "StartCallRecordingResult" needs to be exported by the entry point index.d.ts startRecording(callLocator: CallLocator, recordingStateCallbackUri: string, options?: StartRecordingOptions): Promise; stopRecording(recordingId: string, options?: StopRecordingOptions): Promise; } @@ -109,6 +113,19 @@ export class CallingServerClient { export interface CallingServerClientOptions extends PipelineOptions { } +// @public +export type CallingServerEventType = string; + +// @public +export enum CallingServerEventTypeValue { + AddParticipantResultEvent = "Microsoft.Communication.AddParticipantResult", + CallConnectionStateChangedEvent = "Microsoft.Communication.CallConnectionStateChanged", + CallRecordingStateChangedEvent = "Microsoft.Communication.CallRecordingStateChanged", + ParticipantsUpdatedEvent = "Microsoft.Communication.ParticipantsUpdated", + PlayAudioResultEvent = "Microsoft.Communication.PlayAudioResult", + ToneReceivedEvent = "Microsoft.Communication.ToneReceived" +} + // @public export type CallLocator = GroupCallLocator | ServerCallLocator; @@ -116,26 +133,35 @@ export type CallLocator = GroupCallLocator | ServerCallLocator; export type CallLocatorKind = GroupCallLocatorKind | ServerCallLocatorKind; // @public -export type CallMediaType = string; +export type CallLocatorKindModel = string; // @public -export type CancelAllMediaOperationsOptions = OperationOptions; +export interface CallLocatorModel { + groupCallId?: string; + kind?: CallLocatorKindModel; + serverCallId?: string; +} // @public -export type CancelMediaOperationOptions = OperationOptions; +export type CallMediaType = string; // @public -export interface CommunicationIdentifierModel { - communicationUser?: CommunicationUserIdentifierModel; - // Warning: (ae-forgotten-export) The symbol "MicrosoftTeamsUserIdentifierModel" needs to be exported by the entry point index.d.ts - microsoftTeamsUser?: MicrosoftTeamsUserIdentifierModel; - phoneNumber?: PhoneNumberIdentifierModel; - rawId?: string; +export interface CallRecordingProperties { + recordingState: CallRecordingState; } // @public -export interface CommunicationUserIdentifierModel { - id: string; +export type CallRecordingState = string; + +// @public +export type CancelAllMediaOperationsOptions = OperationOptions; + +// @public +export type CancelMediaOperationOptions = OperationOptions; + +// @public +export interface ContentDownloader { + downloadContent(contentUri: string, options: DownloadContentOptions): Promise; } // @public @@ -168,15 +194,14 @@ export interface CreateCallConnectionOptions extends OperationOptions { // @public export type DeleteOptions = OperationOptions; -// @public (undocumented) +// @public export interface DownloadContentOptions extends DownloadOptions { range?: string; } -// @public (undocumented) +// @public export interface DownloadOptions extends OperationOptions { abortSignal?: AbortSignalLike; - // (undocumented) count?: number; maxRetryRequests?: number; onProgress?: (progress: TransferProgressEvent) => void; @@ -215,95 +240,10 @@ export interface JoinCallOptions extends OperationOptions { subject?: string; } -// @public -export const enum KnownCallConnectionState { - // (undocumented) - Connected = "connected", - // (undocumented) - Connecting = "connecting", - // (undocumented) - Disconnected = "disconnected", - // (undocumented) - Disconnecting = "disconnecting", - // (undocumented) - TransferAccepted = "transferAccepted", - // (undocumented) - Transferring = "transferring" -} - -// @public (undocumented) -export class KnownCallingServerEventType { - // (undocumented) - static ADD_PARTICIPANT_RESULT_EVENT: string | null; - // (undocumented) - static CALL_CONNECTION_STATE_CHANGED_EVENT: string | null; - // (undocumented) - static CALL_RECORDING_STATE_CHANGED_EVENT: string | null; - // (undocumented) - static fromString(value: string): string | null; - // (undocumented) - static PARTICIPANTS_UPDATED_EVENT: string | null; - // (undocumented) - static PLAY_AUDIO_RESULT_EVENT: string | null; - // (undocumented) - static TONE_RECEIVED_EVENT: string | null; -} - -// @public -export const enum KnownRecordingChannelType { - // (undocumented) - Mixed = "mixed", - // (undocumented) - Unmixed = "unmixed" -} - -// @public -export const enum KnownToneValue { - // (undocumented) - A = "a", - // (undocumented) - B = "b", - // (undocumented) - C = "c", - // (undocumented) - D = "d", - // (undocumented) - Flash = "flash", - // (undocumented) - Pound = "pound", - // (undocumented) - Star = "star", - // (undocumented) - Tone0 = "tone0", - // (undocumented) - Tone1 = "tone1", - // (undocumented) - Tone2 = "tone2", - // (undocumented) - Tone3 = "tone3", - // (undocumented) - Tone4 = "tone4", - // (undocumented) - Tone5 = "tone5", - // (undocumented) - Tone6 = "tone6", - // (undocumented) - Tone7 = "tone7", - // (undocumented) - Tone8 = "tone8", - // (undocumented) - Tone9 = "tone9" -} - // @public export type PauseRecordingOptions = OperationOptions; // @public -export interface PhoneNumberIdentifierModel { - value: string; -} - -// @public (undocumented) export interface PlayAudioOptions extends OperationOptions { audioFileId: string; callbackUri: string; @@ -326,10 +266,10 @@ export interface PlayAudioResultEvent { status: CallingOperationStatus; } -// @public (undocumented) +// @public export type PlayAudioToParticipantOptions = PlayAudioOptions; -// @public (undocumented) +// @public export const range: OperationParameter; // @public @@ -338,6 +278,9 @@ export type RecordingChannelType = string; // @public export type RecordingContentType = string; +// @public +export type RecordingFormatType = string; + // @public export type RemoveParticipantOptions = OperationOptions; @@ -354,25 +297,34 @@ export interface ServerCallLocatorKind extends ServerCallLocator { kind: "serverCall"; } +// @public +export type ServerCallsAddParticipantResponse = AddParticipantResult & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: AddParticipantResult; + }; +}; + +// @public +export interface StartCallRecordingResult { + recordingId?: string; +} + // @public export interface StartRecordingOptions extends OperationOptions { - // (undocumented) - recordingChannelType?: KnownRecordingChannelType; - // (undocumented) + recordingChannelType?: RecordingChannelType; recordingContentType?: RecordingContentType; - // Warning: (ae-forgotten-export) The symbol "RecordingFormatType" needs to be exported by the entry point index.d.ts - // - // (undocumented) recordingFormatType?: RecordingFormatType; } // @public export type StopRecordingOptions = OperationOptions; +export { TokenCredential } + // @public export interface ToneInfo { sequenceId: number; - // Warning: (ae-forgotten-export) The symbol "ToneValue" needs to be exported by the entry point index.d.ts tone: ToneValue; } @@ -382,6 +334,9 @@ export interface ToneReceivedEvent { toneInfo: ToneInfo; } +// @public +export type ToneValue = string; + // @public export type TransferCallOptions = OperationOptions; diff --git a/sdk/communication/communication-callingserver/sample.env b/sdk/communication/communication-callingserver/sample.env index 7a6eb9cadccc..f3784c3cb72e 100644 --- a/sdk/communication/communication-callingserver/sample.env +++ b/sdk/communication/communication-callingserver/sample.env @@ -1,4 +1,4 @@ # Used in most samples. Retrieve these values from a Communication Services resource # in the Azure Portal. -COMMUNICATION_CONNECTION_STRING="endpoint=https://.communication.azure.net/;accessKey=" -COMMUNICATION_ENDPOINT="https://.communication.azure.com" +COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING="endpoint=https://.communication.azure.net/;accessKey=" +COMMUNICATION_LIVETEST_STATIC_RESOURCE_IDENTIFIER="" diff --git a/sdk/communication/communication-callingserver/src/ContentDownloader.ts b/sdk/communication/communication-callingserver/src/ContentDownloader.ts index ea6d2d8cc0af..977b71664717 100644 --- a/sdk/communication/communication-callingserver/src/ContentDownloader.ts +++ b/sdk/communication/communication-callingserver/src/ContentDownloader.ts @@ -20,12 +20,36 @@ import { import { ContentDownloadResponse } from "."; import { CallingServerUtils } from "./utils/utils"; -export class ContentDownloader { +/** + * The ContentDownloader interface represents related APIs. + */ +export interface ContentDownloader { + /** + * Download recording's content. + * @param contentUri - The content Uri. + * @param options - The options parameters. + */ + downloadContent( + contentUri: string, + options: DownloadContentOptions + ): Promise; +} + +/** + * The ContentDownloader contains operations. + */ +export class ContentDownloaderImpl implements ContentDownloader { private readonly client: CallingServerApiClientContext; + constructor(client: CallingServerApiClientContext) { this.client = client; } + /** + * Download recording's content. + * @param contentUri - The content Uri. + * @param options - The options parameters. + */ public async downloadContent( contentUri: string, options: DownloadContentOptions = {} diff --git a/sdk/communication/communication-callingserver/src/callConnection.ts b/sdk/communication/communication-callingserver/src/callConnection.ts index 5922f2eec086..2d6757ce500e 100644 --- a/sdk/communication/communication-callingserver/src/callConnection.ts +++ b/sdk/communication/communication-callingserver/src/callConnection.ts @@ -31,12 +31,104 @@ import { createSpan } from "./tracing"; import { operationOptionsToRequestOptionsBase } from "@azure/core-http"; import { SpanStatusCode } from "@azure/core-tracing"; import { extractOperationOptions } from "./extractOperationOptions"; -import { CallingServerUtils } from "./utils/utils"; + +/** + * A CallConnection interface represents call connection based APIs. + */ +export interface CallConnection { + /** + * Returns the call connection id. + */ + getCallConnectionId(): string; + + /** + * Disconnect the current caller in a group-call or end a p2p-call. + * + * @param options - Additional request options contains hangUp api options. + */ + hangUp(options?: HangUpOptions): Promise; + + /** + * Cancel all media operations in the call. + * + * @param options - Additional request options contains hangUp api options. + */ + cancelAllMediaOperations(options?: CancelAllMediaOperationsOptions): Promise; + + /** + * Play audio. + * + * @param audioFileUri - The id for the media in the AudioFileUri, using which we cache the media resource. + * @param options - Additional request options contains playAudio api options. + */ + playAudio(audioFileUri: string, options: PlayAudioOptions): Promise; + + /** + * Add participant to the call. + * + * @param participant - The identifier of the participant. + * @param options - Additional request options contains addParticipant api options. + */ + addParticipant( + participant: CommunicationIdentifier, + options?: AddParticipantOptions + ): Promise; + + /** + * Remove participant from the call. + * + * @param participant - The identifier of the participant. + * @param options - Additional request options contains removeParticipant api options. + */ + removeParticipant( + participant: CommunicationIdentifier, + options?: RemoveParticipantOptions + ): Promise; + + /** + * Play audio to a participant. + * + * @param participant - The identifier of the participant. + * @param audioFileUri - The id for the media in the AudioFileUri, using which we cache the media resource. + * @param options - Additional request options contains playAudioToParticipant api options. + */ + playAudioToParticipant( + participant: CommunicationIdentifier, + audioFileUri: string, + options: PlayAudioOptions + ): Promise; + + /** + * Cancel media operation of a participant. + * + * @param participant - The identifier of the participant. + * @param mediaOperationId - The operationId of the media operation to cancel. + * @param options - Additional request options contains cancelMediaOperation api options. + */ + cancelParticipantMediaOperation( + participant: CommunicationIdentifier, + mediaOperationId: string, + options?: CancelMediaOperationOptions + ): Promise; + + /** + * Transfer a call. + * + * @param targetParticipant - The identity of the target where call should be transfer to. + * @param userToUserInformation - The user to user information. + * @param options - Additional request options contains transferCall api options. + */ + transferCall( + targetParticipant: CommunicationIdentifier, + userToUserInformation: string, + options?: TransferCallOptions + ): Promise; +} /** * The client to do call connection operations */ -export class CallConnection { +export class CallConnectionImpl implements CallConnection { private readonly callConnectionId: string; private readonly callConnectionRestClient: CallConnections; @@ -81,7 +173,6 @@ export class CallConnection { * * @param options - Additional request options contains hangUp api options. */ - public async cancelAllMediaOperations( options: CancelAllMediaOperationsOptions = {} ): Promise { @@ -129,21 +220,6 @@ export class CallConnection { audioFileId: restOptions.audioFileId, callbackUri: restOptions.callbackUri }; - if (!CallingServerUtils.isValidUrl(audioFileUri)) { - throw new Error("audioFileUri is invalid."); - } - if ( - !( - typeof options.audioFileId !== "undefined" && - options.audioFileId && - options.audioFileId.trim() - ) - ) { - throw new Error("audioFileId is invalid."); - } - if (!CallingServerUtils.isValidUrl(String(options.callbackUri))) { - throw new Error("callbackUri is invalid."); - } try { const { ...result } = await this.callConnectionRestClient.playAudio( this.callConnectionId, @@ -166,26 +242,27 @@ export class CallConnection { * Add participant to the call. * * @param participant - The identifier of the participant. - * @param alternateCallerId - The phone number to use when adding a pstn participant. - * @param operationContext - The operation context. * @param options - Additional request options contains addParticipant api options. */ public async addParticipant( participant: CommunicationIdentifier, - alternateCallerId?: string, - operationContext?: string, options: AddParticipantOptions = {} ): Promise { - const { span, updatedOptions } = createSpan("CallConnectionRestClient-playAudio", options); + const { operationOptions, restOptions } = extractOperationOptions(options); + const { span, updatedOptions } = createSpan( + "CallConnectionRestClient-playAudio", + operationOptions + ); const alternate_caller_id = - typeof alternateCallerId === "undefined" - ? alternateCallerId - : serializeCommunicationIdentifier({ phoneNumber: alternateCallerId }).phoneNumber; + typeof restOptions?.alternateCallerId === "undefined" + ? restOptions?.alternateCallerId + : serializeCommunicationIdentifier({ phoneNumber: restOptions.alternateCallerId }) + .phoneNumber; const request: AddParticipantRequest = { participant: serializeCommunicationIdentifier(participant), alternateCallerId: alternate_caller_id, - operationContext: operationContext + operationContext: restOptions?.operationContext }; try { diff --git a/sdk/communication/communication-callingserver/src/callLocatorModelSerializer.ts b/sdk/communication/communication-callingserver/src/callLocatorModelSerializer.ts index 2c9be6c4e8fd..811e2deda91e 100644 --- a/sdk/communication/communication-callingserver/src/callLocatorModelSerializer.ts +++ b/sdk/communication/communication-callingserver/src/callLocatorModelSerializer.ts @@ -93,9 +93,9 @@ export const serializeCallLocator = (locator: CallLocator): CallLocatorModel => /** * @hidden * Translates the serialized format of a call locator to CallLocator. - * @param serializedCallLocator - The SerializedCommunicationIdentifier to be deserialized. + * @param serializedCallLocator - The SerializedCallLocator to be deserialized. */ -export const deserializeCommunicationIdentifier = ( +export const deserializeCallLocator = ( serializedCallLocator: SerializedCallLocator ): CallLocatorKind => { assertMaximumOneNestedModel(serializedCallLocator); diff --git a/sdk/communication/communication-callingserver/src/callingServerClient.ts b/sdk/communication/communication-callingserver/src/callingServerClient.ts index 80bfd83f7568..a484f9e94f52 100644 --- a/sdk/communication/communication-callingserver/src/callingServerClient.ts +++ b/sdk/communication/communication-callingserver/src/callingServerClient.ts @@ -3,6 +3,7 @@ /// import { CallConnection, ContentDownloadResponse } from "."; +import { CallConnectionImpl } from "./callConnection"; import { CreateCallConnectionOptions, DownloadOptions, @@ -63,7 +64,7 @@ import { CallingServerApiClientContext } from "./generated/src/callingServerApiC import { SDK_VERSION } from "./constants"; import { convertTracingToRequestOptionsBase, createSpan } from "./tracing"; import { logger } from "./logger"; -import { ContentDownloader } from "./ContentDownloader"; +import { ContentDownloader, ContentDownloaderImpl } from "./ContentDownloader"; import { rangeToString } from "./Range"; import { RepeatableContentDownloadResponse } from "./RepeatableContentDownloadResponse"; import { extractOperationOptions } from "./extractOperationOptions"; @@ -151,11 +152,14 @@ export class CallingServerClient { * @param callConnectionId - The CallConnection id for the CallConnection instance. (ex: endpoint=https://REDACTED.communication.azure.com/;accesskey=eyJhbG==). */ public getCallConnection(callConnectionId: string): CallConnection { - return new CallConnection(callConnectionId, this.callConnectionRestClient); + return new CallConnectionImpl(callConnectionId, this.callConnectionRestClient); } + /** + * Initializes a new instance of ContentDownloader. + */ public initializeContentDownloader(): ContentDownloader { - return new ContentDownloader(this.storageApiClient); + return new ContentDownloaderImpl(this.storageApiClient); } /** @@ -171,7 +175,7 @@ export class CallingServerClient { ): Promise { const { operationOptions, restOptions } = extractOperationOptions(options); const { span, updatedOptions } = createSpan( - "CallConnectionRestClient-CreateCallConnection", + "CallConnectionRestClient-CreateCallOptions", operationOptions ); @@ -195,7 +199,7 @@ export class CallingServerClient { ); if (result.callConnectionId) { - return new CallConnection(result.callConnectionId, this.callConnectionRestClient); + return new CallConnectionImpl(result.callConnectionId, this.callConnectionRestClient); } throw "callConnectionId is missing in createCall result"; } catch (e) { @@ -240,7 +244,7 @@ export class CallingServerClient { ); if (result.callConnectionId) { - return new CallConnection(result.callConnectionId, this.callConnectionRestClient); + return new CallConnectionImpl(result.callConnectionId, this.callConnectionRestClient); } else { throw "callConnectionId is missing in joinCall result"; } @@ -269,26 +273,7 @@ export class CallingServerClient { ): Promise { const { operationOptions, restOptions } = extractOperationOptions(options); const { span, updatedOptions } = createSpan("ServerCallRestClient-playAudio", operationOptions); - if (!CallingServerUtils.isValidUrl(audioFileUri)) { - throw new Error("audioFileUri is invalid."); - } - if ( - typeof options.audioFileId === "undefined" || - !options.audioFileId || - !options.audioFileId.trim() - ) { - throw new Error("audioFileId is invalid."); - } - if (!CallingServerUtils.isValidUrl(String(options.callbackUri))) { - throw new Error("callbackUri is invalid."); - } - if ( - typeof options.operationContext === "undefined" || - !options.operationContext || - !options.operationContext.trim() - ) { - throw new Error("operationContext can not be null."); - } + const request: PlayAudioWithCallLocatorRequest = { callLocator: callLocator, audioFileUri: audioFileUri, @@ -365,29 +350,27 @@ export class CallingServerClient { * @param callLocator - The callLocator contains call id. * @param participant - The identifier of the participant. * @param callbackUri - The callback uri to receive the notification. - * @param alternateCallerId - The phone number to use when adding a pstn participant. - * @param operationContext - The operation context. * @param options - Additional request options contains addParticipant api options. */ public async addParticipant( callLocator: CallLocator, participant: CommunicationIdentifier, callbackUri: string, - alternateCallerId?: string, - operationContext?: string, options: AddParticipantOptions = {} ): Promise { - const { span, updatedOptions } = createSpan("ServerCallRestClient-playAudio", options); + const { operationOptions, restOptions } = extractOperationOptions(options); + const { span, updatedOptions } = createSpan("ServerCallRestClient-playAudio", operationOptions); const alternate_caller_id = - typeof alternateCallerId === "undefined" - ? alternateCallerId - : serializeCommunicationIdentifier({ phoneNumber: alternateCallerId }).phoneNumber; + typeof restOptions?.alternateCallerId === "undefined" + ? restOptions?.alternateCallerId + : serializeCommunicationIdentifier({ phoneNumber: restOptions.alternateCallerId }) + .phoneNumber; const request: AddParticipantWithCallLocatorRequest = { callLocator: callLocator, participant: serializeCommunicationIdentifier(participant), alternateCallerId: alternate_caller_id, - operationContext: operationContext, + operationContext: restOptions?.operationContext, callbackUri: callbackUri }; diff --git a/sdk/communication/communication-callingserver/src/generated/src/models/index.ts b/sdk/communication/communication-callingserver/src/generated/src/models/index.ts index 1b3f0041c13a..07439f44762b 100644 --- a/sdk/communication/communication-callingserver/src/generated/src/models/index.ts +++ b/sdk/communication/communication-callingserver/src/generated/src/models/index.ts @@ -189,12 +189,24 @@ export interface TransferCallRequest { targetParticipant?: CommunicationIdentifierModel; /** The call connection id to replace the current call with. This parameter should be used for consultative transfer. */ targetCallConnectionId?: string; + /** The alternate identity of the transferor if transferring to a pstn number. */ + alternateCallerId?: PhoneNumberIdentifierModel; /** The user to user information. */ userToUserInformation?: string; /** The operation context. */ operationContext?: string; - /** The callback URI. */ - callbackUri?: string; +} + +/** The response payload for transfer call operation. */ +export interface TransferCallResult { + /** The operation id. */ + operationId?: string; + /** The status of the operation */ + status: CallingOperationStatus; + /** The operation context provided by client. */ + operationContext?: string; + /** The result info for the operation. */ + resultInfo?: CallingOperationResultDetails; } /** The audio routing group request. */ @@ -234,7 +246,7 @@ export interface AddParticipantWithCallLocatorRequest { /** The alternate identity of source participant. */ alternateCallerId?: PhoneNumberIdentifierModel; /** The participant to be added to the call. */ - participant?: CommunicationIdentifierModel; + participant: CommunicationIdentifierModel; /** The operation context. */ operationContext?: string; /** The callback URI. */ @@ -292,48 +304,16 @@ export interface CancelParticipantMediaOperationWithCallLocatorRequest { callLocator: CallLocatorModel; /** The identifier of the participant. */ identifier: CommunicationIdentifierModel; - /** The operationId of the media operation to cancel */ + /** The operationId of the media operation to cancel. */ mediaOperationId: string; } -/** The request payload for muting any participant using call locator. */ -export interface MuteParticipantWithCallLocatorRequest { - /** The call locator. */ - callLocator: CallLocatorModel; - /** The identifier of the participant to be muted in the call. */ - identifier: CommunicationIdentifierModel; -} - -/** The request payload for unmuting any participant */ -export interface UnmuteParticipantWithCallLocatorRequest { - /** The call locator. */ - callLocator: CallLocatorModel; - /** The identifier of the participant to be unmuted in the call. */ - identifier: CommunicationIdentifierModel; -} - -/** The request payload for holding meeting audio for a participant. */ -export interface HoldMeetingAudioWithCallLocatorRequest { - /** The call locator. */ - callLocator: CallLocatorModel; - /** The identifier of the participant. */ - identifier: CommunicationIdentifierModel; -} - -/** The request payload for resuming meeting audio for a participant. */ -export interface ResumeMeetingAudioWithCallLocatorRequest { - /** The call locator. */ - callLocator: CallLocatorModel; - /** The identifier of the participant. */ - identifier: CommunicationIdentifierModel; -} - /** The add participant request. */ export interface AddParticipantRequest { /** The alternate identity of source participant. */ alternateCallerId?: PhoneNumberIdentifierModel; /** The participant to be added to the call. */ - participant?: CommunicationIdentifierModel; + participant: CommunicationIdentifierModel; /** The operation context. */ operationContext?: string; /** The callback URI. */ @@ -377,7 +357,7 @@ export interface PlayAudioToParticipantRequest { export interface CancelParticipantMediaOperationRequest { /** The identifier of the participant. */ identifier: CommunicationIdentifierModel; - /** The operationId of the media operation to cancel */ + /** The operationId of the media operation to cancel. */ mediaOperationId: string; } @@ -385,12 +365,16 @@ export interface CancelParticipantMediaOperationRequest { export interface MuteParticipantRequest { /** The identifier of the participant to be muted in the call. */ identifier: CommunicationIdentifierModel; + /** The operation context. */ + operationContext?: string; } /** The request payload for unmuting any participant */ export interface UnmuteParticipantRequest { /** The identifier of the participant to be unmuted in the call. */ identifier: CommunicationIdentifierModel; + /** The operation context. */ + operationContext?: string; } /** The request payload for holding meeting audio for a participant. */ @@ -411,11 +395,11 @@ export interface StartCallRecordingWithCallLocatorRequest { callLocator: CallLocatorModel; /** The uri to send notifications to. */ recordingStateCallbackUri?: string; - /** Content type of call recording. */ + /** The content type of call recording. */ recordingContentType?: RecordingContentType; - /** Channel type of call recording. */ + /** The channel type of call recording. */ recordingChannelType?: RecordingChannelType; - /** Format type of call recording. */ + /** The format type of call recording. */ recordingFormatType?: RecordingFormatType; } @@ -485,9 +469,9 @@ export interface CancelMediaOperationWithCallLocatorRequest { /** The request payload for answering the call. */ export interface AnswerCallRequest { /** The context associated with the call. */ - incomingCallContext?: string; + incomingCallContext: string; /** The callback uri. */ - callbackUri: string; + callbackUri?: string; /** The requested modalities. */ requestedMediaTypes?: CallMediaType[]; /** The requested call events to subscribe to. */ @@ -587,6 +571,16 @@ export interface ToneInfo { tone: ToneValue; } +/** The transfer call result event. */ +export interface TransferCallResultEvent { + /** The result details. */ + resultInfo?: CallingOperationResultDetails; + /** The operation context. */ + operationContext?: string; + /** The status of the operation */ + status: CallingOperationStatus; +} + /** Known values of {@link AudioRoutingMode} that the service accepts. */ export const enum KnownAudioRoutingMode { OneToOne = "oneToOne", @@ -891,6 +885,18 @@ export type CallConnectionsPlayAudioResponse = PlayAudioResult & { }; }; +/** Contains response data for the transfer operation. */ +export type CallConnectionsTransferResponse = TransferCallResult & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: TransferCallResult; + }; +}; + /** Contains response data for the createAudioRoutingGroup operation. */ export type CallConnectionsCreateAudioRoutingGroupResponse = CreateAudioRoutingGroupResult & { /** The underlying HTTP response. */ diff --git a/sdk/communication/communication-callingserver/src/generated/src/models/mappers.ts b/sdk/communication/communication-callingserver/src/generated/src/models/mappers.ts index a81a6a563cb4..2ae4dd5859a7 100644 --- a/sdk/communication/communication-callingserver/src/generated/src/models/mappers.ts +++ b/sdk/communication/communication-callingserver/src/generated/src/models/mappers.ts @@ -543,6 +543,13 @@ export const TransferCallRequest: coreHttp.CompositeMapper = { name: "String" } }, + alternateCallerId: { + serializedName: "alternateCallerId", + type: { + name: "Composite", + className: "PhoneNumberIdentifierModel" + } + }, userToUserInformation: { serializedName: "userToUserInformation", type: { @@ -554,12 +561,41 @@ export const TransferCallRequest: coreHttp.CompositeMapper = { type: { name: "String" } + } + } + } +}; + +export const TransferCallResult: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TransferCallResult", + modelProperties: { + operationId: { + serializedName: "operationId", + type: { + name: "String" + } }, - callbackUri: { - serializedName: "callbackUri", + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + operationContext: { + serializedName: "operationContext", type: { name: "String" } + }, + resultInfo: { + serializedName: "resultInfo", + type: { + name: "Composite", + className: "CallingOperationResultDetails" + } } } } @@ -842,98 +878,6 @@ export const CancelParticipantMediaOperationWithCallLocatorRequest: coreHttp.Com } }; -export const MuteParticipantWithCallLocatorRequest: coreHttp.CompositeMapper = { - type: { - name: "Composite", - className: "MuteParticipantWithCallLocatorRequest", - modelProperties: { - callLocator: { - serializedName: "callLocator", - type: { - name: "Composite", - className: "CallLocatorModel" - } - }, - identifier: { - serializedName: "identifier", - type: { - name: "Composite", - className: "CommunicationIdentifierModel" - } - } - } - } -}; - -export const UnmuteParticipantWithCallLocatorRequest: coreHttp.CompositeMapper = { - type: { - name: "Composite", - className: "UnmuteParticipantWithCallLocatorRequest", - modelProperties: { - callLocator: { - serializedName: "callLocator", - type: { - name: "Composite", - className: "CallLocatorModel" - } - }, - identifier: { - serializedName: "identifier", - type: { - name: "Composite", - className: "CommunicationIdentifierModel" - } - } - } - } -}; - -export const HoldMeetingAudioWithCallLocatorRequest: coreHttp.CompositeMapper = { - type: { - name: "Composite", - className: "HoldMeetingAudioWithCallLocatorRequest", - modelProperties: { - callLocator: { - serializedName: "callLocator", - type: { - name: "Composite", - className: "CallLocatorModel" - } - }, - identifier: { - serializedName: "identifier", - type: { - name: "Composite", - className: "CommunicationIdentifierModel" - } - } - } - } -}; - -export const ResumeMeetingAudioWithCallLocatorRequest: coreHttp.CompositeMapper = { - type: { - name: "Composite", - className: "ResumeMeetingAudioWithCallLocatorRequest", - modelProperties: { - callLocator: { - serializedName: "callLocator", - type: { - name: "Composite", - className: "CallLocatorModel" - } - }, - identifier: { - serializedName: "identifier", - type: { - name: "Composite", - className: "CommunicationIdentifierModel" - } - } - } - } -}; - export const AddParticipantRequest: coreHttp.CompositeMapper = { type: { name: "Composite", @@ -1083,6 +1027,12 @@ export const MuteParticipantRequest: coreHttp.CompositeMapper = { name: "Composite", className: "CommunicationIdentifierModel" } + }, + operationContext: { + serializedName: "operationContext", + type: { + name: "String" + } } } } @@ -1099,6 +1049,12 @@ export const UnmuteParticipantRequest: coreHttp.CompositeMapper = { name: "Composite", className: "CommunicationIdentifierModel" } + }, + operationContext: { + serializedName: "operationContext", + type: { + name: "String" + } } } } @@ -1358,13 +1314,13 @@ export const AnswerCallRequest: coreHttp.CompositeMapper = { modelProperties: { incomingCallContext: { serializedName: "incomingCallContext", + required: true, type: { name: "String" } }, callbackUri: { serializedName: "callbackUri", - required: true, type: { name: "String" } @@ -1673,3 +1629,32 @@ export const ToneInfo: coreHttp.CompositeMapper = { } } }; + +export const TransferCallResultEvent: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TransferCallResultEvent", + modelProperties: { + resultInfo: { + serializedName: "resultInfo", + type: { + name: "Composite", + className: "CallingOperationResultDetails" + } + }, + operationContext: { + serializedName: "operationContext", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/communication/communication-callingserver/src/generated/src/models/parameters.ts b/sdk/communication/communication-callingserver/src/generated/src/models/parameters.ts index 4ca2f8cb9875..e6e750b1c622 100644 --- a/sdk/communication/communication-callingserver/src/generated/src/models/parameters.ts +++ b/sdk/communication/communication-callingserver/src/generated/src/models/parameters.ts @@ -32,10 +32,6 @@ import { GetParticipantWithCallLocatorRequest as GetParticipantWithCallLocatorRequestMapper, PlayAudioToParticipantWithCallLocatorRequest as PlayAudioToParticipantWithCallLocatorRequestMapper, CancelParticipantMediaOperationWithCallLocatorRequest as CancelParticipantMediaOperationWithCallLocatorRequestMapper, - MuteParticipantWithCallLocatorRequest as MuteParticipantWithCallLocatorRequestMapper, - UnmuteParticipantWithCallLocatorRequest as UnmuteParticipantWithCallLocatorRequestMapper, - HoldMeetingAudioWithCallLocatorRequest as HoldMeetingAudioWithCallLocatorRequestMapper, - ResumeMeetingAudioWithCallLocatorRequest as ResumeMeetingAudioWithCallLocatorRequestMapper, StartCallRecordingWithCallLocatorRequest as StartCallRecordingWithCallLocatorRequestMapper, JoinCallRequest as JoinCallRequestMapper, PlayAudioWithCallLocatorRequest as PlayAudioWithCallLocatorRequestMapper, @@ -125,8 +121,8 @@ export const callRequest: OperationParameter = { mapper: CreateCallRequestMapper }; -export const request: OperationParameter = { - parameterPath: "request", +export const playAudioRequest: OperationParameter = { + parameterPath: "playAudioRequest", mapper: PlayAudioRequestMapper }; @@ -215,26 +211,6 @@ export const cancelParticipantMediaOperationRequest: OperationParameter = { mapper: CancelParticipantMediaOperationWithCallLocatorRequestMapper }; -export const muteParticipantWithCallLocatorRequest: OperationParameter = { - parameterPath: "muteParticipantWithCallLocatorRequest", - mapper: MuteParticipantWithCallLocatorRequestMapper -}; - -export const unmuteParticipantWithCallLocatorRequest: OperationParameter = { - parameterPath: "unmuteParticipantWithCallLocatorRequest", - mapper: UnmuteParticipantWithCallLocatorRequestMapper -}; - -export const holdMeetingAudioWithCallLocatorRequest: OperationParameter = { - parameterPath: "holdMeetingAudioWithCallLocatorRequest", - mapper: HoldMeetingAudioWithCallLocatorRequestMapper -}; - -export const resumeMeetingAudioWithCallLocatorRequest: OperationParameter = { - parameterPath: "resumeMeetingAudioWithCallLocatorRequest", - mapper: ResumeMeetingAudioWithCallLocatorRequestMapper -}; - export const startCallRecordingWithCallLocatorRequest: OperationParameter = { parameterPath: "startCallRecordingWithCallLocatorRequest", mapper: StartCallRecordingWithCallLocatorRequestMapper @@ -256,7 +232,7 @@ export const callRequest1: OperationParameter = { mapper: JoinCallRequestMapper }; -export const playAudioRequest: OperationParameter = { +export const playAudioRequest1: OperationParameter = { parameterPath: "playAudioRequest", mapper: PlayAudioWithCallLocatorRequestMapper }; diff --git a/sdk/communication/communication-callingserver/src/generated/src/operations/callConnections.ts b/sdk/communication/communication-callingserver/src/generated/src/operations/callConnections.ts index 01a972fa21dc..a51911cb4adb 100644 --- a/sdk/communication/communication-callingserver/src/generated/src/operations/callConnections.ts +++ b/sdk/communication/communication-callingserver/src/generated/src/operations/callConnections.ts @@ -19,6 +19,7 @@ import { PlayAudioRequest, CallConnectionsPlayAudioResponse, TransferCallRequest, + CallConnectionsTransferResponse, AudioRoutingGroupRequest, CallConnectionsCreateAudioRoutingGroupResponse, CallConnectionsGetParticipantsResponse, @@ -196,17 +197,17 @@ export class CallConnections { /** * Play audio in the call. * @param callConnectionId The call connection id. - * @param request Play audio request. + * @param playAudioRequest The play audio request. * @param options The options parameters. */ playAudio( callConnectionId: string, - request: PlayAudioRequest, + playAudioRequest: PlayAudioRequest, options?: coreHttp.OperationOptions ): Promise { const operationArguments: coreHttp.OperationArguments = { callConnectionId, - request, + playAudioRequest, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; return this.client.sendOperationRequest( @@ -263,7 +264,7 @@ export class CallConnections { callConnectionId: string, transferCallRequest: TransferCallRequest, options?: coreHttp.OperationOptions - ): Promise { + ): Promise { const operationArguments: coreHttp.OperationArguments = { callConnectionId, transferCallRequest, @@ -272,7 +273,7 @@ export class CallConnections { return this.client.sendOperationRequest( operationArguments, transferOperationSpec - ) as Promise; + ) as Promise; } /** @@ -783,7 +784,7 @@ const playAudioOperationSpec: coreHttp.OperationSpec = { isError: true } }, - requestBody: Parameters.request, + requestBody: Parameters.playAudioRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint, Parameters.callConnectionId], headerParameters: [Parameters.accept, Parameters.contentType], @@ -856,7 +857,9 @@ const transferOperationSpec: coreHttp.OperationSpec = { path: "/calling/callConnections/{callConnectionId}/:transfer", httpMethod: "POST", responses: { - 202: {}, + 202: { + bodyMapper: Mappers.TransferCallResult + }, 400: { bodyMapper: Mappers.CommunicationErrorResponse, isError: true diff --git a/sdk/communication/communication-callingserver/src/generated/src/operations/serverCalls.ts b/sdk/communication/communication-callingserver/src/generated/src/operations/serverCalls.ts index 1d6a6ceabfc6..ba3d6ba75d7f 100644 --- a/sdk/communication/communication-callingserver/src/generated/src/operations/serverCalls.ts +++ b/sdk/communication/communication-callingserver/src/generated/src/operations/serverCalls.ts @@ -21,10 +21,6 @@ import { PlayAudioToParticipantWithCallLocatorRequest, ServerCallsParticipantPlayAudioResponse, CancelParticipantMediaOperationWithCallLocatorRequest, - MuteParticipantWithCallLocatorRequest, - UnmuteParticipantWithCallLocatorRequest, - HoldMeetingAudioWithCallLocatorRequest, - ResumeMeetingAudioWithCallLocatorRequest, StartCallRecordingWithCallLocatorRequest, ServerCallsStartRecordingResponse, ServerCallsGetRecordingPropertiesResponse, @@ -167,85 +163,6 @@ export class ServerCalls { ) as Promise; } - /** - * Mute participant in the call - * @param muteParticipantWithCallLocatorRequest The identifier of the participant to mute in the call. - * @param options The options parameters. - */ - muteParticipant( - muteParticipantWithCallLocatorRequest: MuteParticipantWithCallLocatorRequest, - options?: coreHttp.OperationOptions - ): Promise { - const operationArguments: coreHttp.OperationArguments = { - muteParticipantWithCallLocatorRequest, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest( - operationArguments, - muteParticipantOperationSpec - ) as Promise; - } - - /** - * Unmute participant in the call - * @param unmuteParticipantWithCallLocatorRequest The identifier of the participant to unmute in the - * call. - * @param options The options parameters. - */ - unmuteParticipant( - unmuteParticipantWithCallLocatorRequest: UnmuteParticipantWithCallLocatorRequest, - options?: coreHttp.OperationOptions - ): Promise { - const operationArguments: coreHttp.OperationArguments = { - unmuteParticipantWithCallLocatorRequest, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest( - operationArguments, - unmuteParticipantOperationSpec - ) as Promise; - } - - /** - * Hold meeting audio of a participant in the call. - * @param holdMeetingAudioWithCallLocatorRequest The request payload for holding meeting audio for a - * participant. - * @param options The options parameters. - */ - holdParticipantMeetingAudio( - holdMeetingAudioWithCallLocatorRequest: HoldMeetingAudioWithCallLocatorRequest, - options?: coreHttp.OperationOptions - ): Promise { - const operationArguments: coreHttp.OperationArguments = { - holdMeetingAudioWithCallLocatorRequest, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest( - operationArguments, - holdParticipantMeetingAudioOperationSpec - ) as Promise; - } - - /** - * Resume meeting audio of a participant in the call. - * @param resumeMeetingAudioWithCallLocatorRequest The request payload for resuming meeting audio for a - * participant. - * @param options The options parameters. - */ - resumeParticipantMeetingAudio( - resumeMeetingAudioWithCallLocatorRequest: ResumeMeetingAudioWithCallLocatorRequest, - options?: coreHttp.OperationOptions - ): Promise { - const operationArguments: coreHttp.OperationArguments = { - resumeMeetingAudioWithCallLocatorRequest, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; - return this.client.sendOperationRequest( - operationArguments, - resumeParticipantMeetingAudioOperationSpec - ) as Promise; - } - /** * Start recording the call. * @param startCallRecordingWithCallLocatorRequest The request body of start call recording request. @@ -674,138 +591,6 @@ const cancelParticipantMediaOperationOperationSpec: coreHttp.OperationSpec = { mediaType: "json", serializer }; -const muteParticipantOperationSpec: coreHttp.OperationSpec = { - path: "/calling/participants:mute", - httpMethod: "POST", - responses: { - 200: {}, - 400: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 401: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 403: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 404: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 500: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - } - }, - requestBody: Parameters.muteParticipantWithCallLocatorRequest, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.endpoint], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const unmuteParticipantOperationSpec: coreHttp.OperationSpec = { - path: "/calling/participants:unmute", - httpMethod: "POST", - responses: { - 200: {}, - 400: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 401: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 403: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 404: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 500: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - } - }, - requestBody: Parameters.unmuteParticipantWithCallLocatorRequest, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.endpoint], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const holdParticipantMeetingAudioOperationSpec: coreHttp.OperationSpec = { - path: "/calling/participants:holdMeetingAudio", - httpMethod: "POST", - responses: { - 200: {}, - 400: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 401: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 403: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 404: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 500: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - } - }, - requestBody: Parameters.holdMeetingAudioWithCallLocatorRequest, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.endpoint], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; -const resumeParticipantMeetingAudioOperationSpec: coreHttp.OperationSpec = { - path: "/calling/participants:resumeMeetingAudio", - httpMethod: "POST", - responses: { - 200: {}, - 400: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 401: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 403: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 404: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - }, - 500: { - bodyMapper: Mappers.CommunicationErrorResponse, - isError: true - } - }, - requestBody: Parameters.resumeMeetingAudioWithCallLocatorRequest, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.endpoint], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer -}; const startRecordingOperationSpec: coreHttp.OperationSpec = { path: "/calling/recordings", httpMethod: "POST", @@ -1026,7 +811,7 @@ const playAudioOperationSpec: coreHttp.OperationSpec = { isError: true } }, - requestBody: Parameters.playAudioRequest, + requestBody: Parameters.playAudioRequest1, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.endpoint], headerParameters: [Parameters.accept, Parameters.contentType], diff --git a/sdk/communication/communication-callingserver/src/index.ts b/sdk/communication/communication-callingserver/src/index.ts index 8bb84511f531..9be21d326c17 100644 --- a/sdk/communication/communication-callingserver/src/index.ts +++ b/sdk/communication/communication-callingserver/src/index.ts @@ -5,7 +5,9 @@ import { HttpResponse } from "@azure/core-http"; export * from "./models"; export * from "./parameters"; export * from "./callingServerClient"; -export * from "./callConnection"; +export { CallConnection } from "./callConnection"; +export { ContentDownloader } from "./ContentDownloader"; +export { TokenCredential } from "@azure/core-auth"; /** Defines headers for Content download operation. */ export interface ContentDownloadHeaders { diff --git a/sdk/communication/communication-callingserver/src/models.ts b/sdk/communication/communication-callingserver/src/models.ts index 04630834e3f6..bdeb4e0cdf82 100644 --- a/sdk/communication/communication-callingserver/src/models.ts +++ b/sdk/communication/communication-callingserver/src/models.ts @@ -8,30 +8,35 @@ import { CallMediaType, CallingEventSubscriptionType, RecordingContentType, - KnownRecordingChannelType, + RecordingChannelType, RecordingFormatType } from "./generated/src/"; export { + CallLocatorKindModel, + CallLocatorModel, CallMediaType, + CallConnectionState, + CallRecordingState, CallingEventSubscriptionType, + CallingOperationStatus, + CallingOperationResultDetails, + CallRecordingProperties, PlayAudioResult, PlayAudioResultEvent, AddParticipantResult, + StartCallRecordingResult, ToneReceivedEvent, AddParticipantResultEvent, CallConnectionStateChangedEvent, + ToneValue, ToneInfo, + ServerCallsAddParticipantResponse, CallConnectionsAddParticipantResponse, CallConnectionsPlayAudioResponse, - PhoneNumberIdentifierModel, - RecordingChannelType, RecordingContentType, - CommunicationIdentifierModel, - CommunicationUserIdentifierModel, - KnownToneValue, - KnownCallConnectionState, - KnownRecordingChannelType + RecordingChannelType, + RecordingFormatType } from "./generated/src/models"; /** @@ -64,6 +69,9 @@ export interface JoinCallOptions extends OperationOptions { requestedCallEvents?: CallingEventSubscriptionType[]; } +/** + * Options to play audio. + */ export interface PlayAudioOptions extends OperationOptions { /** The flag indicating whether audio file needs to be played in loop or not. */ loop: boolean; @@ -75,12 +83,20 @@ export interface PlayAudioOptions extends OperationOptions { callbackUri: string; } +/** + * Options to play audio to participant. + */ export type PlayAudioToParticipantOptions = PlayAudioOptions; /** * Options to add participant to the call. */ -export type AddParticipantOptions = OperationOptions; +export interface AddParticipantOptions extends OperationOptions { + /** The phone number to use when adding a pstn participant. */ + alternateCallerId?: string; + /** The operation context. */ + operationContext?: string; +} /** * Options to remove participant from the call. @@ -111,8 +127,13 @@ export type TransferCallOptions = OperationOptions; * Options to start recording. */ export interface StartRecordingOptions extends OperationOptions { + /** The content type of call recording. */ recordingContentType?: RecordingContentType; - recordingChannelType?: KnownRecordingChannelType; + + /** The channel type of call recording. */ + recordingChannelType?: RecordingChannelType; + + /** The format type of call recording. */ recordingFormatType?: RecordingFormatType; } /** @@ -219,27 +240,7 @@ export const getLocatorKind = (locator: CallLocator): CallLocatorKind => { throw "unknow CallLocator type."; }; -/** Defines values for CallingServerEventType. */ -enum CallingServerEventType { - /** The call connection state change event type. */ - CALL_CONNECTION_STATE_CHANGED_EVENT = "Microsoft.Communication.CallConnectionStateChanged", - - /** The add participant result event type. */ - ADD_PARTICIPANT_RESULT_EVENT = "Microsoft.Communication.AddParticipantResult", - - /** The call recording state change event type. */ - CALL_RECORDING_STATE_CHANGED_EVENT = "Microsoft.Communication.CallRecordingStateChanged", - - /** The play audio result event type. */ - PLAY_AUDIO_RESULT_EVENT = "Microsoft.Communication.PlayAudioResult", - - /** The participants updated event type. */ - PARTICIPANTS_UPDATED_EVENT = "Microsoft.Communication.ParticipantsUpdated", - - /** The subscribe to tone event type. */ - TONE_RECEIVED_EVENT = "Microsoft.Communication.ToneReceived" -} - +/** The options parameters for download api. */ export interface DownloadOptions extends OperationOptions { /** * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation. @@ -265,45 +266,51 @@ export interface DownloadOptions extends OperationOptions { */ maxRetryRequests?: number; + /** + * Optional. + * + * How much data to be downloaded, greater than 0. Will download to the end when undefined + */ count?: number; } +/** The options parameters for downloadContent api. */ export interface DownloadContentOptions extends DownloadOptions { /** Return only the bytes of the blob in the specified range. */ range?: string; } -export class KnownCallingServerEventType { - public static CALL_CONNECTION_STATE_CHANGED_EVENT: - | string - | null = KnownCallingServerEventType.fromString( - "Microsoft.Communication.CallConnectionStateChanged" - ); - public static ADD_PARTICIPANT_RESULT_EVENT: - | string - | null = KnownCallingServerEventType.fromString("Microsoft.Communication.AddParticipantResult"); - public static CALL_RECORDING_STATE_CHANGED_EVENT: - | string - | null = KnownCallingServerEventType.fromString( - "Microsoft.Communication.CallRecordingStateChanged" - ); - public static PLAY_AUDIO_RESULT_EVENT: string | null = KnownCallingServerEventType.fromString( - "Microsoft.Communication.PlayAudioResult" - ); - public static PARTICIPANTS_UPDATED_EVENT: string | null = KnownCallingServerEventType.fromString( - "Microsoft.Communication.ParticipantsUpdated" - ); - public static TONE_RECEIVED_EVENT: string | null = KnownCallingServerEventType.fromString( - "Microsoft.Communication.ToneReceived" - ); - - public static fromString(value: string): string | null { - const allEvents = Object.values(CallingServerEventType); - for (const entry of allEvents) { - if (entry.toString().toUpperCase() === value.toUpperCase()) { - return value; - } - } - return null; - } +/** Values of {@link CallingServerEventType} that the service accepts. */ +export enum CallingServerEventTypeValue { + /** The call connection state change event type. */ + CallConnectionStateChangedEvent = "Microsoft.Communication.CallConnectionStateChanged", + + /** The add participant result event type. */ + AddParticipantResultEvent = "Microsoft.Communication.AddParticipantResult", + + /** The call recording state change event type. */ + CallRecordingStateChangedEvent = "Microsoft.Communication.CallRecordingStateChanged", + + /** The play audio result event type. */ + PlayAudioResultEvent = "Microsoft.Communication.PlayAudioResult", + + /** The participants updated event type. */ + ParticipantsUpdatedEvent = "Microsoft.Communication.ParticipantsUpdated", + + /** The subscribe to tone event type. */ + ToneReceivedEvent = "Microsoft.Communication.ToneReceived" } + +/** + * Defines values for CallingServerEventType. + * {@link CallingServerEventTypeValue} can be used interchangeably with CallingServerEventType, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **Microsoft.Communication.CallConnectionStateChanged** + * **Microsoft.Communication.AddParticipantResult** + * **Microsoft.Communication.CallRecordingStateChanged** + * **Microsoft.Communication.PlayAudioResult** + * **Microsoft.Communication.ParticipantsUpdated** + * **Microsoft.Communication.ToneReceived** + */ +export type CallingServerEventType = string; diff --git a/sdk/communication/communication-callingserver/src/parameters.ts b/sdk/communication/communication-callingserver/src/parameters.ts index f013ce2059a3..3b33579d2c0e 100644 --- a/sdk/communication/communication-callingserver/src/parameters.ts +++ b/sdk/communication/communication-callingserver/src/parameters.ts @@ -9,6 +9,7 @@ import { OperationParameter } from "@azure/core-http"; +/** Specified range used to indicate the bytes of the blob. */ export const range: OperationParameter = { parameterPath: ["options", "range"], mapper: { diff --git a/sdk/communication/communication-callingserver/src/utils/base64.ts b/sdk/communication/communication-callingserver/src/utils/base64.ts new file mode 100644 index 000000000000..01585e3675c4 --- /dev/null +++ b/sdk/communication/communication-callingserver/src/utils/base64.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { isNode } from "@azure/core-http"; + +/** + * Base64 encode. + * + * @internal + * @param content - string need to be encoded + */ +export function base64encode(content: string): string { + return isNode ? Buffer.from(content).toString("base64") : btoa(content); +} + +/** + * Base64 decode. + * + * @internal + * @param encodedString - string need to be decoded + */ +export function base64decode(encodedString: string): string { + return isNode ? Buffer.from(encodedString, "base64").toString() : atob(encodedString); +} diff --git a/sdk/communication/communication-callingserver/swagger/README.md b/sdk/communication/communication-callingserver/swagger/README.md index 0946b0141406..f48563597ac8 100644 --- a/sdk/communication/communication-callingserver/swagger/README.md +++ b/sdk/communication/communication-callingserver/swagger/README.md @@ -18,7 +18,7 @@ generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../src/generated tag: package-2021-11-15-preview -require: https://raw.githubusercontent.com/navali-msft/azure-rest-api-specs/c16d5c3b668207b9ec101294a9f05a20e7281083/specification/communication/data-plane/CallingServer/readme.md +require: https://raw.githubusercontent.com/navali-msft/azure-rest-api-specs/8dea6eb48674de3cc017be56326f2a2360bac714/specification/communication/data-plane/CallingServer/readme.md model-date-time-as-string: false optional-response-headers: true typescript: true diff --git a/sdk/communication/communication-callingserver/test/public/callConnection.spec.ts b/sdk/communication/communication-callingserver/test/public/callConnection.spec.ts new file mode 100644 index 000000000000..b744781a65fa --- /dev/null +++ b/sdk/communication/communication-callingserver/test/public/callConnection.spec.ts @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { env, record, Recorder, RecorderEnvironmentSetup } from "@azure-tools/test-recorder"; +import { CallingServerClient, CreateCallConnectionOptions, PlayAudioOptions } from "../../src"; +import { TestUtils } from "./utils/testUtils"; +import { Context } from "mocha"; +import * as Constants from "./utils/constants"; +import { CommunicationIdentityClient } from "@azure/communication-identity"; +import { PhoneNumberIdentifier } from "@azure/communication-common"; +const replaceableVariables: { [k: string]: string } = { + COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana" +}; + +const environmentSetup: RecorderEnvironmentSetup = { + replaceableVariables, + customizationsOnRecordings: [ + (recording: string): string => recording.replace(/(https:\/\/)([^/',]*)/, "$1endpoint"), + (recording: string): string => recording.replace("endpoint:443", "endpoint") + ], + queryParametersToSkip: [] +}; + +describe("Call Connection Live Test", function() { + describe("Call Automation Operations", function() { + let recorder: Recorder; + let connectionString: string; + + beforeEach(async function(this: Context) { + recorder = record(this, environmentSetup); + /* Place your code here*/ + connectionString = + env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING || + "endpoint=https://endpoint/;accesskey=banana"; + }); + + afterEach(async function(this: Context) { + if (!this.currentTest?.isPending()) { + await recorder.stop(); + } + }); + + it("Run create_play_cancel_hangup scenario", async function(this: Context) { + this.timeout(0); + // this.callingServer = createCallingServerClient(); + // this.callingServer = createSmsClient(); + const to_phone_number = env.AZURE_PHONE_NUMBER; + console.log("========================="); + console.log(to_phone_number); + const callingServer = new CallingServerClient(connectionString); + const identityClient = new CommunicationIdentityClient(connectionString); + const from_user = await identityClient.createUser(); + const to_user: PhoneNumberIdentifier = { + phoneNumber: to_phone_number + }; + const from_phone_number = "+18445764430"; + // create call option + const createCallOptions: CreateCallConnectionOptions = { + callbackUri: Constants.CALLBACK_URI, + requestedMediaTypes: ["audio"], + requestedCallEvents: ["participantsUpdated", "toneReceived"], + alternateCallerId: { phoneNumber: from_phone_number } + }; + const callConnection = await callingServer.createCallConnection( + from_user, + [to_user], + createCallOptions + ); + try { + // create PlayAudio option + const playAudioOptions: PlayAudioOptions = { + loop: true, + audioFileId: recorder.getUniqueName("audioFileId"), + callbackUri: Constants.CALLBACK_URI, + operationContext: recorder.getUniqueName("operationContext") + }; + await TestUtils.delayIfLive(); + await callConnection.playAudio(Constants.Audio_File_Url, playAudioOptions); + await callConnection.cancelAllMediaOperations(); + await TestUtils.delayIfLive(); + } finally { + await callConnection.hangUp(); + } + }); + }); +}); diff --git a/sdk/communication/communication-callingserver/test/public/serverCall.spec.ts b/sdk/communication/communication-callingserver/test/public/serverCall.spec.ts index 6e89db12eb46..80eb5e94fe4d 100644 --- a/sdk/communication/communication-callingserver/test/public/serverCall.spec.ts +++ b/sdk/communication/communication-callingserver/test/public/serverCall.spec.ts @@ -9,7 +9,7 @@ import assert from "assert"; import { Context } from "mocha"; const replaceableVariables: { [k: string]: string } = { - COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana" + COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana" }; const environmentSetup: RecorderEnvironmentSetup = { @@ -30,7 +30,7 @@ describe("Server Call Live Test", function() { recorder = record(this, environmentSetup); /* Place your code here*/ connectionString = - env.COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING || + env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING || "endpoint=https://endpoint/;accesskey=banana"; }); diff --git a/sdk/communication/communication-callingserver/test/public/utils/constants.ts b/sdk/communication/communication-callingserver/test/public/utils/constants.ts index 1b74b034f947..03f616d77aa1 100644 --- a/sdk/communication/communication-callingserver/test/public/utils/constants.ts +++ b/sdk/communication/communication-callingserver/test/public/utils/constants.ts @@ -1,5 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { base64encode } from "../../../src/utils/base64"; + export const NAMESPACE_UUID = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"; -export const CALLBACK_URI = "https://bot.contoso.io/callback"; +export const CALLBACK_URI = "https://endpoint/callback"; +export const App_Base_Url = "https://endpoint"; +export const Audio_File_Name = "sample-message.wav"; +export const Incoming_Request_Secret = "helloworld"; +export const Audio_File_Url = `${App_Base_Url}/audio/${Audio_File_Name}`; +export const App_Callback_Url = `${App_Base_Url}/api/incident/callback?SecretKey=${base64encode( + Incoming_Request_Secret +)}`; diff --git a/sdk/communication/communication-callingserver/test/public/utils/testUtils.ts b/sdk/communication/communication-callingserver/test/public/utils/testUtils.ts index e7f5395bdf2b..ebd4412d2b9b 100644 --- a/sdk/communication/communication-callingserver/test/public/utils/testUtils.ts +++ b/sdk/communication/communication-callingserver/test/public/utils/testUtils.ts @@ -14,7 +14,9 @@ export class TestUtils { public static async getUserId(userName: string, connectionString: string): Promise { const communicationIdentityClient = new CommunicationIdentityClient(connectionString); - const tenant_id = env.AZURE_TENANT_ID || "016a7064-0581-40b9-be73-6dde64d69d72"; + const tenant_id = + env.COMMUNICATION_LIVETEST_STATIC_RESOURCE_IDENTIFIER || + "016a7064-0581-40b9-be73-6dde64d69d72"; if (!isLiveMode()) { return "8:acs:" + tenant_id + "_" + uuidv5(userName, Constants.NAMESPACE_UUID);