From cc7e95c9c6e5f4b0ed67d104919f140ba610abbb Mon Sep 17 00:00:00 2001 From: Zihan Zhang Date: Wed, 3 Nov 2021 01:02:32 -0700 Subject: [PATCH] Fix call automation live test --- ...un_create_play_cancel_hangup_scenario.json | 67 ++++++++++--------- ..._run_create_play_cancel_hangup_scenario.js | 62 ++++++++--------- .../test/public/callConnection.spec.ts | 6 +- 3 files changed, 68 insertions(+), 67 deletions(-) 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 index f6737bb7a50c..6ea1ed977298 100644 --- 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 @@ -8,18 +8,19 @@ }, "requestBody": null, "status": 201, - "response": "{\"identity\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-8205-baa7-ab49-094822000bb2\"}}", + "response": "{\"identity\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-84b0-c2ed-ab49-094822000e9e\"}}", "responseHeaders": { "api-supported-versions": "2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, 2021-10-31-preview", + "content-length": "101", "content-type": "application/json; charset=utf-8", - "date": "Tue, 02 Nov 2021 19:33:07 GMT", - "ms-cv": "u3VxHoKgk0iYPdKYa3CYbQ.0", + "date": "Wed, 03 Nov 2021 07:59:11 GMT", + "ms-cv": "ubJ+Qp6SUkGPRJz6PJTdmw.0", "request-context": "appId=", "strict-transport-security": "max-age=2592000", - "x-azure-ref": "0dJKBYQAAAABefUl91ILvTp1ImqJ+Qh+YV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "x-azure-ref": "0T0GCYQAAAAD2RwDvWBWyRpQwKpccj+7OV1NURURHRTA4MTcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-ms-client-request-id": "fe2a3d99-2794-4dae-b99c-25f647c5b077", - "x-processing-time": "44ms" + "x-ms-client-request-id": "5bbe36ee-1fc5-423f-baf8-6607816875df", + "x-processing-time": "23ms" } }, { @@ -28,60 +29,60 @@ "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\"]}", + "requestBody": "{\"alternateCallerId\":{\"value\":\"+18445764430\"},\"targets\":[{\"phoneNumber\":{\"value\":\"+15551234567\"}}],\"source\":{\"communicationUser\":{\"id\":\"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-84b0-c2ed-ab49-094822000e9e\"}},\"callbackUri\":\"https://endpoint/callback\",\"requestedMediaTypes\":[\"audio\"],\"requestedCallEvents\":[\"participantsUpdated\",\"toneReceived\"]}", "status": 201, - "response": "{\"callConnectionId\":\"f21f1300-8f34-4130-86d9-810da2f6e6a5\"}", + "response": "{\"callConnectionId\":\"b91f1300-a37c-4818-81e7-3eb580b21737\"}", "responseHeaders": { "content-length": "59", "content-type": "application/json; charset=utf-8", - "date": "Tue, 02 Nov 2021 19:33:08 GMT", - "x-azure-ref": "0dJKBYQAAAAAOmVBkPdyNQbZe9ZfLwjw5V1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "date": "Wed, 03 Nov 2021 07:59:12 GMT", + "x-azure-ref": "0T0GCYQAAAAAt62bir6IMSJLnLVER8WHHV1NURURHRTA4MTcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "422def29-aa62-4441-9896-059200470ba4", - "x-ms-client-request-id": "6ffc57cd-117f-43f4-8f80-6f33ab32eed8" + "x-microsoft-skype-chain-id": "39f0dd1a-fd2c-4a15-bd7e-325b22bf9b30", + "x-ms-client-request-id": "4395ab4f-6468-4f25-9f1e-cf747f4ff069" } }, { "method": "POST", - "url": "https://endpoint/calling/callConnections/f21f1300-8f34-4130-86d9-810da2f6e6a5/:playAudio", + "url": "https://endpoint/calling/callConnections/b91f1300-a37c-4818-81e7-3eb580b21737/: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\"}", + "requestBody": "{\"audioFileUri\":\"https://endpoint/audio/sample-message.wav\",\"loop\":true,\"operationContext\":\"operationContext163592635267500973\",\"audioFileId\":\"audioFileId163592635267507416\",\"callbackUri\":\"https://endpoint/callback\"}", "status": 202, - "response": "{\"operationId\":\"db9ec0f7-4336-4c49-8263-6e91ba2f88be\",\"status\":\"running\",\"operationContext\":\"operationContext163588158921406416\"}", + "response": "{\"operationId\":\"a63348ce-41b3-47d1-ac09-3dbe20792785\",\"status\":\"running\",\"operationContext\":\"operationContext163592635267500973\"}", "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", + "date": "Wed, 03 Nov 2021 07:59:22 GMT", + "x-azure-ref": "0WkGCYQAAAAB/wLJe91cqRKuHjMKAmExSV1NURURHRTA4MTcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "1c2f2f40-c036-47a3-9c60-9c5798bf4177", - "x-ms-client-request-id": "23c26182-7b58-4bbc-b9c1-22f2205b4094" + "x-microsoft-skype-chain-id": "de3e5959-fcf4-4dd6-8b16-0b9e05e61051", + "x-ms-client-request-id": "af703621-4657-4975-8188-b3df69bdfa85" } }, { "method": "POST", - "url": "https://endpoint/calling/callConnections/f21f1300-8f34-4130-86d9-810da2f6e6a5/:cancelAllMediaOperations", + "url": "https://endpoint/calling/callConnections/b91f1300-a37c-4818-81e7-3eb580b21737/:cancelAllMediaOperations", "query": { "api-version": "2021-11-15-preview" }, "requestBody": null, "status": 200, - "response": "{\"operationId\":\"0f7d3e2e-f1a0-4025-a252-a879c09780a2\",\"status\":\"completed\"}", + "response": "{\"operationId\":\"dd708f21-4817-4eab-a164-f80880337c52\",\"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", + "date": "Wed, 03 Nov 2021 07:59:23 GMT", + "x-azure-ref": "0W0GCYQAAAADVDnXAr0dtTIrE5KFyq9pOV1NURURHRTA4MTcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "7c9d18bb-8730-4008-a37e-fab272eca023", - "x-ms-client-request-id": "7b6e3fd2-a26f-4eaa-a2d8-c1ef1d902011" + "x-microsoft-skype-chain-id": "139c5f9b-9bdf-4453-856d-d7b95d640837", + "x-ms-client-request-id": "19c13571-6261-4def-b0ac-d71bf84bebdd" } }, { "method": "POST", - "url": "https://endpoint/calling/callConnections/f21f1300-8f34-4130-86d9-810da2f6e6a5/:hangup", + "url": "https://endpoint/calling/callConnections/b91f1300-a37c-4818-81e7-3eb580b21737/:hangup", "query": { "api-version": "2021-11-15-preview" }, @@ -90,20 +91,20 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Tue, 02 Nov 2021 19:33:30 GMT", - "x-azure-ref": "0i5KBYQAAAACtc28a9gFFQpHH1MRirDfJV1NURURHRTA4MDkAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "date": "Wed, 03 Nov 2021 07:59:33 GMT", + "x-azure-ref": "0ZUGCYQAAAABXuEMqf1qlQazZAB836yq3V1NURURHRTA4MTcAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", "x-cache": "CONFIG_NOCACHE", - "x-microsoft-skype-chain-id": "1a7a49af-dfa6-4f71-8cbd-d47032aeb7bb", - "x-ms-client-request-id": "96854e0f-816f-49d5-aa1b-88fed6068718" + "x-microsoft-skype-chain-id": "66550ba0-9d16-425a-8df5-ffc739bf9e2f", + "x-ms-client-request-id": "3b32b432-253f-42ad-80b9-c48b389c63fc" } } ], "uniqueTestInfo": { "uniqueName": { - "audioFileId": "audioFileId163588158921401351", - "operationContext": "operationContext163588158921406416" + "audioFileId": "audioFileId163592635267507416", + "operationContext": "operationContext163592635267500973" }, "newDate": {} }, - "hash": "e38f862b35b3985445f9beb2e603ec25" + "hash": "c37e0573593c63b00d076fd407c725d0" } \ No newline at end of file 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 index 509908b530a1..4fb030178255 100644 --- 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 @@ -1,13 +1,13 @@ let nock = require('nock'); -module.exports.hash = "a408222633e95f57d4cb6d9b42356c6b"; +module.exports.hash = "91ae5cf5c1a1f9f577c79320d44390bd"; -module.exports.testInfo = {"uniqueName":{"audioFileId":"audioFileId163588155539809897","operationContext":"operationContext163588155539803449"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"audioFileId":"audioFileId163592632598100800","operationContext":"operationContext163592632598105415"},"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"}}, [ + .reply(201, {"identity":{"id":"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-84b0-5ac4-28c5-593a0d000f09"}}, [ 'Content-Length', '101', 'Content-Type', @@ -15,97 +15,97 @@ nock('https://endpoint', {"encodedQueryParams":true}) 'Request-Context', 'appId=', 'MS-CV', - 'HKkbAq7dqkiWz8fRgwJh7Q.0', + 'ej6CNrmzPUupKpV2nc/NXA.0', 'Strict-Transport-Security', 'max-age=2592000', 'x-ms-client-request-id', - 'fbbc6295-e8e2-4dcb-ad98-fa9e6f89e74a', + '70fc0088-75e7-44b9-9781-83b5076e88f8', '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', + '41ms', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0UpKBYQAAAAC7PBUWZYh+TqzhtmUyMNKvV1NURURHRTA4MTgAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0NEGCYQAAAABEpRS7JoBRSrEBAtOFuvN2V1NURURHRTA4MTYAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Tue, 02 Nov 2021 19:32:33 GMT' + 'Wed, 03 Nov 2021 07:58:44 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"]}) + .post('/calling/callConnections', {"alternateCallerId":{"value":"+18445764430"},"targets":[{"phoneNumber":{"value":"+15551234567"}}],"source":{"communicationUser":{"id":"8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000d-84b0-5ac4-28c5-593a0d000f09"}},"callbackUri":"https://endpoint/callback","requestedMediaTypes":["audio"],"requestedCallEvents":["participantsUpdated","toneReceived"]}) .query(true) - .reply(201, {"callConnectionId":"4f1f1300-e88f-4307-b278-c0a8b9bcbba3"}, [ + .reply(201, {"callConnectionId":"d41f1300-c843-49e0-a241-1238b631c7d1"}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-ms-client-request-id', - '68ae3cb4-7d81-4517-90c7-b816c770db35', + '6b93da44-ed9f-4a55-b3f1-cac6f5f4185b', 'X-Microsoft-Skype-Chain-ID', - 'b5313621-bba4-4b1c-9238-c6998970c9c8', + '85296700-e830-4253-91fa-0c871b120d79', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0UpKBYQAAAACDEGd//e8fT7PgnjxRhYzuV1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0NUGCYQAAAABeChp0FV+vRJd5ayqyAArcV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Tue, 02 Nov 2021 19:32:35 GMT' + 'Wed, 03 Nov 2021 07:58:45 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"}) + .post('/calling/callConnections/d41f1300-c843-49e0-a241-1238b631c7d1/:playAudio', {"audioFileUri":"https://endpoint/audio/sample-message.wav","loop":true,"operationContext":"operationContext163592632598105415","audioFileId":"audioFileId163592632598100800","callbackUri":"https://endpoint/callback"}) .query(true) - .reply(202, {"operationId":"3e9d155e-0e7f-46a9-9a29-9eb3ddcbc9a2","status":"running","operationContext":"operationContext163588155539803449"}, [ + .reply(202, {"operationId":"3bd09c8c-7eef-40d4-812a-4043ebf1725c","status":"running","operationContext":"operationContext163592632598105415"}, [ 'Content-Length', '129', 'Content-Type', 'application/json; charset=utf-8', 'X-Microsoft-Skype-Chain-ID', - '435821fb-7594-4d3f-a3b2-01e87bef0758', + 'dd643d2e-636c-4cba-94e4-e1523ef58c03', 'x-ms-client-request-id', - '70e7fc5a-46ed-4810-b44e-660c5701e0ba', + '368643a3-1dd9-4fab-abcd-9287a4beaf31', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0XZKBYQAAAAAQ3sODUG78Q4M8Yv5R2Cn1V1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0QEGCYQAAAABxyyKPD1y3QbhPqjHTjf0TV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Tue, 02 Nov 2021 19:32:45 GMT' + 'Wed, 03 Nov 2021 07:58:56 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling/callConnections/4f1f1300-e88f-4307-b278-c0a8b9bcbba3/:cancelAllMediaOperations') + .post('/calling/callConnections/d41f1300-c843-49e0-a241-1238b631c7d1/:cancelAllMediaOperations') .query(true) - .reply(200, {"operationId":"4465dd3b-ab2a-4809-a6b6-768b29644972","status":"completed"}, [ + .reply(200, {"operationId":"aa43fa76-892b-481d-b88f-d630a952010c","status":"completed"}, [ 'Content-Length', '75', 'Content-Type', 'application/json; charset=utf-8', 'X-Microsoft-Skype-Chain-ID', - '49ba713e-e471-46de-aa07-89fd456873bc', + 'a0fae5dc-445d-4fc6-8b20-78792dc1df18', 'x-ms-client-request-id', - 'e5a5874d-2304-49b1-bdfb-2068e7bdc695', + '508201e5-82ac-4735-bfec-163a69297ceb', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0XZKBYQAAAAA3Dpayn01MRqPW3l8W7bHKV1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0QUGCYQAAAAB6ZaggdStwTIadZAI8/nKKV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Tue, 02 Nov 2021 19:32:45 GMT' + 'Wed, 03 Nov 2021 07:58:56 GMT' ]); nock('https://endpoint', {"encodedQueryParams":true}) - .post('/calling/callConnections/4f1f1300-e88f-4307-b278-c0a8b9bcbba3/:hangup') + .post('/calling/callConnections/d41f1300-c843-49e0-a241-1238b631c7d1/:hangup') .query(true) .reply(202, "", [ 'X-Microsoft-Skype-Chain-ID', - '33fbca87-1154-41f0-95d0-93b829c9573e', + '2de7bc3d-c8db-4e45-8650-911a80d82ec7', 'x-ms-client-request-id', - '6069c56f-aa4e-4050-a4d0-881cc513e34c', + '91f520cc-6dff-44bb-acb6-efa74f51564b', 'X-Cache', 'CONFIG_NOCACHE', 'X-Azure-Ref', - '0aJKBYQAAAAA6Z6ERZ0ZrRYN2HDTK0YhGV1NURURHRTA4MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', + '0S0GCYQAAAACcfEPpH8LIQ67GWHIRgq5YV1NURURHRTA4MjAAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx', 'Date', - 'Tue, 02 Nov 2021 19:32:56 GMT', + 'Wed, 03 Nov 2021 07:59:07 GMT', 'Content-Length', '0' ]); diff --git a/sdk/communication/communication-callingserver/test/public/callConnection.spec.ts b/sdk/communication/communication-callingserver/test/public/callConnection.spec.ts index b744781a65fa..5bec50554754 100644 --- a/sdk/communication/communication-callingserver/test/public/callConnection.spec.ts +++ b/sdk/communication/communication-callingserver/test/public/callConnection.spec.ts @@ -9,7 +9,8 @@ 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" + COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana", + AZURE_PHONE_NUMBER: "+15551234567" }; const environmentSetup: RecorderEnvironmentSetup = { @@ -30,8 +31,7 @@ describe("Call Connection Live Test", function() { recorder = record(this, environmentSetup); /* Place your code here*/ connectionString = - env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING || - "endpoint=https://endpoint/;accesskey=banana"; + env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING; }); afterEach(async function(this: Context) {