# How to associate a softphone with a phone url

I'm trying to get click to call to work using Qutecom for a softphone and a Greesemonkey script to turn phone numbers into clickable urls. Whenever I click on the phone number link I get an error message saying the following:

Firefox doesn't know how to open this address, because the protocol (tel) isn't associated with any program.

How would I go about associating Qutecom, or any other softphone, with that link? The Greasemonkey scribt can be found at the link below:

http://userscripts.org/scripts/show/56262

Any help would be greatly appreciated.

-
What OS are you using? –  Paul Feb 2 '12 at 2:07
I'm actually using both Windows XP and Ubuntu. I'd be interested in hearing about a solution for either OS. –  Arthur Feb 2 '12 at 2:45

Under Windows, you can create a new protocol using the Registry Editor:

 Start / Run / regedit


Look for the HKEY_CLASSES_ROOT hive, and create a new series of keys with the following structure:

 tel\shell\open\command


At the tel level, edit the (Default) string, and change its value to URL:tel Protocol Again at the tel level, add a new string called URL Protocol and no value.

Then at the command level, edit the (Default) string, and in the value section, enter the command you want to execute:

 c:\path\to\telephone\application.exe %1


The %1 will be replaced by whatever is placed after the tel: sequence, ie, the phone number.

And that should do it.

Under Ubuntu

This might be version specific, but the following should work:

gconftool-2 -t string -s /desktop/gnome/url-handlers/tel/command "/path/to/telephone/application %s"
gconftool-2 -s /desktop/gnome/url-handlers/tel/needs_terminal false -t bool
gconftool-2 -t bool -s /desktop/gnome/url-handlers/tel/enabled true


In this case the %s will be replaced by the phone number.

In the case of qutecom, it appears that the Windows command line should be:

"c:\program files\qutecom\qutecom.exe" -c call\%1


(adjust for your installation location, and try this from a dos prompt first, replacing %1 with a phone number)

-
Thanks. I tried what you said for Windows, but it just opens the softphone without dialing the number. –  Arthur Feb 2 '12 at 5:05
@Arthur you'll need to find the correct command line syntax for your app to determine what the correct command line for the URI. So if you get it working from a prompt, then duplicate what works in the URI. –  Paul Feb 2 '12 at 5:15
I'm relatively new to this. Would you mind giving me an example of a syntax, softphone combination that you are familiar with. I'm trying different combinations, but I am at a loss and I really don't know where to start looking. –  Arthur Feb 2 '12 at 5:40
I have found the qutecom docs for linux - it should be similar, I have updated the answer (trac.qutecom.org/wiki/UserDocumentation) –  Paul Feb 2 '12 at 5:50
It's still not working. I tried "c:\program files\qutecom\qutecom.exe" -c call\19999999999 with no success. It still just opens QuteCom. –  Arthur Feb 2 '12 at 16:56

If you are in the same situation, a solution I came up with is to point the registry command for the protocol to a batch file that evaluate the command line parameter stripping the "tel:" part and start QuteCom...

So here is what I put as string in the registry command key:

 "C:\telProtocolHandler.bat" %1


Here is the content of my telProtocolHandler.bat :

 set PathExe="C:\Program Files (x86)\QuteCom\QuteCom.exe"

set CLcmd=-c call/
set CLprm=%1
set CLprm=%CLprm:tel:=%

start "" %PathExe% %CLcmd%%CLprm%


Now it works like a charm under Windows 7

-

Paul's answer is ok, but better use "sip" protocol instead of "tel" otherwise QuteCom will try to call "tel:#########", because browsers pass URI into %1.

Also in Windows 7 and latest version of QuteCom my path looks like this (notice slash instead of backslash):

C:\Program Files (x86)\QuteCom\QuteCom.exe -c call/"%1"

-