Hack Skype to Make Phone Calls Directly From Your Web Browser

7
Excerpted from the book, "Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service", by Andrew Sheppard, published by O'Reilly Media Inc. ISBN 0-596-10189-9. Copyright 2005. Used by permission.

Transcript of Hack Skype to Make Phone Calls Directly From Your Web Browser

Page 1: Hack Skype to Make Phone Calls Directly From Your Web Browser

Excerpted from the book, "Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service", by Andrew Sheppard,published by O'Reilly Media Inc. ISBN 0-596-10189-9. Copyright 2005. Used by permission.

Page 2: Hack Skype to Make Phone Calls Directly From Your Web Browser

Make Calls from Your Web Browser #43

Chapter 4, Tweak and Tune Skype | 113

HACK

H A C K

#43Make Calls from Your Web Browser Hack #43

Configure Internet Explorer so that you can make calls directly from a webpage 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 webbrowser. The first method uses the URL prefix skype: (note the missing //, asthis method won’t work if you include //) to control Skype from within abrowser. The second method uses the callto:// URL prefix and can be used ina number of ways to make calls, including from your browser’s address baror from a link embedded in a web page. The third method uses the SkypeToolbar, which is an add-on application for Internet Explorer (and is avail-able for Microsoft Outlook as well) that you can download at http://www.skype.com/products/skypetoolbars/.

skype:You’re probably familiar with URLs such as http://www.oreilly.com/. NowSkype 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 andcall the Skype sound-test service.

The syntax of the skype: URL is somewhat intimidating, but it is not as diffi-cult to use as the following syntax diagram might make it seem, as you willsoon 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

,ch04copy.792 Page 113 Wednesday, November 2, 2005 3:44 PM

Excerpted from the book, "Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service", by Andrew Sheppard,published by O'Reilly Media Inc. ISBN 0-596-10189-9. Copyright 2005. Used by permission.

Page 3: Hack Skype to Make Phone Calls Directly From Your Web Browser

114 | Chapter 4, Tweak and Tune Skype

#43 Make Calls from Your Web BrowserHACK

Note that skype: won’t work with speed-dial numbers. Forexample, skype:7?call, where 7 is an existing speed-dial num-ber, won’t work.

skype: is quite powerful—and quite simple in practice—as the examples inTable 4-1 show. To try these examples, open a browser window and enterthem in the address bar, then press Return.

Not only can you enter the URLs in Table 4-1 into a browser’s address bar tomake them work, but you also can embed them in HTML/XHTML, as the fol-lowing XHTML file, skype.htm, illustrates. If you load this file in a browserand click on the “Call echo123” link, Skype will open and call the Skypesound-test service (echo123). However, before you start including skype: linksin all your web pages, you should be aware that they only work for browserson 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’twork and will most likely be treated as an error, as shown in Figure 4-1.

<?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 -->

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 whatyou 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 aSkypeOut subscriber for this to work)

skype:echo123?chat Chats with Skype’s sound-test service

skype:skypehackslinux?voicemail Leaves voicemail for Skype user skypehack-slinux

skype:skypehackslinux?add Adds skypehackslinux to your Contacts list

skype:skypehackslinux?sendfile Opens the File Send dialog to select a file tosend 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 IDspecified (YYYY-MM-DDThh:mm:ssTZ orYYYY-MM-DDZhh:mm:ss)

skype: Focuses Skype (brings the Skype window tothe foreground and gives it focus)

,ch04copy.792 Page 114 Wednesday, November 2, 2005 3:44 PM

Excerpted from the book, "Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service", by Andrew Sheppard,published by O'Reilly Media Inc. ISBN 0-596-10189-9. Copyright 2005. Used by permission.

Page 4: Hack Skype to Make Phone Calls Directly From Your Web Browser

Make Calls from Your Web Browser #43

Chapter 4, Tweak and Tune Skype | 115

HACK

<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 com-mand prompt window), and from the Windows Explorer address bar! Forexample, select Start ➝ Run..., enter “skype:echo123?chat”, and press Enteror click OK. A chat window will open, enabling you to chat with Skype’ssound-test service (echo123). Entering the same URL in the WindowsExplorer address bar will achieve the same result.

callto://When you enter a web address such as http://www.oreilly.com in yourbrowser address bar, you are instructing the browser to use the HyperTextTransfer Protocol (HTTP) to access the O’Reilly web site. Similarly, whenyou enter the web address callto://echo123, you are in effect telling thebrowser to do something with “callto,” and what it does depends on howyour browser is configured. This is because “callto” can be interpreted inmany different ways.

When you install Skype on Windows, you are given the choice to associatecallto:// with Skype. However, if you failed to make that choice during instal-lation, or if callto:// simply isn’t working properly, you can easily fix it usingone of two methods.

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

,ch04copy.792 Page 115 Wednesday, November 2, 2005 3:44 PM

Excerpted from the book, "Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service", by Andrew Sheppard,published by O'Reilly Media Inc. ISBN 0-596-10189-9. Copyright 2005. Used by permission.

Page 5: Hack Skype to Make Phone Calls Directly From Your Web Browser

116 | Chapter 4, Tweak and Tune Skype

#43 Make Calls from Your Web BrowserHACK

First, select Skype ➝ Tools ➝ Options... ➝ Advanced, and then under theOther category check the “Associate Skype with callto: links” checkbox. Ifthat fails to work for you, you may want to try the second method (a thirdmethod uses the Windows registry, but I don’t recommend it).

Second, from within Windows Explorer (the file browser that comes withWindows), select Tools ➝ Folder Options... and in the dialog that opensclick on the File Types tab. Scroll down the list of file types until you findURL: CallTo Protocol; highlight it, and then click on the Advanced button.In the Edit File Type dialog that opens, highlight the “open” action and clickEdit.... That will open the dialog shown in Figure 4-2. Under “Applicationused to perform action,” enter the command C:\Program Files\Skype\Phone\

Skype.exe "/callto:%1" (replacing the path to Skype.exe with your own, ifrequired). Click OK, and now, any time Internet Explorer (or, indeed, Win-dows 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 anumber 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 ExplorerEnter callto://Skypename in the address bar and press Enter or click Go.

Run…Select Start ➝ Run..., enter callto://Skypename, and press Enter or clickOK.

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

,ch04copy.792 Page 116 Wednesday, November 2, 2005 3:44 PM

Excerpted from the book, "Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service", by Andrew Sheppard,published by O'Reilly Media Inc. ISBN 0-596-10189-9. Copyright 2005. Used by permission.

Page 6: Hack Skype to Make Phone Calls Directly From Your Web Browser

Make Calls from Your Web Browser #43

Chapter 4, Tweak and Tune Skype | 117

HACK

Web-page linkAny web page with a callto://Skypename link embedded in it forms ahyperlink that you can click on to start a call using Skype. If you want toinclude such links in your own web pages, the following XHTML exam-ple 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, aregular telephone number.

Skype ToolbarThis neat add-on for Internet Explorer provides the following useful fea-tures, all of them available without leaving your browser:

• It recognizes phone numbers and provides a phone icon you can clickon to make a call—even 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 InternetExplorer toolbar (see Figure 4-4). And best of all, the Skype Toolbar is free.

,ch04copy.792 Page 117 Wednesday, November 2, 2005 3:44 PM

Excerpted from the book, "Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service", by Andrew Sheppard,published by O'Reilly Media Inc. ISBN 0-596-10189-9. Copyright 2005. Used by permission.

Page 7: Hack Skype to Make Phone Calls Directly From Your Web Browser

118 | Chapter 4, Tweak and Tune Skype

#43 Make Calls from Your Web BrowserHACK

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

Figure 4-4. The Skype Toolbar

,ch04copy.792 Page 118 Wednesday, November 2, 2005 3:44 PM

Excerpted from the book, "Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service", by Andrew Sheppard,published by O'Reilly Media Inc. ISBN 0-596-10189-9. Copyright 2005. Used by permission.