XMPP For The Web/Win ::: XMPP-FTW (1.18.0) Flattr this

XEP-0166 Jingle

Introduction

The inclusion of a jingle module early in the life of this project was primarily to enable the use of XMPP as a ignalling server for webRTC. Amazing gains in this area were made by Philip Hancke and Lance Stout resulting in interoperable signalling systems for webRTC over XMPP.

XMPP-FTW was soon added to the list of interoperable libraries for signalling webRTC calls. If you wish to use xmpp-ftw-jingle for webRTC calls then this is the first module for which I would recommend a client-side library. This library is jingle.js by Lance Stout. It handles generating the required JSON from SDP and the handling of the webRTC sessions. If you prefer a more DIY approach then the sdp-jingle-json library (again from Lance) upon which jingle.js builds will be of great use.

If you'd like to experiment with webRTC using xmpp-ftw then please visit the webRTC demo page and its source code.

Initiating a P2P connnection

A jingle session can be initiated using `xmpp.jingle.request` as follows:

    socket.send(
        'xmpp.jingle.request',
        {
            "to": "megan@evilprofessor.co.uk/desktop",
            "jingle": {
                contents: [
                    {},
                    {},
                    sid: "session-id",
                    action: "session-initiate",
                ]
            },
         /* "type": "set", */
        }
    )
    

A `type` of error or an `error` key will result in error stanza being sent. A `type` of result will result in an result stanza being sent.

For the error and result cases above a `jingle` key is not required.

The above example will generate the stanza from example 1 in the jingle XEP.

Pages

Fork me on GitHub