Closed eskizyen closed 1 month ago
@raosanat can you take a look?
Looks like you are using the incorrect token for the CallAgent
type that you are trying to create. If you are using a MicrosoftTeamsUserIdentifier
please follow the documentation and code samples.
Unfortunately the issue is not about setup. It works for SDK version 2.9.0 but not with 2.11.0
So in 2.9.0 version and below we did allow creating a CallAgent
with a Teams token. But 2.9.0 and above we have introduced a better experience with introduction of TeamsCallAgent
which can be created using a Teams token. Just to confirm you are using a MicrosoftTeamsUserIdentifier
type ?
In my case I don't start a call so I don't use MicrosoftTeamsUserIdentifier
or any other identifier. Call is started in backend and I accept it. Just in case I tried to create teams agent callClient.createTeamsCallAgent(userCredential: credentials)
and faced the same crash.
In backend they use Call Automation SDK.
More specifically: azure-communication-callautomation Version 1.1.0 azure-communication-identity Version 1.5.0 azure-communication.networktraversal Version 1.1.0-beta.2
Hi @raosanat, I am also facing similar issue. Before upgrading to 2.11.0, the following code worked fine for phone calling. After upgrade have started receiving error. Looks like if we don't pass any options, it assumes "teams" by default and hence crashes. Any suggestions to fix the error:
Previously working code:
func setupCallAgent() {
var userCredential: CommunicationTokenCredential?
do {
userCredential = try CommunicationTokenCredential(token: accessToken)
} catch {
print("@@ ERROR: It was not possible to create user credential. \(error.localizedDescription)")
return
}
self.callClient = CallClient()
self.callClient.createCallAgent(userCredential: userCredential!) { (agent, error) in
if let error = error {
print("@@ ERROR: It was not possible to create a call agent. \(error.localizedDescription)")
return
}
print("@@ Call agent type: \(type(of: callAgent))")
self.callAgent = agent
print("@@ Call agent successfully created.")
self.startCall()
}
}
**Error after upgrade:**
Terminating app due to uncaught exception 'ACSException', reason: 'Unexpected CallAgent type' First throw call stack: ( 0 CoreFoundation 0x0000000118859571 exceptionPreprocess + 242 1 libobjc.A.dylib 0x000000010e4c67e8 objc_exception_throw + 48 2 CoreFoundation 0x000000011885944f -[NSException initWithCoder:] + 0 3 AzureCommunicationCalling 0x0000000114b8652b 140-[ACSCallClient createCallAgentWithOptionsInternal:callAgentOptions:teamsCallAgentOptions:withCompletionHandler:withTeamsCompletionHandler:]_block_invoke_4 + 363
Re-opening the issue to investigate.
Thanks for reporting the issue, we are working on fixing the bug.
@eskizyen This should be fixed on https://github.com/Azure/Communication/releases/tag/v2.13.0-beta.1, can you please verify? Feel free to reopen if is still an issue
Describe the bug Updated SDK from 2.9.0 to 2.11.0, after calling
createCallAgent
app crashes with an exception 'Unexpected CallAgent type'. Crash doesn't happen with version 2.9.0.Exception or Stack Trace
To Reproduce Call
createCallAgent
on call client.Code Snippet
callClient.createCallAgent(userCredential: credentials)
Expected behavior No crash happens.
Setup (please complete the following information):
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report