How to parse new Teams Short URL
MS Teams has a new short URL, for example: https://teams.microsoft.com/meet/2414128301281?p=NzhDLMLT8b07DrkwkE
Is there some way to get the information necessary to get a teams bot to connect to the call with this URL?
Bump
+1 The new url is breaking the PSIBot example
It is actually easier with this format
Previously we needed to provide the chatInfo object with threadId and messageId, and a meetingInfo with tenantId and Organizer ID.
With this format the ChatInfo Object can just be empty and instead of using OrganizerMeetingInfo, use JoinMeetingIdMeetingInfo, which accepts the number and pwd from the meeting link.
We use this regex to parse it:
[GeneratedRegex("https://teams\\.microsoft\\.com/meet/(?<meetingId>.+?)\\?p=(?<passcode>.+)")]
private static partial Regex TeamsUrlRegex();
and the high level idea of this is:
// Fetch m_id and pwd
var (meetingId, passcode) = Utils.ParseJoinUrl(joinUrl);
var meetingInfo = new JoinMeetingIdMeetingInfo {
JoinMeetingId = meetingId,
Passcode = passcode,
};
// Local media session
var mediaSession = CreateLocalMediaSession();
// The join params object
var joinParams = new JoinMeetingParameters(new ChatInfo(), meetingInfo, mediaSession) {
TenantId = tenantId,
};
[...]
var statefulCall = await Client.Calls().AddAsync(joinParams, new Guid());
One note though, you will need to get the (Azure) tenantId somehow along the meeting link. If you have a flow coded to join meetings set up, like adaptive cards, side/chat panel... You can easily extract it from the messages the bot receives, otherwise, you'll need to provide it manually somehow. This is the only parameter you can't infer directly.
@ADelYerro Do you know anything about Azure Communication Services replacing the Microsoft.Skype.Bots.Media ? Is it okay to use Skype.Bots.Media or we have to change