Skype Development Techniques and Tools

28
Skype Development Techniques and Tools An Overview eBay Developers Program 2007 Peter Kalmström PM Skype Toolbars

description

Peter Kalmstrom. Skype is offering a range of different tools and techniques for developers. Controlling the Skype client via the API, showing presence on the web or building a Skype extra. All will be covered!

Transcript of Skype Development Techniques and Tools

Page 1: Skype Development Techniques and Tools

Skype Development Techniques and ToolsAn Overview

eBay Developers Program 2007

Peter KalmströmPM Skype Toolbars

Page 2: Skype Development Techniques and Tools

Share, Reuse, and Remix This Talk

© 2007 eBay Inc. Some rights reserved.eBay and the eBay logo are among the registered trademarks of eBay Inc., PayPal and the PayPal logo are registered trademarks of PayPal, Inc.,Skype and the Skype logo are trademarks of Skype Limited Corp., Shopping.com and the Shopping.com logo are trademarks of Shopping.com Ltd. Other trademarks and brands are the property of their respective owners.

These slides are available under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

You can blog, photograph, and share this information with others. Don’t forget to tag it ebaydevcon and ebaydevcon07.

Page 3: Skype Development Techniques and Tools

Overview Components

JavaScriptover COM

Webpresence

Page 4: Skype Development Techniques and Tools

Techniques

• Manipulating the Skype client– Cross-platform API– COM-wrapper– Java wrapper– URIs– Phone number manipulation—PNR

• Web– Web presence—SkypeWeb 1.1– Skype COM via javascript– The URIs

• Building a Skype Extra

Page 5: Skype Development Techniques and Tools

Communicating via the Skype Client

Page 6: Skype Development Techniques and Tools

Manipulating the Skype client II

• Control dialogs• Focus• Silent mode

• Add items to the Do-more menu

Page 7: Skype Development Techniques and Tools

Expression

• Help users express themselves by controlling:

– Mood messages– Avatars – Online status

Page 8: Skype Development Techniques and Tools

Cross-Platform API

• Works by operating system messaging– Register for messages– Listen for messages– Send messages

• Text-based

Page 9: Skype Development Techniques and Tools

Make the First Call—API Example

-> CALL test <- CALL 1540 STATUS ROUTING <- CALL 1540 SUBJECT <- CALL 1540 STATUS ROUTING <- CALL 1540 STATUS RINGING <- CALL 1540 STATUS INPROGRESS

Page 10: Skype Development Techniques and Tools

Set First Call on Hold ...

-> SET CALL 1540 STATUS ONHOLD <- CALL 1540 STATUS INPROGRESS <- CALL 1540 STATUS ONHOLD

-> CALL echo123 <- CALL 1545 STATUS ROUTING <- CALL 1545 SUBJECT <- CALL 1545 STATUS ROUTING <- CALL 1545 STATUS RINGING <- CALL 1545 STATUS INPROGRESS

• .. and make another call!

Page 11: Skype Development Techniques and Tools

Join Second Call (1545) into Conference with First Call (1540)

-> SET CALL 1545 JOIN_CONFERENCE 1540 <- CALL 1545 CONF_ID 17930 <- CALL 1545 CONF_ID 17930 <- CALL 1540 CONF_ID 17930

Page 12: Skype Development Techniques and Tools

First Call Is Automatically Resumed and Joined to Conference

<- CALL 1540 STATUS INPROGRESS <- CALL 1540 DURATION 53 <- CALL 1540 STATUS FINISHED <- CALL 1545 DURATION 23 <- CALL 1545 STATUS FINISHED

Page 13: Skype Development Techniques and Tools

COM-Wrapper

• Reduces the complexity of Skype-based development– Object-oriented

programming – Collections

(users, chats, calls, and much more)

– Objects– Properties– Events

Page 14: Skype Development Techniques and Tools

C# COM Example

SKYPE4COMLib.Skype objSkype;SKYPE4COMLib.Call objCallOne, objCallTwo;

objSkype = new SKYPE4COMLib.Skype(); objSkype.Attach(7,true);

objCallOne = objSkype.PlaceCall("test","","","");while (objCallOne.Status != SKYPE4COMLib.TCallStatus.clsInProgress){ }objCallOne.Hold();

objCallTwo = objSkype.PlaceCall("echo123", "", "", "");while (objCallTwo.Status != SKYPE4COMLib.TCallStatus.clsInProgress){}

objCallTwo.Join(objCallOne.Id);

Page 15: Skype Development Techniques and Tools

Coding with the COM API—A Few Practical Tips

• Timeout property• Client object• Application object• Skype object

Page 16: Skype Development Techniques and Tools

Java Wrapper

• Java power• Entire wrapper

is open source• Write once, run on

Windows/Mac/Linux

Page 17: Skype Development Techniques and Tools

Java Example

• package com.skype.sample;

• import com.skype.ChatMessage;• import com.skype.ChatMessageAdapter;• import com.skype.Skype;• import com.skype.SkypeException;

• public class AutoAnswering {• public static void main(String[]args)throws Exception {• Skype.setDeamon(false); // to prevent exiting from this program• Skype.addChatMessageListener(new ChatMessageAdapter() {• public void chatMessageReceived(ChatMessage received)throws SkypeException {• if (received.getType().equals(ChatMessage.Type.SAID)) {• received.getSender().send("I'm working. Please, wait a moment.");• }• }• });• }• }

Page 18: Skype Development Techniques and Tools

URIs

• Since Skype 1.4 skype: links have been supported

• Can be used on any Web page or in any application that supports hyperlinks

• No authorization required• Skype MS Office toolbar + Skype Web

plug-ins only use URIs

Page 19: Skype Development Techniques and Tools

Skype URI Examples

skype: skype:[targets] skype:[targets]?call skype:[skypenames]?chat skype:[skypename]?voicemail skype:[skypename]?add skype:[skypenames]?sendfile skype:[skypename]?userinfo skype:[PSTN]?sms

Page 20: Skype Development Techniques and Tools

Phone Number Manipulation—PNR

• Advanced text parsing algorithm• Phone numbers

– Find– Validate– Analyze

• ActiveX• Country selectors,

flags and dropdowns

Page 21: Skype Development Techniques and Tools

Web

• See online status for any Skype user

• Presence information drives communication

Page 22: Skype Development Techniques and Tools

Web Presence—SkypeWeb 1.1

• mystatus.skype.com/SkypeUserName• Localized in ten languages• Five image formats• skypeName.mystatus.skype.com DNS query option

Page 23: Skype Development Techniques and Tools

Skype COM via Javascript

• Windows-based ActiveX-component• Internet Explorer only• Skype client needs to be installed

<html> <body> <object id=Skype name=Skype height=0 width=0

classid=clsid:830690FC-BF2F-47A6-AC2D-330BCB402664codebase="http://www.yoursite.com/Skype4COM.dll" >

<span style="color: red">Failed to load control.</span> </object> </body> </html>

Page 24: Skype Development Techniques and Tools

Building a Skype Extra

• Skype Extras SDK• Software distribution and DRM-system• Distribute many types of applications

– Exe– DLL– DHTML– Java

• SDK embeds your application into Skype-distribution package

Page 25: Skype Development Techniques and Tools

Skype Extra SDK & Publishing Studio

Page 26: Skype Development Techniques and Tools

Other Tools

• SkypeTracer• Skype icons• Skype strings• SkypeCasts javascript

Page 27: Skype Development Techniques and Tools

Q&AContact information:

Peter KalmströmSkype:peter.kalmstrom.nu

Page 28: Skype Development Techniques and Tools

developer.skype.comSharing is goodLocalization is vitalCertification paths

Questions?To learn more, visitpages.ebay.com/devcon/

Thank you!Please give your completed session evaluation to the room monitor as you exit. Your feedback is extremely valuable to us!