Hack43.Make Calls from Your Web Browser


Hack 43. Make Calls from Your Web Browser

Configure Internet Explorer so that you can make calls directly from a web page or from the browser toolbar.

Works with: Windows version of Skype.

There are three ways in which you can make calls directly from within a web browser. The first method uses the URL prefix skype: (note the missing //, as this method won't work if you include //) to control Skype from within a browser. The second method uses the callto:// URL prefix and can be used in a number of ways to make calls, including from your browser's address bar or from a link embedded in a web page. The third method uses the Skype Toolbar, which is an add-on application for Internet Explorer (and is available for Microsoft Outlook as well) that you can download at http://www.skype.com/products/skypetoolbars/.

4.2.1. skype:

You're probably familiar with URLs such as http://www.oreilly.com/. Now Skype has added its own type of URL, which looks like this: skype:echo123. Entering "skype:echo123" in a browser's address bar will open Skype and call the Skype sound-test service.

The syntax of the skype: URL is somewhat intimidating, but it is not as difficult to use as the following syntax diagram might make it seem, as you will soon see when we try some examples:

 Skype URL   = "skype:" [targets] ["?" query ] ["#" fragment ] targets     = 1* (target / ";" ) target      = identity / PSTN identity    = skypename / alias skypename   = 1*(ALPHA / DIGIT / "." / "," ) skypenames  = 1*( skypename / ";") alias       = … ; see ["TechGroup/DataFormats"]                    ; unicode chars are in UTF-8 and % encoded                    ; see RFC3987 uchar mapping PSTN        = "+" (DIGIT / ALPHA ) *(DIGIT / ALPHA / "-" )                    ; PSTN supports +800-FLOWERS query       = action [ *( "?" term "=" conditon ) ] term        = 1*ALPHA condition   = 1*unserved ; to be clarified by Skype fragment    = 1*unserved ; to be clarified by Skype 

Note that skype: won't work with speed-dial numbers. For example, skype:7?call, where 7 is an existing speed-dial number, won't work.


skype: is quite powerfuland quite simple in practiceas the examples in Table 4-1 show. To try these examples, open a browser window and enter them in the address bar, then press Return.

Table 4-1. Examples of how to use skype: from a web browser

skype: URL

What it does

skype:echo123

Calls or chats with Skype's sound-test service (it does one or the other depending on what you have set double-click to do)

skype:echo123?call

Calls Skype's sound-test service

skype:+442075551212?call

Calls a regular phone number (you must be a SkypeOut subscriber for this to work)

skype:echo123?chat

Chats with Skype's sound-test service

skype:skypehackslinux?voicemail

Leaves voicemail for Skype user skypehackslinux

skype:skypehackslinux?add

Adds skypehackslinux to your Contacts list

skype:skypehackslinux?sendfile

Opens the File Send dialog to select a file to send to skypehackslinux

skype:skypehackslinux?userinfo

Shows a profile for skypehackslinux

skype:?chat& id=2005-09-02T12:00:00TZ

Opens an existing chat session having the ID specified (YYYY-MM-DDThh:mm:ssTZ or YYYY-MM-DDZhh:mm:ss)

skype:

Focuses Skype (brings the Skype window to the foreground and gives it focus)


Not only can you enter the URLs in Table 4-1 into a browser's address bar to make them work, but you also can embed them in HTML/XHTML, as the following XHTML file, skype.htm, illustrates. If you load this file in a browser and click on the "Call echo123" link, Skype will open and call the Skype sound-test service (echo123). However, before you start including skype: links in all your web pages, you should be aware that they only work for browsers on machines that run Skype and that know how to handle skype: style URLs. If a user on a non-Skype machine clicks on a skype: link, it certainly won't work and will most likely be treated as an error, as shown in Figure 4-1.

Figure 4-1. Entering a skype: style URL or clicking on a skype: link in a web page on a machine that doesn't know how to handle skype: URLs will result in an error


 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- File: skype.htm --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">    <head>       <title>skype: URL</title>    </head>    <body>       <p><a href="skype:echo123?call">          Skype's sound test service (echo123)</a>       </p>    </body> </html> 

You can even enter skype: URLs from the run line (but not from the command prompt window), and from the Windows Explorer address bar! For example, select Start Run …, enter "skype:echo123?chat, and press Enter or click OK. A chat window will open, enabling you to chat with Skype's sound-test service (echo123). Entering the same URL in the Windows Explorer address bar will achieve the same result.

4.2.2. callto://

When you enter a web address such as http://www.oreilly.com in your browser address bar, you are instructing the browser to use the HyperText Transfer Protocol (HTTP) to access the O'Reilly web site. Similarly, when you enter the web address callto://echo123, you are in effect telling the browser to do something with "callto," and what it does depends on how your browser is configured. This is because "callto" can be interpreted in many different ways.

When you install Skype on Windows, you are given the choice to associate callto:// with Skype. However, if you failed to make that choice during installation, or if callto:// simply isn't working properly, you can easily fix it using one of two methods.

First, select Skype Tools Options… Advanced, and then under the Other category check the "Associate Skype with callto: links checkbox. If that fails to work for you, you may want to try the second method (a third method uses the Windows registry, but I don't recommend it).

Second, from within Windows Explorer (the file browser that comes with Windows), select Tools Folder Options… and in the dialog that opens click on the File Types tab. Scroll down the list of file types until you find URL: CallTo Protocol; highlight it, and then click on the Advanced button. In the Edit File Type dialog that opens, highlight the "open action and click Edit…. That will open the dialog shown in Figure 4-2. Under "Application used to perform action," enter the command C:\Program Files\Skype\Phone\Skype.exe "/callto:%1" (replacing the path to Skype.exe with your own, if required). Click OK, and now, any time Internet Explorer (or, indeed, Windows Explorer) encounters callto://, it will pass the request on to Skype.

After setting up callto:// in this manner, you can use it to make calls in a number of different ways. The choice is yours.


Internet Explorer (or other browser)

Enter callto://Skypename in the address bar and press Enter or click Go.


Windows Explorer

Enter callto://Skypename in the address bar and press Enter or click Go.

Figure 4-2. Configuring callto:// so that it uses Skype


Run…

Select Start Run…, enter Web-page link

Any web page with a callto://Skypename link embedded in it forms a hyperlink that you can click on to start a call using Skype. If you want to include such links in your own web pages, the following XHTML example will show you how:

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- File: callto.htm --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">    <head>       <title>Skype Callto</title>    </head>    <body>       <p><a href="callto://echo123">Call echo123</a></p>    </body> </html> 

Skypename can be a Skype username or, if you are a SkypeOut subscriber, a regular telephone number.

4.2.3. Skype Toolbar

This neat add-on for Internet Explorer provides the following useful features, all of them available without leaving your browser:

  • It recognizes phone numbers and provides a phone icon you can click on to make a calleven for phone numbers that aren't callto:// links (see Figure 4-3).

  • It lets you add phone numbers on web pages to your Contacts list.

  • It lets you call and chat to existing contacts.

  • It lets you change your online status.

  • If you're a SkypeOut subscriber, it displays your remaining credit.

All this functionality is packed into a surprisingly small space on your Internet Explorer toolbar (see Figure 4-4). And best of all, the Skype Toolbar is free.

Figure 4-3. Fragment of a web page showing how the Skype Toolbar makes calling easy from web pages with phone numbers


Figure 4-4. The Skype Toolbar





Skype Hacks
Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service
ISBN: 0596101899
EAN: 2147483647
Year: 2005
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net