Auto dial with Microsoft Teams

A very often requested feature in Microsoft Teams Phone System projects is auto dial. A user marks a phone number and is looking for a shortcut to initiate a phone call with Microsoft Teams to this marked number. Does it work, Thorsten, auto dial for Microsoft Teams?

To be honest: not directly out of the box. But based on an article from Frank Carius, I found a solution for this request.


Step 1: Link tel: to Microsoft Teams as default program in Windows 10

First, you must associate the tel: protocol with Microsoft Teams as default program. For a single computer, type default into the Windows 10 search box. Windows 10 should find default program in your system settings.

Auto dial with Microsoft Teams - Search for default program association
Search for default program

Please click this entry in your result list, it will open the control settings for the default programs. Here you can define Outlook as the default mail app for example.

Auto dial with Microsoft Teams - open default app per protocol
Open default app per protocol

On the bottom of the page, you can find default app per protocol. Just click this link and search for tel: in the protocol list.

By default, there is no associated program for this prefix.

Auto dial with Microsoft Teams - Assign Teams to tel prefix
Assign Teams to tel: prefix

You must change it to Microsoft Teams. Click on the plus symbol and select Microsoft Teams from the suggested program list.

Auto dial with Microsoft Teams - Assign Teams to tel prefix
Assign Teams to tel: prefix

Change tel association for a mass of systems – GPO

To change the tel protocol association for a mass of Windows 10 systems, it is more suitable to use a mechanismen like a group policy for the deployment.

For this, change the protocol association as described above and export the local settings by using this command:

Dism.exe /online /Export-DefaultAppAssociations:C:\temp\DefaultAssoc.xml

It will export all your default app associations to a xml file. The folder to store the file should be created before running this command.

Afterwards, open the xml file and search for the identifier tel. This is our needed protocol association for Microsoft Teams.

Auto dial with Microsoft Teams - Default app association file
Default app association file

Delete all other lines and save this change. Of course, you can add other protocols you would like to change, too. For example, you can add a line for SIP or IM.

Auto dial with Microsoft Teams - modified app association for Teams
Modified app association file for Teams and tel: prefix

Copy the file to a network share which is accessible for all domain joined computers.

Now, we can create a GPO and reference this file. You can find the needed setting in

Computer Configuration – Administrative Templates – Windows Components – File Explorer

Open the value Set a default associations configuration file, enable the policy and add the UNC path to the customized XML file. The association file will only modify protocols and programs mentioned in this file.

Step 2: Install Auto HotKey and create an ahk script

The second step is to install Auto HotKey and create the necessary script. You can find the installation file here. After installing Auto HotKey, you create a text file in your documents folder. This is the default location where Auto HotKey estimates the file.

The content is quite simple:

F11:: ; Chat message

clipboard := "" ; Empty the clipboard
Send, ^c
ClipWait, 2

clipboard := StrReplace(clipboard, " ") ; Remove Blank

Run, sip:%clipboard%

return

F12:: ;phone call

clipboard := "" ; Empty the clipboard
Send, ^c
ClipWait, 2

clipboard := StrReplace(clipboard, " ") ; Remove Blank
clipboard := StrReplace(clipboard, ".") ; Remove .
clipboard := StrReplace(clipboard, "/") ; Remove /
clipboard := StrReplace(clipboard, "-") ; Remove - symbol
clipboard := StrReplace(clipboard, "(0)") ; Remove german specifique manner to include (0) 

;MsgBox, clipboard = %clipboard%
Run, tel:%clipboard%

return

This script will copy the marked text into your clipboard, will remove some characters and run the modified clipboard content with the tel prefix. Because we associated this prefix with Teams, it will open Teams and ask to initiate a call.

Of course, you adapt the script to your needs. In my case, I used F11 and F12 as hot key. Look on the Auto HotKey website where you can find a documentation, tutorials, and examples for the script.


Step 3: Test it

To test the new function, just mark a phone number on a website, in a document or in a PDF file. Then press the associated hot key and it should open Teams and ask to initiate a phone call to the marked number.

Auto dial with Microsoft Teams - Start a test call
Start a test call

Links

original blog post from Frank Carius about Auto HotKey and Lync

Customize default protocol association in Windows 10

Auto HotKey

7 Replies to “Auto dial with Microsoft Teams”

  1. Pingback: URL
    1. Hi Christoph,
      das sollte mittels Deeplink möglich sein.
      Info’s zu Deeplinks findest Du hier: https://docs.microsoft.com/microsoftteams/platform/concepts/build-and-test/deep-links#deep-linking-to-an-audio-or-audio-video-call

      Mit einem entsprechenden Eintrag in dem Auto HotKey Skript sollte es dann möglich sein. Als Beispiel:
      https://teams.microsoft.com/l/call/0/0?users=%clipboard%&withVideo=true

      Der Anwender müsste dann die SIP URI des anzurufenden Teams Users markieren und das entsprechende Tastenkürzel drücken.

  2. Leider passt dieser Code nicht mehr zu Autohotkey 2.X.
    Kann man das passend machen ? Verstehe leider nichts von Coding…

Leave a Reply

Your email address will not be published. Required fields are marked *