Wayne Kellman
Wayne Kellman

Reputation: 38

Azure Communications UI: Unable to join call

I'm coming across an error in the quickstart library of the communications Ui.

In the startCallComposite

private fun startCallComposite() {
    val communicationTokenRefreshOptions = CommunicationTokenRefreshOptions({ fetchToken() }, true)
    val communicationTokenCredential = CommunicationTokenCredential(communicationTokenRefreshOptions)
//        val options = GroupCallOptions(
//            this,
//            communicationTokenCredential,
//            UUID.fromString("GROUP_CALL_ID"),
//            "DISPLAY_NAME",
//        )
    val options = TeamsMeetingOptions(
        this,
        communicationTokenCredential,
        "Meeting link",
        "Android Wayne",
    )
    val callComposite: CallComposite = CallCompositeBuilder().build()
    callComposite.setOnErrorHandler { Log.e("setOnErrorHandler", it.errorCode.toString()) }
    callComposite.launch(options)
}

I added an errorhandler to find what happened but there doesn't seem to be a cause that returns. Only an error code which is.

2022-01-20 11:13:26.758 15127-15127/com.example.uilibraryquickstart E/setOnErrorHandler: callJoin

I can't find any information on this error. Is there something I need to additionally add?

Upvotes: 0

Views: 237

Answers (2)

Wayne Kellman
Wayne Kellman

Reputation: 38

I was using the wrong type of token. I needed the access token for the user but I was using my personal access token. The one used to create the others.

Upvotes: 0

SaiKarri-MT
SaiKarri-MT

Reputation: 1301

This usually happens if the connections gets failed. And looks like you are using kotlin to achieve this.

To rectify this make sure you initialize communication token credentials, below is the usual way we do:

val callComposite: CallComposite = CallCompositeBuilder().build()    
val communicationTokenRefreshOptions = CommunicationTokenRefreshOptions(this::fetchToken, true)    
val communicationTokenCredential = CommunicationTokenCredential(communicationTokenRefreshOptions)

Also try to define group call ID for your call with UUID,

Below are few things that needs to be checked in:

  1. Check the required packages and install them.
  2. Try to properly initialize composite according to the steps mentioned in MS Azure Docs.
  3. Make sure you add all the device permissions.

Upvotes: 0

Related Questions