2

I have a simple dialler programme that I am trying to associate with tel & callto html tags however when I associate it via the registry:

[HKEY_CURRENT_USER\Software\Classes\callto\shell\open\command]
"C:\Program Files (x86)\Mitel\Unified Communicator Advanced 5.1\ucadialer.exe" "%1"

it passes thorough all information from the tag, ie:

callto:07777123456

what this results in is the dialler programme using the following string:

922558607777123456

which after much confusion turned out to be the numbers on the keys for C A L L T O.

What I therefore need to do is to trigger the dialler to pass through all the info after the colon, missing the letters of CALLTO or TEL.

Can this be done by changing the registry string? If not, is there a workaround?

Many thanks in advance.

jabaldonedo
  • 25,822
  • 8
  • 77
  • 77
user2592064
  • 21
  • 1
  • 3

1 Answers1

0

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.

browly
  • 352
  • 6
  • 11
  • I couldn't get tel: links to work in Windows 10. [This post](http://serverfault.com/questions/356035/how-to-associate-a-softphone-with-a-phone-url) had a suggestion, but when I click a tel: link the only options I get are for Chrome, Skype, or "Look for another app in the store." – browly Aug 10 '16 at 20:05