Azure communication service Web Calling Issue

Adithya Udupa 6 Reputation points
2021-10-27T13:09:49.037+00:00

Hi, I'm able to successfully deploy a standalone react app & run the following sample application and make a web call . https://github.com/Azure-Samples/communication-services-web-calling-tutorial

But, when i integrate this into my existing React App, i start getting issues in creating a CallAgent after creating a CallClient with error as follows.
'azure:ACS:error 27/10/2021, 18:13:48:96 CallClient1:CallAgent1 op:Initialize failed, message=No CommunicationTokenCredential provided,'

I am passing the CommunicationTokenCredentials while calling the createCallAgent(token) (verified by printing the token as well).
But still i get this error. Can you please tell me what might be wrong here ?

MakeCall.js:188 communicationUserId:[object Object]
MakeCall.js:190 userDetailsResponse:[object Object]
log.browser.js:12 azure:ACS:info 27/10/2021, 18:13:48:85 CallClient1 created
MakeCall.js:70 td {sendTelemetry: ƒ, handleVisibilityChange: ƒ, handleOrientationChange: ƒ, getOrientationBasedOnWindowSize: ƒ, handleResize: ƒ, …}
log.browser.js:12 azure:ACS:info 27/10/2021, 18:13:48:93 CallClient1 op:CreateCallAgent, started
log.browser.js:12 azure:ACS:info 27/10/2021, 18:13:48:93 CallClient1:CallAgent1 op:Initialize, started
index.js:1375 azure:ACS:error 27/10/2021, 18:13:48:96 CallClient1:CallAgent1 op:Initialize failed, message=No CommunicationTokenCredential provided, code=400 in 0.003s
console.<computed> @ index.js:1375
log @ log.browser.js:8
push../node_modules/@azure/logger/dist-esm/src/index.js.AzureLogger.log @ index.js:16
child.log @ index.js:108
child.log @ index.js:108

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
1,240 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Adithya Udupa 6 Reputation points
    2021-11-11T08:10:21.183+00:00

    I was able to isolate the issue to the webpack, webpack-cli plugin my project was using which was an older version. Once i upgraded it to newer version the issue got resolved even though i don't know how ACS web call is related to the webpack version. Anyways, thanks for your help so far

    1 person found this answer helpful.

  2. Artur Kania 1 Reputation point Microsoft Employee
    2021-11-02T23:04:37+00:00

    Hi

    Can you share the code that you're using to create token credential please?
    You can also refer to our sample code here https://github.com/Azure-Samples/communication-services-web-calling-tutorial/blob/803699180e306a0de5fadec9f3ebf3ec761d2316/Project/src/MakeCall/Login.js

    const tokenCredential = new AzureCommunicationTokenCredential(token); ... this.callAgent = await this.callClient.createCallAgent(tokenCredential, { displayName: 'Optional ACS user name'});


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.