Writing a IM/Voip client in 20 lines of python. Raphaël Slinckx



Similar documents
Integrating Video Conferencing into Everyday Applications. Olivier Crête

Open Video Chat: Open Source Development on a Constrained Platform

Business Communicator for Android

By Kundan Singh Oct Communication

Rich Communication Suite Enabler. plus integration with your existing VoIP services

Access to This Tutorial. What is XMPP. Ozgur Ozturk's Introduction to XMPP 1

Developing rich VoIP SIP applications with SIPSIMPLE SDK

White paper. SIP An introduction

Connecting with Vonage

Setting up a reflector-reflector interconnection using Alkit Reflex RTP reflector/mixer

UC-One 2014 R Frequently Asked Questions

BroadTouch Business Communicator for Desktop

How To Use A Presence Desktop On A Pc Or Mac Or Ipad (For A Non-Profit) For Free

District of Columbia Courts Attachment 1 Video Conference Bridge Infrastructure Equipment Performance Specification

IP Voice UNIFI. ipad User Guide

Application Note. Firewall Requirements for the Onsight Mobile Collaboration System and Hosted Librestream SIP Service v5.0

Cisco WebEx Event Center on the Mac OS Getting Started. Join an Event. Schedule an Event. Start an Event. Connect to the Audio Conference

JOIN A complete OTT client framework for desktop and mobile devices

Voice & Video. Conference Calls 4/43

Debian s role in establishing an alternative to Skype

GÉANT: Delivering Global Real-Time Video Communication Services

ENTRYCONTROL. Version Administrator manual for use with ALPHATECH TECHNOLOGIES IP BOLD DoorPhone intercom. For Administrators only

What's New in Sametime 8.5. Roberto Chiabra IBM Certified IT Specialist

Release Notes for NeoGate TE X

Chapter 10 Session Initiation Protocol. Prof. Yuh-Shyan Chen Department of Computer Science and Information Engineering National Taipei University

RCS - Overview. Rich Communication Suite

Android User Guide. IP Voice UNIFI

UC-One. Epik. UC-One Quick Guide. Quick Guide For Apps. Why we love UC-One

Connecting with Free IP Call

RTC:engine. WebRTC SOLUTION SIPWISE AND DEUTSCHE TELEKOM / TLABS ANNOUNCE COOPERATION FOR THE

Polycom RealPresence Desktop for Windows

Mobicents. The Open Source Communication Platform

Application Notes for Revolabs FLX UC 1000 with Avaya IP Office - Issue 0.1

Multi-User Jingle. Sjoerd Simons LCA Collabora Ltd, sponsored by NlNet

A Short Introduction to Android

BroadTouch Business Communicator for iphone

Dial91 Android Edition User Guide

Lumos Networks Business Communicator for PC

CommuniGate Pro Real-Time Features. CommuniGate Pro Internet Communications VoIP, , Collaboration, IM

Streaming multimedia les from relational database

Welcome to XO WorkTime

MyIC setup and configuration (with sample configuration for Alcatel Lucent test environment)

MOBILITY FOR iphone USER GUIDE

Application Notes for BT Wholesale/HIPCOM SIP Trunk Service and Avaya IP Office 8.0 Issue 1.0

Mobicents 2.0 The Open Source Communication Platform. DERUELLE Jean JBoss, by Red Hat 138

P160S SIP Phone Quick User Guide

SPICE and desktop virtualization

Vega 100G and Vega 200G Gamma Config Guide

How To Use A Phoneup On A Cisco Cisco Ip Phone (Unmanageable) On A Pc Or Ip Phone On A Network (Unimpaired) On Your Pc Or Phone (Non-Manage) On An Ip

MiaRec. Cisco Built-in-Bridge Recording Interface Configuration Guide. Revision 1.1 ( )

Configuration Guide for connecting the Eircom Advantage 4800/1500/1200 PBXs to the Eircom SIP Voice platform.

SIP Trunking using Optimum Business SIP Trunk Adaptor and the Panasonic KX-NCP500 IP PBX V2.0502

ABTO Software VoIP SIP SDK for iphone Developer Manual

Application Notes for Biamp AudiaFLEX VoIP-2 with Avaya IP Office Issue 1.0

Maxis BizVoice For iphone User Guide. Version 1.0

iphone User Guide IP Voice UNIFI

SIP Trunking using the Optimum Business SIP Trunk adaptor and the AltiGen Max1000 IP PBX version 6.7

Lab Introduction software Voice over IP

Secured Communications using Linphone & Flexisip

nexvortex Setup Guide

Application Notes for Configuring Cablevision Optimum Voice SIP Trunking with Avaya IP Office - Issue 1.1

Application Notes for Biamp AudiaFLEX VoIP-2 with Avaya Aura Communication Manager Using Avaya Aura SIP Enablement Services Issue 1.

OpenSER the open SIP Server. Bogdan-Andrei Iancu CEO Voice System Co-Founder OpenSER Project

Version 0.1 June Xerox WorkCentre 7120 Fax over Internet Protocol (FoIP)

Sample Configuration for SIP Trunking between Avaya IP Office R8.0 and Cisco Unified Communications Manager Issue 1.0

Application Note. Onsight Connect Network Requirements V6.1

Mac OS X Server ichat Server Administration Version 10.6 Snow Leopard

NTP VoIP Platform: A SIP VoIP Platform and Its Services

Start ichat by clicking on its icon on your dock. You will be asked to enter an AIM screen name (see above) or a.mac member name. Click Continue.

MiaRec. Cisco Built-in-Bridge Recording Interface Configuration Guide. Revision 1.2 ( )

RingCentral Office. Configure Grandstream phones with RingCentral. To contact RingCentral, please visit or call

SMART UC COMMANDER SOFTPHONE. USER GUIDE Version

Getting Started Guide for WebEx Hosts and Presenters. Scheduling a Meeting in Outlook

Need for Signaling and Call Control

Ports Reference Guide for Cisco Virtualization Experience Media Engine for SUSE Linux Release 9.0

ESI SIP Trunking Installation Guide

1st TF-WebRTC meeting. Uninett WebRTC activities Stefan Otto Paris

APTA TransiTech Conference Communications: Vendor Perspective (TT) Phoenix, Arizona, Tuesday, VoIP Solution (101)

Connecting with sipgate

Creating your own service profile for SJphone

SIP Trunking Quick Reference Document

SIP A Technology Deep Dive

Application Notes for Configuring Intelepeer SIP Trunking with Avaya IP Office Issue 1.0

Nokia E65 Internet calls

Protocols for Application and Desktop Sharing

Single Sign-On Framework in Tizen Contributors: Alexander Kanavin, Jussi Laako, Jaska Uimonen

Application Notes for Configuring Broadvox SIP Trunking with Avaya IP Office - Issue 1.0

VoIP Security. Seminar: Cryptography and Security Michael Muncan

Microsoft Office Communicator 2007 Getting Started Guide. Published: July 2007

There are a couple of notes about this however: It is best to have the IP subnet that the VoIP device on be on the same subnet as the DXL Exchanges.

Application Notes for Configuring Avaya IP Office 9.0 with HIPCOM SIP Trunk Issue 1.0

Transcription:

Writing a IM/Voip client in 20 lines of python Raphaël Slinckx

GNOME Communication stack

A good client only needs...

A good client only needs......a few simple things

A good client only needs... Link Local...a few simple things

A good client only needs... Link Local File Transfer...a few simple things

A good client only needs... Link Local Video Calls File Transfer...a few simple things

A good client only needs... Link Local Video Calls NAT Traversal File Transfer...a few simple things

A good client only needs... Link Local OSCAR/AIM Video Calls MSN NAT Traversal File Transfer...a few simple things

A good client only needs... Link Local Presence OSCAR/AIM Video Calls MSN Contact List Smileys NAT Traversal File Transfer...a few simple things

A good client only needs... Link Local Presence OSCAR/AIM Video Calls MSN Contact List Smileys NAT Traversal SIP Yahoo! Voice Calls Jabber File Transfer...a few simple things

A good client only needs... Link Local Presence OSCAR/AIM Video Calls MSN Contact List Smileys NAT Traversal SIP Yahoo! Voice Calls Jabber Nudges!! File Transfer...a few simple things

Each project reinvents the wheel.

Each client lives in its own tiny world.

Telepathy WTF??

1. D-Bus API specification

2. An ecosystem

The big picture Chat UI Logger VoIP UI D-Bus SIP Backend XMPP Backend

The big picture Chat UI Logger VoIP UI Telepathy SIP Backend XMPP Backend

Advantages

Keep the butterfly trapped

Connections are shared Abiword Chat Connection user@gmail.com DBus Desktop Logger

Do one thing and do it well Unix Approved

Language independence Keeps the programmers happy

Language independence Keeps the programmers happy License independence Keeps the lawyers happy

Object-oriented specification

1. The spec

Object hierarchy Connection Managers XMPP CM SIP CM Connections user@ gmail.com contact@ jabber.org +3212345 Channels Text with foo@ gmail.com Text with bar@ gmail.com StreamedMedia with sip:baz@sip.be

Connection Manager

Connection user@gmail.com connected on Google Talk

Presence Interface Get / Set own presence. Get contacts presence.

Capabilities Interface Set own capabilities. Has video? Has voice?

Channels user@gmail.com chatting with contact@gmail.com

Contact List Channel Group Interface Get / Add members. Members changed signal

Text Channel Password Interface Join password protected IRC chatrooms

StreamedMedia Channel DTMF Interface Emit key tones on a SIP conversation

2. The ecosystem

Connection Managers Gabble Salut SIP Idle Jabber XMPP Link Local XMPP (bonjour) IRC

Stream Engine StreamedMedia Channel Signalling NAT Traversal RTP Streaming Audio sink Video sink

Libraries telepathy-python Implement CM and clients in python libtelepathy Implement clients in C+glib telepathy-glib Implement CM in C+glib libempathy Higher level objects to build clients libempathy-gtk GTK widgets to build graphical clients

Desktop integration

Desktop integration Mission Control

Connection Managers XMPP CM SIP CM Connections user@ gmail.com contact@ jabber.org +3212345 Channels Text with foo@ gmail.com Text with bar@ gmail.com StreamedMedia with sip:baz@sip.be

Mission Control Mission Control Connection Managers XMPP CM SIP CM Connections user@ gmail.com contact@ jabber.org +3212345 Channels Text with foo@ gmail.com Text with bar@ gmail.com StreamedMedia with sip:baz@sip.be

Connection aggregation Change my presence from offline to online

Account management Store account credentials centrally. Clients can connect without asking for config

Channel dispatch Open a chat window talking to user@gmail.com

Desktop integration Empathy

Gossip Jabber-only Monolithic

Gossip Telepathy Any Telepathy protocol Monolithic +VoIP support

Empathy Any Telepathy protocol Small components

Same great UI. A lot less hairy code.

Desktop integration Summer of Code

Jokosher Integration Contacts as instruments Live radio interviews with VoIP Michael Sheldon

VoIP/Video Widgets Augment libempathy(-gtk) with VoIP related widgets Elliot Fairweather

File Transfer Add link-local file transfer to empathy Marco Barisione

Collaborative applications Telepathy Tubes

If I can chat with a contact, why can t applications?

What s a tube? Arbitrary data exchange TCP/UDP/D-Bus behavior Perform NAT traversal

D-Bus Tubes Virtual D-Bus GetText() Abiword Abiword GetText() Internet GetText() Abiword GetText() Abiword

D-Bus Tubes Virtual D-Bus CM P2P D-Bus Abiword Abiword P2P D-Bus CM CM P2P D-Bus Abiword Protocol Connections CM P2P D-Bus Abiword

Stream Tubes Virtual TCP/UDP Connection Socket VNC Viewer VNC Server Socket Internet Socket VNC Viewer Socket VNC Viewer

Stream Tubes Virtual TCP/UDP Connection CM Socket VNC Viewer VNC Server Socket CM CM Socket VNC Viewer Protocol Connections CM Socket VNC Viewer

Where to use Tubes? If an application can be used through a D-Bus API

Where to use Tubes? If an application can be used through a D-Bus API It can be shared by exposing the API on a D-Tube

Where to use Tubes? If an application can be used through a D-Bus API It can be shared by exposing the API on a D-Tube Pick a contact, start collaborating!

Code Samples import gtk, empathy libempathy def on_contact_notify(contact): print "Alias:", contact.get_name() print "Presence:", contact.get_status() def on_contact_added(manager, contact): contact.connect('notify', on_contact_notify) manager = empathy.contactmanager() manager.setup() manager.connect("contact-added", on_contact_added) contacts = manager.get_members() for contact in contacts: on_contact_added(manager, contact) gtk.main()

Code Samples libempathy-gtk import gtk, empathy, gtkempathy manager = empathy.contactmanager() manager.setup() store = gtkempathy.contactliststore(manager) view = gtkempathy.contactlistview(store) view.show() w = gtk.window() w.add(view) w.show() gtk.main()

import telepathy, dbus Code Samples libmission-control / Presence applet bus = dbus.bus() mc = bus.get_object( 'org.freedesktop.telepathy.missioncontrol', '/org/freedesktop/telepathy/missioncontrol') mc_presence = dbus.interface(mc, 'org.freedesktop.telepathy.missioncontrol') def on_presence_changed(presence): print "Presence changed to:", presence mc_presence.connect_to_signal("presencestatusactual",presence_changed) mc_presence.setpresence(presence_available, "At GUADEC")

Code Samples telepathy-python / VoIP and Video call import telepathy, dbus bus = dbus.bus() reg = telepathy.client.managerregistry() reg.loadmanagers() mgr = reg.getmanager("gabble") name, path = mgr[conn_mgr_interface].requestconnection( "jabber", "user@gmail.com") connection = telepathy.client.connection(name, path) connection[conn_interface].connect() contact = connection[conn_interface].requesthandles( CONNECTION_HANDLE_TYPE_CONTACT, ["user@gmail.com"])[0]

telepathy-python / VoIP and Video call path = connection[conn_interface].requestchannel( CHANNEL_TYPE_STREAMED_MEDIA, CONNECTION_HANDLE_TYPE_NONE, 0, True) channel = Channel(conn.service_name, path) se = bus.get_object( 'org.freedesktop.telepathy.streamengine', '/org/freedesktop/telepathy/streamengine') se_handler = dbus.interface(se, 'org.freedesktop.telepathy.channelhandler' se_handler.handlechannel( connection.service_name, connection.object_path, CHANNEL_TYPE_STREAMED_MEDIA, channel.object_path, CONNECTION_HANDLE_TYPE_NONE, 0) channel[channel_interface_group].addmembers([contact], "") channel[channel_type_streamed_media].requeststreams( contact, [MEDIA_STREAM_TYPE_AUDIO, MEDIA_STREAM_TYPE_VIDEO])

telepathy-python / VoIP and Video call # When connected connection[conn_interface_capabilities].advertisecapabilities( [(CHANNEL_TYPE_STREAMED_MEDIA, CREATE INVITE)], []) # On incoming channel of type StreamedMedia pending = channel[channel_interface_group].getlocalpendingmembers() channel[channel_interface_group].addmembers(pending, "")

Code Samples telepathy-python / Tubes room = conn.requesthandles( CONNECTION_HANDLE_TYPE_ROOM, ["test@conference.olpc.collabora.co.uk"])[0] tube = conn.request_channel( CHANNEL_TYPE_TUBES, CONNECTION_HANDLE_TYPE_ROOM, room, True) id = tube[channel_type_tubes].offertube( TUBE_TYPE_DBUS, "org.freedesktop.telepathy.tube.connect4", {}) addr = tube[channel_type_tubes].getdbusserveraddress(id) p2pbus = _dbus_bindings.connection(addr)