<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc='yes'?>
<?rfc tocdepth='4'?>
<?rfc compact="yes"?>

<rfc category="info" docName="draft-yan-siprec-msrp-recording-01" ipr="trust200902">
	<front>
		<title abbrev="Overview for MSRP Recording">Overview for MSRP Recording based on SIPREC</title>
		<author initials="M." surname="Yan" fullname="Michael Yan">
			<organization>Huawei</organization>
			<address>
				<email>michael.yan@huawei.com</email>
			</address>
		</author>
		<author initials="P." surname="Kyzivat" fullname="Paul H. Kyzivat">
			<organization>Huawei</organization>
			<address>
				<email>pkyzivat@alum.mit.edu</email>
			</address>
		</author>

		<date/>
                  <area>RAI</area>
		<workgroup>SIPREC</workgroup>

		<abstract>
            <t>SIPREC is capable of recording interactive text media that is transmitted via RTP. However that format is not commonly used for message or chat scenarios. There is also a need for recording text media carried via MSRP. One case of note is exchange of text between hearing-impaired users and emergence service bureaus. Also, recording support is needed for MSRP used in chat conferences and multimedia conferences.</t>
            <t>This document describes how to achieve MSRP channel recording within the mechanism of SIP Recording (SIPREC).</t>
		</abstract>

		<note title="Requirements Language">
			<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119">RFC 2119</xref>.</t>
		</note>
	</front>

	<middle>
		<section title="Introduction">
            <t>SIPREC is capable of recording interactive text media that is transmitted via RTP, as defined by <xref target="RFC4103"/>. However that format is not commonly used for message or chat scenarios. There is also a need for recording text media carried via MSRP. One case of note is exchange of text between hearing-impaired users and emergence service bureaus. Also, recording support is needed for MSRP used in chat conferences (as defined by <xref target="I-D.ietf-simple-chat"/>) and multimedia conferences (as defined by <xref target="RFC4597"/>).</t>
            <t>Instant message media is carried by a variety of protocols such as IRC, MSRP and XMPP/JINGLE. The SIP based MSRP protocol (as defined by <xref target="RFC4975"/> and <xref target="RFC4976"/>) supports the delivery of messages and files from one SIP UA to another. When a SIPREC SRC is recording a CS that contains an MSRP channel, it may want to record the messages passing over that channel. To gain access to the messages, the SRC may act as an MSRP client, relay, or switch. The SRC needs to replicate and deliver the messages over an MSRP channel within a Recording Session (RS) to an SRS. The replicated content could be in Message/CPIM format containing plain text, HTML, images, etc. In this document, file delivering sessions have not yet been considered. Other instant message protocols, like IRC or XMPP, are out of scope.</t>
            <t>This document describes how MRSP sessions are established between an SRC and SRS, and used for conveying the replicated MSRP Media, and also specifies metadata that describes the recorded MSRP sessions. A Recording Session employing MSRP is established using the normal procedures for establishing INVITE initiated dialogs <xref target="RFC3261"/> and uses SDP <xref target="RFC4566"/>  for describing the media to be used during the session as described 
by the SIPREC Architecture <xref target="RFC7245"/>.
            </t>
        </section>

        <section title="Definitions">
            <t>(TBD...)</t>

        </section>

        <section title="MSRP Recording Architecture">
            <t>For consistency with the SIPREC Architecture <xref target="RFC7245"/> and the SIPREC Protocol <xref target="I-D.ietf-siprec-protocol"/> MSRP recording needs to deliver duplicated MSRP message content from the SRC to the SRS, with suitable descriptive metadata. The SRC may be associated with SIP UA (endpoint) with an MSRP client, or with a SIP B2BUA that accesses the media via an MRSP Relay. An SRC may also be associated with a SIP conference focus and an MSRP switch.</t> 

		<section title="MSRP Client acts as SRC">
            <t><xref target="RFC4975"/> and <xref target="RFC4976"/> describe how an MSRP client communicates to another MSRP client via a SIP session. A MSRP client that has access to the MSRP content to be recorded may act as SRC. The MSRP client may send the replicated media to the SRS along with corresponding metadata.</t>
            <t>If the MSRP client/SRC is aware the MSRP session needs to be recorded, it can initiate the establishment of a SIP RS by sending an INVITE to SRS, or vice-versa. 
<!-- WE MIGHT WANT TO DROP the "or visa-versa". SRS initiated RSs are not well defined. -->
The MSRP client/SRC is responsible for notifying the other MSRP client involved in the CS that the MSRP session is being recorded. The MSRP client/SRC is responsible for complying with request from recording aware UAs or through some configured policies indicating that the CS should not be recorded.</t>
            <t>
                <figure align="center" anchor="MSRP_Client_Acts_as_SRC" title="MSRP Client Acts as SRC">   
                    <artwork><![CDATA[
    +-------------+
    | MSRP CLIENT |
    +-------------+
      ^
      | (Communication Session)    
      |      
      |  SIP
      v              
    +-------------+   (Recording Session)  +-------------+
    | MSRP CLIENT |<---------------------->|   Recorder  |
    |    (SRC)    |      SIP/Metadata      |    (SRS)    |
    +-------------+                        +-------------+
  
					]]>
					</artwork>
                 </figure>   
             </t>          
        </section>

		<section title="MSRP Relay acts as SRC">
            <t>(TBD... RFC4976)</t>
            <t>
                <figure align="center" anchor="MSRP_Relay_Acts_as_SRC" title="MSRP Relay Acts as SRC">
                    <artwork><![CDATA[
    +-------------+
    | MSRP CLIENT |
    +-------------+
      ^
      | (Communication Session)    
      |  SIP     
    +-------------+   (Recording Session)  +-------------+
    | MSRP RELAY  |<---------------------->|   Recorder  |
    |    (SRC)    |      SIP/Metadata      |    (SRS)    |
    +-------------+                        +-------------+
      | 
      |
      v
    +-------------+
    | MSRP CLIENT |
    +-------------+ 
					]]>
					</artwork>
                 </figure>   
             </t> 
        </section>

		<section title="MSRP Switch acts as SRC">
            <t>(TBD... ietf-simple-chat)</t>
            <t>
                <figure align="center" anchor="MSRP_Switch_Acts_as_SRC" title="MSRP Switch Acts as SRC">
                    <artwork><![CDATA[
    +-------------+    +-------------+
    | MSRP CLIENT |    | MSRP CLIENT |
    +-------------+    +-------------+   
           ^            ^
            \ SIP      / (Communication Session)
             \        /  SIP  
           +-------------+                     +-------------+
           | MSRP switch | (Recording Session) |   Recorder  |
           |    (SRC)    |<------------------->|    (SRS)    |
           +-------------+    SIP/Metadata     +-------------+
             /        \    
            / SIP      \ SIP    
           v            v
    +-------------+    +-------------+
    | MSRP CLIENT |    | MSRP CLIENT |
    +-------------+    +-------------+
					]]>
					</artwork>
                 </figure>   
             </t> 
        </section>
        </section>

        <section title="MSRP Media Stream Mixing">
            <t>
As with RTP-based media, CS MSRP media streams from different participants may be mixed into a single RS media stream, 
or they may be conveyed as separate MSRP streams. 
In RTP, when media from different participants is mixed, it is distinguished by CNAME and SSRC or CSRC.
In MSRP, media from different participants is distinguished by wrapping the the message in a CPIM body,
with the sender identified by the From header in the CPIM. If the SRC mixes MSRP media from multiple senders, 
then each message that isn't already in CPIM format SHOULD be embedded in a CPIM message, 
and the From and To headers of that CPIM wrapper SHOULD identify the sending and receiving participants for that message.
            </t>
	</section>

        <section title="MSRP Session Usage by the SRC">
            <t>
When preparing to record a CS MSRP media stream, the SRC MUST choose a corresponding RS MSRP session.
CS MSRP sessions that are being mixed share an RS MSRP session, 
while those that are not being mixed are assigned to unique RS MSRP sessions.
            </t>
            <t>
The RS MSRP session MAY be newly created, or a pre-existing RS MSRP session that is no longer in use MAY be repurposed.
When an MSRP session is repurposed, the SRC communicates this change to the SRS via a change in the metadata.
The SRC is responsible for ensuring that messages for the new session are not sent until the SRS has received the metadata
describing this new session.
            </t>
            <t>
MSRP message flow on a RS MSRP session is always from the SRC to the SRS. 
The SRC generates SEND messages, and may receive REPORT messages.
It does not receive SEND messages or send REPORT messages.
            </t>
	</section>

        <section title="MSRP Session Usage by the SRS">
            <t>
The SRS MUST be able handle a case where an RS MSRP session if first used to record one CS MSRP session 
and then is repurposed to record a different CS MSRP session. 
The SRS is learns of this change via a change in the metadata.
            </t>
            <t>
MSRP message flow on a RS MSRP session is always from the SRC to the SRS. 
The SRS receives SEND messages, and sends REPORT messages.
It does not generate SEND messages or receive REPORT messages.
            </t>
	</section>

        <section title="File Transfer">
            <t>
A mechanism for doing file transfer via MSRP is specified in <xref target="RFC5547"/>. 
If this mechanism is used in the CS, then the SRC MAY use it in the RS to record those files.
In turn, the SRS MAY choose to accept some or all of those file transfer requests, or MAY reject them.
            </t>
            <t>
Both file push and file pull operations are defined. 
If the SRC chooses to record a file transfer, whether it is initiated in the CS via a push operation or a pull operation, 
within the RS the SRC MUST initiate the transfer with a push operation in an SDP Offer. 
            </t>
            <t>
(SRS initiation of a file transfer is out of scope of this document.)
            </t>
            <t>
It is possible that the SRC may support file transfer while the SRS does not.
If the SRC sends an SDP offer to the SRS containing an m-line initiating a file transfer, 
and the SRS sends an answer accepting the MSRP session, 
but fails to include a matching file-transfer-id,
then the SRC MUST abort the file transfer without sending any file content.
            </t>
	</section>

        <section title="Recording Chatrooms">
            <t>
An CS MSRP session might involve a chatroom. 
The SRC discovers this by observing use of the features defined in <xref target="I-D.ietf-simple-chat"/>
            </t>
            <t>
When the CS MSRP session involves a chatroom, the SRC MUST indicate this in the corresponding RS MSRP session.
The key unique features of chatrooms are nicknames and private messages.
If either of these features is indicated in a 'chatroom' attribute in the CS, 
then this MUST also be indicated in the RS.
            </t>
            <t>
How to reflect the use of nicknames from the CS to the RS is TBD. 
            </t>
	</section>

        <section title="Metadata">
            <t>
The metadata defined in <xref target="I-D.ietf-siprec-metadata"/> can be used without change
to describe MSRP streams.
            </t>
	</section>

        <section title="Open Issues">
            <section title="Handling MSRP failure reports">
                <t>
What the SRC should do if it observes a MSRP error response or a failure report is TBD?
                </t>
            </section>
            <section title="Recording Nickname usage">
                <t>
Recording chat sessions that use nicknames presents difficult problems.
The chat mechanism doesn't have provision for a single MSRP endpoint to concurrently use multiple nicknames.
Perhaps we can handle nicknames via metadata - as an additional attribute to a Participant.
                </t>
            </section>
        </section>

        <section title="IANA Considerations">
			<t>This document contains no IANA considerations.</t>
		</section>

        <section title="Security Considerations">
			<t>Not explicitly covered in this version.</t>
		</section>

	</middle>
	<back>

   		<references title="Normative References">
                   <?rfc include="reference.RFC.2119"?>
                   <?rfc include="reference.RFC.3261"?>
                   <?rfc include="reference.RFC.4975"?>
                   <?rfc include="reference.RFC.4976"?>
                   <?rfc include="reference.RFC.5547"?>
                   <?rfc include="reference.RFC.7245"?>
                   <?rfc include="reference.I-D.ietf-siprec-metadata"?>
                   <?rfc include="reference.I-D.ietf-siprec-protocol"?>
                   <?rfc include="reference.I-D.ietf-simple-chat"?>
		</references>

		<references title="Informative References">
                   <?rfc include="reference.RFC.4103"?>
                   <?rfc include="reference.RFC.4566"?>
                   <?rfc include="reference.RFC.4597"?>
		</references>
	</back>
</rfc>
