in AzureCommunicationUI/AzureCommunicationUIDemoApp/Sources/Views/CallingDemoView.swift [898:955]
func startCallComposite() async {
let link = getMeetingLink()
if let callComposite = try? await createCallComposite() {
var localOptions = getLocalOptions(callComposite: callComposite)
var remoteInfoDisplayName = envConfigSubject.callkitRemoteInfo
if remoteInfoDisplayName.isEmpty {
remoteInfoDisplayName = "ACS \(envConfigSubject.selectedMeetingType)"
}
let cxHandle = CXHandle(type: .generic, value: getCXHandleName())
isIncomingCall = false
let callKitRemoteInfo = $envConfigSubject.enableRemoteInfo.wrappedValue ?
CallKitRemoteInfo(displayName: remoteInfoDisplayName,
handle: cxHandle) : nil
if envConfigSubject.useDeprecatedLaunch {
try? await startCallWithDeprecatedLaunch()
} else {
switch envConfigSubject.selectedMeetingType {
case .groupCall:
let uuid = UUID(uuidString: link) ?? UUID()
callComposite.launch(locator: .groupCall(groupId: uuid),
callKitRemoteInfo: callKitRemoteInfo,
localOptions: localOptions)
case .teamsMeeting:
if !link.isEmpty {
callComposite.launch(locator: .teamsMeeting(teamsLink: link),
callKitRemoteInfo: callKitRemoteInfo,
localOptions: localOptions)
} else {
callComposite.launch(locator: .teamsMeetingId(meetingId:
envConfigSubject.teamsMeetingId,
meetingPasscode:
envConfigSubject.teamsMeetingPasscode),
callKitRemoteInfo: callKitRemoteInfo,
localOptions: localOptions)
}
case .oneToNCall:
let ids: [String] = link.split(separator: ",").map {
String($0).trimmingCharacters(in: .whitespacesAndNewlines)
}
let communicationIdentifiers: [CommunicationIdentifier] =
ids.map { createCommunicationIdentifier(fromRawId: $0) }
callComposite.launch(participants: communicationIdentifiers,
callKitRemoteInfo: callKitRemoteInfo,
localOptions: localOptions)
case .roomCall:
callComposite.launch(
locator: .roomCall(roomId: link),
callKitRemoteInfo: callKitRemoteInfo,
localOptions: localOptions)
}
}
callingViewModel.callComposite = callComposite
} else {
showError(for: DemoError.invalidToken.getErrorCode())
return
}
}