Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
understanding-SIP.pdf
Скачиваний:
113
Добавлен:
01.03.2016
Размер:
3.99 Mб
Скачать

Presence and Instant Messaging

209

Content-Type: application/im-iscomposing+xml

Content-Length: ...

<?xml version=”1.0” encoding=”UTF-8”?>

<isComposing xmlns=”urn:ietf:params:xml:ns:im-iscomposing” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”urn:ietf:params:xml:ns:im-composing iscomposing.xsd”>

<state>active</state>

<contenttype>text/plain</contenttype>

<refresh>90</refresh>

</isComposing>

The Content-Type: application/im-iscomposing+xml header field indi-

cates that this message is a message composition indication. The composing state is conveyed in the <isComposing> element where the <state> element has the value active. The <contenttype> element indicates that the content being composed is text. The receipt of this message could be used to display an indication of “istyping” to the user for a short period of time, after which the indication times out and the state returns to idle.

8.5.5Multiple Recipient Messages

An extension allows an instant message to carry a recipient list [29]. An intermediary server known as a relay or exploder can take such a request and replicate the instant messaging to the recipients in the list. This operation is shown in Figure 8.9.

For example:

Figure 8.9 Multiple recipient messages example.

210 SIP: Understanding the Session Initiation Protocol

MESSAGE sip:nancy-list@csiro.au SIP/2.0

Via: SIP/2.0/TCP unimelb.csiro.au;branch=z9hG4bKhs8asdLs83 Max-Forwards: 70

To: <sip:nancy-list@csiro.au>

From: Nancy Tyson Burbidge <sip:nancy.burbidge@csiro.au> ;tag=Kjd32331

Call-ID: 8uF2sflFSsa CSeq: 98712 MESSAGE

Require: recipient-list-message

Content-Type: multipart/mixed;boundary=”boundary2” Content-Length: 501

--boundary2 Content-Type: text/plain

Hello Everybody!

--boundary2

Content-Type: application/resource-lists+xml Content-Disposition: recipient-list

<?xml version=”1.0” encoding=”UTF-8”?>

<resource-lists xmlns=”urn:ietf:params:xml:ns:resource-lists” xmlns:cp=»urn:ietf:params:xml:ns:copycontrol”>

<list>

<entry uri=”sip:caroline.atkinson@smh.com.au” cp:copyControl=”to” />

<entry uri=”sip:egould@ramsgate.kent.uk” cp:copyControl=”to” <entry uri=”sip:gmolloy@botanicals.org” cp:copyControl=”cc”/> <entry uri=”sip:jasminb@clearwater.tx.us” cp:copyControl=”cc” </list>

</resource-lists> --boundary2--

This MESSAGE has a multipart/mixed body which consists of a Content-

Type: text/plain instant message followed by a Content-Type: application/

resource-lists+xml body, which contains a list. Note that this list format is the same as that used in SUBSCRIBE requests creating resource lists. The copyControl attribute is defined in [26], which allows for the values of to, cc, or bcc that have the same meaning as in e-mail.

8.5.6Session Mode Instant Messaging

The Message Session Relay Protocol (MSRP) [30] was developed to meet the needs of a session mode IM system. For this case, the use of the SIP MESSAGE method was determined to be suboptimal. As a result, this is a non-SIP protocol. MSRP uses a SIP offer/answer exchange to establish the MSRP session using SDP. MSRP messages are either SEND requests, which carry a message or a REPORT request which reports on the status of a previous message. MSRP allows large messages to be sent by breaking the message into chunks which are sent in separate SEND requests. MSRP uses a stream-based transport such as TCP. As a result,

 

Presence and Instant Messaging

211

 

Table 8.7

 

 

 

MSRP Header Fields

 

 

Header

Specification

 

 

 

 

 

 

To-Path

RFC 4975

 

 

From-Path

RFC 4975

 

 

Message-ID

RFC 4975

 

 

Success-Report

RFC 4975

 

 

Failure-Report

RFC 4975

 

 

Byte-Range

RFC 4975

 

 

Status

RFC 4975

 

 

Expires

RFC 4976

 

 

Min-Expires

RFC 4976

 

 

Max-Expires

RFC 4976

 

 

Use-Path

RFC 4976

 

 

WWW-Authenticate

RFC 4976

 

 

Authorization

RFC 4976

 

 

Authentication-Info

RFC 4976

 

it must provide its own framing. MSRP defines its own URI scheme, which is used when negotiating the session. For example, an SDP offer used to establish an MSRP session:

v=0

o=nancy 2890844526 2890844527 IN IP4 unimelb.csiro.au s=-

c=IN IP4 unimelb.csiro.au t=0 0

m=message 7344 TCP/MSRP * a=accept-types:text/plain a=path:msrp://unimelb.csiro.au:27394/Kdsa2s93i9a;tcp

The media line contains the message media type while TCP/MSRP indicates that MSRP protocol will be used over TCP. An example MSRP exchange is shown in Figure 8.10.

MSRP has defined a number of header fields, listed in Table 8.7, and uses error codes shown in Table 8.8. Table 8.9 lists MSRP message types.

The use and operation of relay with MSRP is defined in [31]. These relays can be used for NAT traversal, logging, and corporate compliance. With MSRP relays, a mechanism for discovery and authentication is defined. An approach to establish MSRP sessions through NATs that uses standard ICE mechanisms is defined in [35]. The usage of MSRP in a multiuser chat is described in [34], which also defines a new MSRP request NICKNAME used to set a temporary name, known as a nickname, which can be used as an alias during the multiuser chat session. MSRP multiuser chat uses CPIM messages and the CPIM header to identify the recipient. The recipient can either be the entire chat room or it can

212

 

 

 

SIP: Understanding the Session Initiation Protocol

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 8.10 MSRP session example.

Table 8.8

MSRP Error Codes

Code Meaning

200 Successful transaction

400Request failed

401Authorization credentials needed

403Request not allowed

408

Timeout

413

Stop sending

415

Unknown media type

423

Parameter out of bounds

481

Session does not exist

501

Method not understood

506

Session already in use

be a single participant, in which case it is a private message addressed to a particular nickname.

Table 8.10 lists the common content types in instant messaging.