Friday, June 15, 2007

Code status

A lot of refactoring and code cleanup has been done lately.
Curent code status:
The code for sending and receiving iq stanzas is done. We can now make the ping-pong for negotiating a voice call, as it is done in the GTalk protocol. The last TODOs for this seems to be:
  • Handle iq errors
  • Make GUI even more separated:
    - Let voice_node_set_state control the state of the call_dialog
    - Let call_dialog have gboolean - initator/terminator
    - Let voicenode_set_state emit signal and make GUI connect to it
    - Place call_popup and call_dialog_user_input_cb in a seperate file
    - (Make GUI more attractive - just for the fun of it)
  • If user loggs out and we are in conversation - hang up!
  • Free - voicenodes, jids, GUI etc.
  • How do you decide who to call if same id is logged on with more resources?
    Display list of possible resources, check for voice cap. with disco, all/random
    Currently we just take last added resource...
  • Should we not use priority in the xmpp? If we do, we have to extend the blist.c and blist.h again with another field or struct of specialized xmpp stuff.
  • Use timers to timeout connection establishment - we rarely use the ACKs
Besides this,
  • There is some upnp/STUN setup to get public ip address and port forwarding to do
  • We need some SASL functionality to setup a RTP connection
  • We need a closer look on gstreamer (very much in progress right now)
  • Algorithm for determination of codec and network interface must be done
  • We have discussed a logfile functionality instead of printf's as we do now
    Maybe we can use pidgin's own
  • Volume control could be an issue we need to address
Our code until now seems to work stable at the moment. We briefly tried to negotiate with the official GTalk beta client - and it seemed successful where it was expected :-)

Thursday, June 14, 2007

Now with call button

I just managed to create a protocol dependent button. So now there is a "Voice Call" button when you right-click a Jabber buddy, and in the conversion window menu of Jabber buddies.

I was quite simple - but only if you know how!
It has taken many hours to find the functionality in Pidgin API.

When the needed menus are generated a signal is emitted and a pointer to the list of menu items is given. When connecting to this signal we are allowed to add items to the menu list with callbacks to our own plugin code.

Wednesday, June 13, 2007

Resources (again again) and code refactoring

Resources
After trying all possible solutions
(we could think of) to find the peer resource with HEX-append (see previous post) we decided to make a libpurple core patch in order to access the resources directly form the jabber protocol plugin which already tracks them.
When this done we found a much simpler way to hack an account's local resource out of the jabber protocol plugin. This means that we no more need to look at bind stanzas, which anyway had some flaws which we had not addressed yet.

GStreamer
We are currently looking at the gst libraries again. We have done some makefile work for compiling. When it is working - we need to integrate this into the plugin.

Code refactoring - Major voicenode changes.
- Introduction of GList *voicenodes to get rid of global variables
- Implemented dynamic account add/removal to maintain voicenodes
- Figured out user_data callback from GUI.
- Renamed a lot of functions for more clear "namespacing".
- Added utils.h - logfile.h no more nessecary.
- Cleaned up the voicenode data structure -> some functions will now take different parameters (fewer)
- A lot of old obsolete code is placed in obsolete.c
Functionality:
* You can now call another account on the same client.
* Now it is possible to be called from different accounts.
* It seems to work fine. No freeing is done yet.

A lot of progress this week :o)

Monday, June 04, 2007

Core patching pidgin and cleaning up datastructures..

At the moment we are cleaning up the datastructures in our on plugin source. This is done in order to have more than one encoding for content, transport and descriptions. Before that our xmlnode could only contain one of these.

Right now we are also pacthing the pidgin core modules for extending it for XMPP resource handling. This is because we want to be able to get and read the resource for our buddies that logs in and out.

We have changed a couple of pidgin files:

blist.c -- initializing the Glist
blist.h -- implemented the data structure (Glist of resources)

buddy.c -- jabber_buddy_remove_resource and jabber_buddy_track_resource are respectivly used for when a buddy dissappears or appears (used in presence.c) in your buddy list. We have hacked it so we add or remove the given resource to the Glist in the buddy list structure.

I still dont know if we have to change in the discovery module (disc.c) for when doing a discovery.

PS: Note that for every resource a priority is bound. If we want to use it, we also would like to set it explicitly (this is what the jabber protocol does in pidgin).

see http://www.xmpp.org/rfcs/rfc3921.html#rules for more information.