Not logged in. · Lost password · Register
Forum: agsXMPP RSS
How do I work with AIM Transport
Avatar
KerrAvon #1
Member since Dec 2008 · 5 posts · Location: York, PA
Group memberships: Members
Show profile · Link to this post
Subject: How to work with AIM Transport
My partner and I are building our own Jabber client and I have a couple of questions regarding how to talk to the AIM Transport.

For registering our AIM account on the Transport, I am doing the following:

  Dim riq As New RegisterIq(IqType.[set], New Jid("aim." & System.Net.Dns.GetHostEntry(My.Application.strServer).HostName))

                If riq.Type = IqType.set Then
                    riq.Query.AddTag("username", My.Application.strAIMUserID)
                    riq.Query.AddTag("nick", String.Empty)
                    riq.Query.AddTag("password", My.Application.strAIMPW)

                    _connection.Send(riq)
                End If

This is based on how I see spark sending it's registration info to the AIM Transport.  It works, however I also get an "AIM Transport" user on my Roster that appears to be my AIM Transport.  I obviously do not want that there.

Also, I cannot figure out how to send my presence info to only my AIM Transport.  How do you send presence information to only one JID and not all?

Any help would be appreciated.
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by KerrAvon:
Dim riq As New RegisterIq(IqType.[set], New Jid("aim." & System.Net.Dns.GetHostEntry(My.Application.strServer).HostName))

this is wrong, you find out the Jid of the transport running on your server over service discovery (disco).

Quote by KerrAvon:
                If riq.Type = IqType.set Then
                    riq.Query.AddTag("username", My.Application.strAIMUserID)
                    riq.Query.AddTag("nick", String.Empty)
                    riq.Query.AddTag("password", My.Application.strAIMPW)

                    _connection.Send(riq)
                End If

you have to sent an RegisterIq of type get to the transport. The transport will send you the registration form which you to fill out and send back.
After the registration was successful the server automatically publishes your presence to the transport and transport contacts on each login and presence change.

Alex
Avatar
KerrAvon #3
Member since Dec 2008 · 5 posts · Location: York, PA
Group memberships: Members
Show profile · Link to this post
this is wrong, you find out the Jid of the transport running on your server over service discovery (disco).

Could you please provide me with an example of how I would do that.

you have to sent an RegisterIq of type get to the transport. The transport will send you the registration form which you to fill out and send back.
After the registration was successful the server automatically publishes your presence to the transport and transport contacts on each login and presence change.

I know I have to send it the UserName and the Password.  This code works it's just that it also adds an AIM Transport to my Roster.  When I looked at my debug window in Spark, this is what it was sending.  If I send a RegisterIQ of Get to the transport, how is that returned?  Again, if you have sample code, it would be much appreciated.

Don't worry about it being C# or VB, I can translate.
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi KerrAvon,

yes you code may work, but:
  • Without sending a RegisterIq of type get before its wrong according to the rules in XMPP and normally should not work, so it may be an edge case when it works
  • you are using the old jabber style registration, all new servers and transports are using xdata forms for registration which means your code is not flexible enough to work with different servers, transports or any other gateways which offer a feature for some kind of registration.

Please read XEP-0077 In-Band-Registration. We should have some IBB code on our file server. I will look later for this code and attach it to my post when I can find it.

Alex
Avatar
KerrAvon #5
Member since Dec 2008 · 5 posts · Location: York, PA
Group memberships: Members
Show profile · Link to this post
Okay, I figured out how to use service discovery to get the aim transport jid and I have written the iq get type.  This is what it returns:

<iq xmlns="jabber:client" from="aim.itclx05.itc.ra.riteaid.us" to="prgrjb@itclx05.itc.ra.riteaid.us/DrChat" type="result" id="agsXMPP_13">
    <query xmlns="jabber:iq:register"><x xmlns="jabber:x:data" type="form">
        <instructions>Please enter your AIM ScreenName and password.</instructions>
        <field label="ScreenName" var="username" type="text-single" />
        <field label="Password" var="password" type="text-private" />
        </x><instructions>Please enter your AIM ScreenName and password.</instructions>
            <username />
            <password />
        <x xmlns="jabber:iq:gateway:register" />
    </query>
</iq>

How to do I respond to this?  From what I can read in the information you gave me, I still have to send a set IQ to respond to this?
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In the Xml you posted above there is a xdata form. You have to show this form to the user. This can be done with the xdata control in agsXMPP.ui.
I attached the MiniClient Register example which we wrote a while ago. Its using an old version of agsXMPP, you it may not compile without some minor changes.

Alex
The author has attached one file to this post:
MiniClientVB_Register.zip 29.6 kBytes
You have no permission to open this file.
Avatar
KerrAvon #7
Member since Dec 2008 · 5 posts · Location: York, PA
Group memberships: Members
Show profile · Link to this post
Thank you so much for your help and I was able to get the form to display and was able to register my information with the AIM Transport.

However, I am still getting an entry on my Roster called AIM Transport in the Transport Group.  How do I prevent that from being added or does it have to be there and I should somehow just hide it.
Avatar
Alex #8
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
if the transports is build on top of the XMPP component protocol and not directly build into the server there is no way to get rid of the transport as a rosteritem.

Why? Because the transport needs your presence to log you in AIM when you come available and change your presence on AIM when you change your XMPP presence, also log you off when you become unavailable. This works for external transports only with roster and presence subscriptions.

What some clients do is having a special group names Hidden which gets hidden in the client. You can also disco the server and find out which Jids are transports and show this Jids not in the roster but somewhere es in your GUI.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS