The introduction below is divided into sending and receiving
Now you can create a session. If not, read the previous document again.
1. Send text information
Client sending> MSG 3 N 119/R/n
Mime-version: 1.0/R/n
Content-Type: text/plain; charset = UTF-8/R/n
X-MMS-im-format: fn = Arial; EF = I; CO = 0; cs = 0; pF = 22/R/n
Hello!
Syntax format:
MSG <SP> trid <SP> n <SP> total message length <CRLF>
Mime-version: 1.0 <CRLF>
Content-Type: text/plain; charset = UTF-8 <CRLF>
X-MMS-im-format: fn = parameter FN; EF = parameter EF; CO = parameter Co; cs = parameter Cs; pF = parameter pf <CRLF>
Message Body
MSG and N, indicating to send text information
Total message length, that is, the length of all bytes from mime to message body
Mime-version: 1.0, Fixed Header
Content-Type: text/plain; charset = UTF-8, Fixed Header, UTF-8 indicates message encoding type
X-MMS-im-format: fn = parameter FN; EF = parameter EF; CO = parameter Co; cs = parameter Cs; pF = parameter PF, text information format setting, including font, font size, color, font size, and other information
Message body. This is the text you want to send.
The X-MMS-im-format parameter is described later.
2. Sending input reminder
Client sending> msg 4 U 92/R/n
Mime-version: 1.0/R/n
Content-Type: text/X-msmsgscontrol/R/n
Typinguser: example@hotmail.com/R/n
Syntax format:
MSG <SP> trid <SP> U <SP> total message length <CRLF>
Mime-version: 1.0 <CRLF>
Content-Type: text/X-msmsgscontrol <CRLF>
Typinguser: Passport <CRLF>
MSG and U, indicating sending input reminder
The total length of the message, that is, the length of all bytes from mime to the end
Mime-version: 1.0, Fixed Header
Content-Type: text/X-msmsgscontrol <CRLF>, Fixed Header, specified type
Typinguser: User passport <CRLF>, user passport, refers to the user account
After this message is sent, all users in the same session will receive a notification that the user (example@hotmail.com) is entering.
3. receive text information
Server Response <MSG user01@hotmail.com user01_nickname 119/R/n
Mime-version: 1.0/R/n
Content-Type: text/plain; charset = UTF-8/R/n
X-MMS-im-format: fn = Arial; EF = I; CO = 0; cs = 0; pF = 22/R/n
Hello!
Syntax format:
MSG <SP> User passport <SP> User Name <SP> total message length <CRLF>
Mime-version: 1.0 <CRLF>
Content-Type: text/plain; charset = UTF-8 <CRLF>
X-MMS-im-format: fn = parameter FN; EF = parameter EF; CO = parameter Co; cs = parameter Cs; pF = parameter pf <CRLF>
Message Body
The user passport and the user name indicate the user account and name of the Information sender.
Other parameters are the same as "1. Send text information"
4. receiving input notifications
Server Response <MSG user01@hotmail.com user01_nickname 92/R/n
Mime-version: 1.0/R/n
Content-Type: text/X-msmsgscontrol/R/n
Typinguser: example@hotmail.com/R/n
Syntax format:
MSG <SP> User passport <SP> User Name <SP> total message length <CRLF>
Mime-version: 1.0 <CRLF>
Content-Type: text/X-msmsgscontrol <CRLF>
Typinguser: Passport <CRLF>
The user passport and the user name indicate the user account and name of the Information sender.
Other parameters are the same as "2. Sending an input reminder"
Congratulations, now you can simply implement the MSN function, including logging on to the user, changing the user status, and sending and receiving text information.
However, this is not complete. Other functions will be provided later.