class

XMPP::Jingle

Inherits Reference / Object

Jingle is a high-level helper for XEP-0166 Jingle sessions used by the file-transfer (XEP-0234) and in-band bytestream (XEP-0261) application descriptions. It builds and parses session-initiate / session-accept stanzas for a single content offer.

jingle = XMPP::Jingle.new(client) offer = jingle.build_offer("peer@example.org", "abc-123", name: "report.pdf", size: 2048_i64) jingle.send_offer(offer)

See: https://xmpp.org/extensions/xep-0166.html https://xmpp.org/extensions/xep-0234.html https://xmpp.org/extensions/xep-0261.html

Constructors

new(client : Client)
Source

Instance methods

build_accept(to : JID | String, initiator : String, sid : String) : Stanza::IQ

build_accept builds a session-accept IQ acknowledging a received offer.

Source
build_offer(to : JID | String, sid : String, name : String, size : Int64 = 0_i64, ibb_block_size : Int32 = 0, initiator_domain : String | Nil = nil) : Stanza::IQ

build_offer builds a session-initiate IQ offering a single file-transfer content. When ibb_block_size is greater than zero an In-Band Bytestream description is added alongside, negotiating a stream over XEP-0047.

Source
build_terminate(to : JID | String, sid : String) : Stanza::IQ

build_terminate builds a session-terminate IQ to end a session.

Source
parse(iq : Stanza::IQ | Nil) : Stanza::Jingle | Nil

parse extracts a Jingle stanza from an IQ response payload.

Source
send_offer(iq : Stanza::IQ, timeout : Time::Span = 5.seconds)

send_offer sends a session-initiate IQ and returns the negotiated content descriptions carried in the response, if any.

Source

Nested types