views:

330

answers:

2

I would like to allow some users to be able to launch a voip application from a web page, ie in response to clicking a button to dial the telephone number for the record they are looking at.

My question is can i use greasemonkey to launch the exe and pass a parameter from the a webpage or will security restrictions stop this from working.

Ive never used greasemonkey before, but is this feature would make it worth my while hacking it a little.

A: 

No, you can't launch an external application from greasemonkey.

For that, you would need a browser plugin.

Patonza
A: 

I don't think you can do that with greasemonkey.

You can setup a handler for certain file types. When Firefox encounters one of those types, it will launch the application associated with the type. You can create a script that returns the phone number and mime type header of text/voip. Have a wrapper application open the file and pass the parameters to the voip app.

This will require your users to install your voip wrapper program. The installer for the voip wrapper should associate itself with text/voip mime types.

How to associate mime types on windows.

Thats how I'd do it.

edit

In PHP the server side code for this might look like

<?
header("Content-Type: text/voip\n");
echo $_REQUEST['phone'];
?>

You would call it like:

<a href="callPhone.php?phone=555-555-5555">Call this number!</a>

it would contain

Content-Type: text/voip (This would only be in the header, you would never see this in the file)
555-555-5555
Byron Whitlock
I like this thinking, but how would i create the voip file, would that have to be done with server side scripting?
g_g
yeah it should be very very simple. When you are listing phone numbers include a link to callApp.php?phone=555-555-5555. callApp.php would set the mime type of text/voip and serve the page with just the phone number text in it. Your wrapper would need to be associated this mime type. The mime type association uses the same mechanism as a file extension association.
Byron Whitlock
Here is a link for associating mime types on windows. http://msdn.microsoft.com/en-us/library/aa266423(VS.60).aspx
Byron Whitlock
Can you give me an example of the html for a link that is specified as mime type text/voip? IE What it should look like, just a snippet
g_g