I couldn't figure out how to do this in a registry string, so I ended up writing a Powershell script and just calling that instead of UCADialer.exe.
Here's what I put for HKCU\Software\Classes\callto\shell\open\command\(Default)
:
"C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" -file "C:\programmes\click2call.ps1" "%1"
Then I made a new text file in C:\Programmes
and named it click2call.ps1
with these contents (see below). See the comments on the right side for details.
$ThingClicked=$args[0] #saves the thing you clicked on as $ThingClicked (passed in through "%1" in registry string)
$OutsideLinePrefix="8" #in case you have to dial a number to get an outside line. We have to dial 8
$CountryCode="1" #in case you have to dial a country code. Our links usually don't have the country code
#Put the path to UCADialer.exe in the row below:
$PathtoUCADialer="C:\Program Files (x86)\Mitel\Unified Communicator Advanced 6.0\ucadialer.exe"
function DialwithUCA($RawNumber) #defines the DialwithUCA function as the next five rows:
{
$NumeralsOnly=$RawNumber -replace "\D" #removes everything in $RawNumber that isn't a numeral
$NumberToDial=$OutsideLinePrefix + $CountryCode + $NumeralsOnly #Here, you can remove $OutsideLinePrefix and/or $CountryCode here if you don't need them
& $PathtoUCADialer $NumberToDial #launches UCADialer.exe and feeds it the phone number to dial
}
DialwithUCA($ThingClicked) #runs the DialwithUCA function on the thing you clicked.
The script takes whatever you clicked, strips out everything that isn't a numeral, appends 81
to the beginning, and then sends it to UCADialer.exe. You can remove $OutsideLinePrefix + $CountryCode +
in row 11 if you don't need the 81.
This script will only work on links without the country code. You could add some more logic to help it always format the string correctly; for example, some tel links will already have a "1" at the beginning, others will not. I haven't figured out how to do this yet, but this blog post looks promising.