Since March 10, 2003 - Version 2.1

MSN Messenger Protocol

Switchboard - Authentication

Back To Normal Layout


There are two ways to connect to a switchboard: you can either request a new switchboard session or be invited to an existing one. Both of these events take place on the notification server. When connecting to the switchboard, a client will need to handle the creation of a session (XFR) and being invited (RNG) somewhat differently.

Requesting a Switchboard Session

Notification Server

To request a switchboard session, the client must send the XFR command to the NS with a TrID and a parameter of SB (for switchboard). The server will reply with another XFR with instructions on authenticating with the switchboard. Below is an example:

>>> XFR 15 SB\r\n

<<< XFR 15 SB CKI 17262740.1050826919.32308\r\n

However, if you have not set your initial status, or you are set to HDN, you may not transfer to a switchboard. Instead of receiving an XFR in response to your XFR, you will receive error 913.

Switchboard Server

The client must now initiate a TCP connection to the given switchboard IP on the given port (without closing the NS connection). The connection details are as explained in the Connections page. The client can wait at least two minutes and still connect to the switchboard safely.

Once connected to the switchboard, the client must send the USR command. It must have a TrID, your account name as the first parameter, and the authentication string as the second parameter. This command must be sent within approximately one minute or else the switchboard will close the connection.

If successful, the server will respond with a USR with the same TrID, OK as the first parameter, your account name as the second parameter, and your display name as the third parameter.

Below is an example of logging in correctly:

<o> Client Connects to 1863 (Switchboard)

>>> USR 1 17262740.1050826919.32308\r\n

<<< USR 1 OK Example%20Name\r\n

<o> Continue SB Session . . .

Below is an example of logging with the wrong authentication string:

<o> Client Connects to 1863 (Switchboard)

>>> USR 1 17262740.1050826919.32307\r\n

<<< 911 1\r\n

<o> Switchboard Closes Connection

Now that you are properly authenticated with a switchboard server, you may invite principals as described in the Participants page.

Getting Invited to a Switchboard Session

Notification Server

When a principal invites you to a switchboard session, you will receive an RNG command over the notification server. The official client will automatically connect to a switchboard session and won't open a chat window until a plaintext message is sent, but third party clients may choose to behave differently.

The RNG command has no TrID and five parameters:

Here is an example RNG command:

<<< RNG 11752013 CKI 849102291.520491113 Example%20Name\r\n

The client does not respond to this command. Instead, it opens a new connection to the IP and port given in the second parameter.

Switchboard Server

As with XFR, you should open a TCP connection to the server within two minutes of receiving the RNG command. The first thing you must send is the ANS command. The ANS command has a TrID and three parameters. The first parameter is your account name, the second parameter is the authentication string, and the third parameter is the switchboard session ID.

If successful, the server will respond with one or more IROs followed by an ANS. However, several things can go wrong.

The list of participants already in the switchboard session is sent with the IRO command, which probably stands for "initial roster". A separate IRO will be sent for each participant. Note that you, having just entered, are not included in this list. IRO has the same TrID as the ANS and four parameters.

Because display names reported by the switchboard server can be out-of-date, you should use the display name given to you by the notification server if possible.

After receiving the last IRO (where the incrementing number is the same as the total number), you will receive ANS with the same TrID as the ANS that you sent initially, with the parameter OK. After receiving this, you are officially part of the switchboard session and can send and receive messages.

Below is an example of authenticating with the switchboard and finding out that there are two other principals (making a total of three):

<o> Client Connects to 1863 (Switchboard)

>>> ANS 1 849102291.520491113 11752013\r\n

<<< IRO 1 1 2 Mike\r\n

<<< IRO 1 2 2 My%20Name\r\n

<<< ANS 1 OK\r\n

<o> Continue SB Session . . .

Copyright ©2002-2004 to Mike Mintz.