Tox (Talk Over XMPP, or something) is a utility for adding Jingle
functionality to a Jabber client, primarily voice communication. It
interfaces to the Jabber client using DBus.
To actually get it to compile, you need the Farsight library. If you
use Debian, the packages "libfarsight0.1-dev" and
"gstreamer0.10-plugins-farsight" and their dependencies should be
enough. If you need to compile them yourself, look for Farsight at
http://farsight.freedesktop.org/ and Libjingle at
http://tapioca-voip.sourceforge.net/. Do _not_ use Google's
libjingle.
The DBus interface is described below. From this you should be able
to piece together a Jingle client. Good luck!
Tox registers the well-known name net.sourceforge.emacs-jabber.Tox
(NB: hyphen, not underscore) on the session bus.
/net/sourceforge/emacs_jabber/Tox (NB: underscore, not hyphen) is the
path to the main object.
This object has one method in the interface
net.sourceforge.emacs_jabber.Tox (NB: underscore, not hyphen):
object_path CreateSession(byte direction)
Creates an audio session. direction is 1 for "send only", 2 for
"receive only", and 3 for "send and receive". The path to the new
session is returned.
The session object in turn has methods in the interface
net.sourceforge.emacs_jabber.ToxSession (NB: underscore, not hyphen):
void Destroy()
Destroys the session.
void SetDefaultAudioSink()
Create an "autoaudiosink" GStreamer element and connect it to the
session. This usually means that you will hear things in your
speakers.
void SetOggVorbisAudioSource(string filename)
Set the named Ogg Vorbis file as audio source, i.e. what to send
over the session.
void AddRemoteCandidate(array components)
Add a transport candidate of the remote party, consisting of the
given components. "components" is an array of structs with
signature "(susqsssyyss)" and meaning:
- Candidate ID
- Component (starting from 1)
- IP number (as a string)
- Port number
- Protocol ("tcp" or "udp")
- Protocol subtype (only "RTP" supported)
- Protocol profile (only "AVP" supported)
- Preference, between 0 and 100
- Type. 0 means local, 1 means derived (e.g. through
STUN), 2 means relay
- Username (may be empty)
- Password (may be empty)
signal NewNativeCandidate(array components)
Signalled when a new local candidate has been determined. The
argument is the same as to AddRemoteCandidate.
signal NativeCandidatesPrepared(array components)
Signalled when the local candidates have been determined, and are
ready to send to the other party. The argument is the same as to
AddRemoteCandidate.
void SetRemoteCodecs(array codecs)
Set the codecs that the remote party claims to support. codecs is
an array of structs with signature "(isyuua{ss})" and meaning:
- numeric identifier
- codec name
- media type: 0 is audio, 1 is video
- clock rate
- number of channels
- optional parameters
array GetLocalCodecs()
Get the codecs supported by this implementation. The return value
is of the same type as the argument to SetRemoteCodecs.
array GetCodecIntersection()
Get the intersection of supported codecs of remote and local
parties. The return value is like the argument to SetRemoteCodecs.