Unable to start call with azure communication service rooms

47 Views Asked by At

I have created a sample application for Azure Communication Service Rooms. I have created a room with the participant and i am trying to start the call by joining the room immediately or by providing the roomid. When I call the callagent.Join

const roomCallLocator = { roomId: roomId }
call = callAgent.join(roomCallLocator, { videoOptions })

call agent starts the call initializes the video stream and then disconnects it by throwing an error user is not part of the invite list. But i have checked with roomsClient.listParticipants(roomid) the participant is there.

When i have added participant manually as well to the call object using following code:

const participantsList = await roomsClient.listParticipants(roomId)
console.log('\nRetrieved participants for room:')
    
    
for await (const participant of participantsList) {
   call.addParticipant(participant.id)    
}

but still, it starts the call and ends the call immediately throwing error 'code: 403 subCode: 5828' which is user is not part of invite list.

Actual Exception in logs:

5e46e33213be","callType":2,"callDirection":"Outgoing","failureReason":"CallSetupError","callEndDiagnosticsInfo":{"callControllerCode":403,"callControllerSubCode":5828,"phrase":"The join is not authorized for Acs Room System since user is not part of invitee list."

With this QuickStart example on MS website same error occurs.

1

There are 1 best solutions below

2
Dalorzo On

When I tried it, I ran into the same issue. I followed these steps, and it worked for me:

Generate an identity:

az communication identity token issue --scope voip --connection-string "your connection string"

az communication rooms create --valid-from "2024-03-25T10:21" --valid-until "2024-03-28T10:21" --pstn-dial-out-enabled "False" --connection-string "your connection string"

az communication rooms participant add-or-update --attendee-participant "user id" --room "roomId" --connection-string "your connection string"

In the example I used the token generate in step 1 and the room id from step 2

enter image description here