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!
4. 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
•
6. Manipulating the Skype client II
Control dialogs
•
Focus
•
Silent mode
•
Add items to the
•
Do-more menu
7. Expression
Help users express
•
themselves by controlling:
Mood messages
–
Avatars
–
Online status
–
8. Cross-Platform API
Works by operating system messaging
•
Register for messages
–
Listen for messages
–
Send messages
–
Text-based
•
9. 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
10. Set First Call on Hold ...
-> SET CALL 1540 STATUS ONHOLD
<- CALL 1540 STATUS INPROGRESS
<- CALL 1540 STATUS ONHOLD
.. and make another call!
•
-> CALL echo123
<- CALL 1545 STATUS ROUTING
<- CALL 1545 SUBJECT
<- CALL 1545 STATUS ROUTING
<- CALL 1545 STATUS RINGING
<- CALL 1545 STATUS INPROGRESS
11. 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
12. 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
13. COM-Wrapper
Reduces the
•
complexity of Skype-
based development
– Object-oriented
programming
– Collections
(users, chats, calls,
and much more)
– Objects
– Properties
– Events
14. C# COM Example
SKYPE4COMLib.Skype objSkype;
SKYPE4COMLib.Call objCallOne, objCallTwo;
objSkype = new SKYPE4COMLib.Skype();
objSkype.Attach(7,true);
objCallOne = objSkype.PlaceCall(quot;testquot;,quot;quot;,quot;quot;,quot;quot;);
while (objCallOne.Status != SKYPE4COMLib.TCallStatus.clsInProgress){ }
objCallOne.Hold();
objCallTwo = objSkype.PlaceCall(quot;echo123quot;, quot;quot;, quot;quot;, quot;quot;);
while (objCallTwo.Status != SKYPE4COMLib.TCallStatus.clsInProgress){}
objCallTwo.Join(objCallOne.Id);
15. Coding with the COM API—
A Few Practical Tips
Timeout property
•
• Client object
• Application object
• Skype object
16. Java Wrapper
Java power
•
• Entire wrapper
is open source
• Write once, run on
Windows/Mac/Linux
17. 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(quot;I'm working. Please, wait a moment.quot;);
•
}
•
}
•
});
•
}
•
}
•
18. 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
20. Phone Number Manipulation—PNR
Advanced text parsing algorithm
•
• Phone numbers
Find
–
Validate
–
Analyze
–
ActiveX
•
• Country selectors,
flags and dropdowns
21. Web
• See online
status for any
Skype user
• Presence
information
drives
communication
22. Web Presence—SkypeWeb 1.1
mystatus.skype.com/SkypeUserName
•
Localized in ten languages
•
Five image formats
•
skypeName.mystatus.skype.com DNS query option
•
23. 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-330BCB402664
codebase=quot;http://www.yoursite.com/Skype4COM.dllquot; >
<span style=quot;color: redquot;>Failed to load control.</span>
</object>
</body>
</html>
24. 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
27. Q&A
Contact information:
Peter Kalmström
Skype:peter.kalmstrom.nu
28. Thank you!
Please give your completed session evaluation
to the room monitor as you exit. Your feedback
is extremely valuable to us!
developer.skype.com
Sharing is good
Localization is vital
Certification paths
Questions?
To learn more, visit
pages.ebay.com/devcon/