Blog for developers

this is a blog about me (?)

About me

User: pluto

  • Contact me
  • My profile
  • Linkme

Recent comments

howard on Motime v7.0 ready!

Links

mo'time


Counter

visited *loading* times

Sunday, 28 August 2005
Google Talk voice protocol disclosed!

Just experimenting how to make any xmpp client capable of understanding google proprietary voip protocol. At start, to make the google talk client think that your xmpp client is voip capable, it is enough to send a presence as such:

<presence to="originatingparty@gmail.com/Talk.v64EC3F606D" >
<status/>
<priority>0</priority>
<c xmlns="http://jabber.org/protocol/caps" node="http://www.google.com/xmpp/client/caps" ext="voice-v1" ver="1.0.0.64" />
<x xmlns="jabber:x:delay" stamp="20050828T17:14:25" />
</presence>

Soon the google client receives that, it shows the "phone" icon at the right of the contact-nickname.

When google talk starts a telephone call, it sends an iq as such:

<iq from="originatingparty@gmail.com/Talk.v64EC3F606D" type="set" id="21" >
<session xmlns="http://www.google.com/session" initiator="originatingparty@gmail.com/Talk.v64EC3F606D" type="initiate" id="3688330360" >
<description xmlns="http://www.google.com/session/phone">
<payload-type id="103" name="ISAC" />
<payload-type id="97" name="IPCMWB" />
<payload-type id="102" name="iLBC" />
<payload-type id="4" name="G723" />
<payload-type id="100" name="EG711U" />
<payload-type id="101" name="EG711A" />
<payload-type id="0" name="PCMU" />
<payload-type id="8" name="PCMA" />
<payload-type id="13" name="CN" />
</description>
</session>
</iq>

This packet has two functions:
- maybe specify the codec it understands
- verify that the other party is really capable of doing voip
In fact the client receiving the call has to send this iq soon before a short timeout ends:

<iq to="originatingparty@gmail.com/Talk.v64EC3F606D" type="result" id="aaad"  />

Without waiting for the user to press on the "Accept" button, each client exchanges with the other such an information:

<iq from="originatingparty@gmail.com/Talk.v64EC3F606D" type="set" id="60" to="ppippero@gmail.com/Talk.v64ED37AA3E" >
<session xmlns="http://www.google.com/session" initiator="originatingparty@gmail.com/Talk.v64EC3F606D" type="candidates" id="3688330360" >
<candidate protocol="udp" preference="0.9" port="4123" password="kuyxAgKfRZcteQWf" address="217.201.14.129" network="2" username="1T0ThiQiPQkWj/Qe" generation="0" type="stun" name="rtp" />
</session>
</iq>

<iq from="originatingparty@gmail.com/Talk.v64EC3F606D" type="set" id="59" to="ppippero@gmail.com/Talk.v64ED37AA3E" >
<session xmlns="http://www.google.com/session" initiator="originatingparty@gmail.com/Talk.v64EC3F606D" type="candidates" id="3688330360" >
<candidate protocol="udp" preference="1" port="4126" password="4k6c4IZUOTY8pCKl" address="192.168.152.1" network="4" username="dPq07nMRccpHLZML" generation="0" type="local" name="rtp" />
</session>
</iq>

Note that some ports are declared as local, some other as stun. That's all for now ;-).  Ah, the transport protocol appears to be RTP: I will just grabbing some traffic with ethereal and check if it is really simple RTP.

posted by: pluto at 18:02 | link | comments (2) |
xmpp, jabber, voip, google talk


Comments:
#1  29 August 2005 - 08:11
 
Do not, ever, send this caps element in another client to mimick its behaviour.
Read JEP-0115 why, but I'll explain below how it should work:

The idea is a caps element has the 'node' attribute that stands for a certain client 'brand', the 'ver' attribute for a specific version. A client that receives such an element, should send a disco (JEP-0030) query to the originating client to determine the supported features. The result should always be the same for each 'brand'/'ver' combination.

Then, if the client also has some dynamic behaviour with regard to supported features (for example, by way of plugins or features that can be turned on and off), those features can be announced in the 'ext' attribute. Note that all the identifiers are opaque and specific to a certain 'node'. For each 'ext' attribute, separate disco requests can be made to determine the associated features.

Now, I suspect that Google doesn't actually do the discoing. And this is because a client that receives the exact same 'node'/'ver' combination it would send itself (same client), it would already know the feature set. A client must never do the disco-ing in this case. This of course excluding the 'ext' features.

I don't know if Google Talk does indeed implement disco, but try that. If it responds with a certain feature set, see what that is. The 'ext' element suggests the voice stuff is optional, so you might have to disco separately for that.

If discoing works, implement responding their features to a disco request, along with your own caps element. Read JEP-0115 on how it should work in detail.

Let me know about your findings (via jdev, for example).
Anonymous
#2  17 September 2006 - 12:57
 
testing comments
User: howard Contact me View user's mediablog howard
Comments: