IMS - RCS CPIM
CPIM in RCS

CPIM stands for Common Profile for Instant Messaging. In RCS, CPIM is normally carried inside MSRP and works as the message envelope for instant messaging payloads. MSRP provides the transport session, while CPIM carries the sender, receiver, time, message identity, namespace, content type, and the actual user message body. The CPIM format is specified in RFC 3862.

Role of CPIM in RCS

CPIM is used when an RCS instant message needs a common envelope that is independent of the transport connection. This is useful because the MSRP session identifies the transport path, but the CPIM body identifies the logical message sender, receiver, content type, timestamp, and optional message disposition information.

For a simple one-to-one chat, the UE sends an MSRP SEND request with Content-Type set to message/cpim. The message/cpim body then contains CPIM headers followed by the actual text, file-transfer metadata, or IMDN-related information, depending on the RCS feature being used.

CPIM Inside MSRP

The outer MSRP message and the inner CPIM message have different jobs. MSRP parameters are used for session delivery and chunk handling, while CPIM parameters describe the instant message itself. When debugging RCS messaging, check both layers because a failure can come from either MSRP routing or CPIM payload formatting.

MSRP Clip Carrying CPIM

The following clip shows an MSRP SEND request where the payload type is CPIM.

MSRP d93kswow SEND

To-Path: msrp://pcscf.example.com:2855/iau39soe;tcp

From-Path: msrp://ue.example.com:49152/9di4ea;tcp

Message-ID: 87652491

Byte-Range: 1-241/241

Content-Type: message/cpim

-------d93kswow$

In this MSRP clip, To-Path identifies the remote MSRP endpoint, From-Path identifies the sending endpoint, Message-ID identifies this MSRP message, Byte-Range gives the byte position and total size, and Content-Type tells the receiver that the body is a CPIM message.

CPIM Payload Clip

The following clip shows the CPIM body carried by the MSRP SEND request.

From: <sip:user1@example.com>

To: <sip:user2@example.com>

DateTime: 2026-06-26T12:00:00Z

NS: imdn <urn:ietf:params:imdn>

imdn.Message-ID: msg-12345

Content-Type: text/plain

Hello over CPIM

In this CPIM clip, From identifies the logical sender, To identifies the logical recipient, DateTime gives the message timestamp, NS declares the IMDN namespace, imdn.Message-ID identifies the instant message for delivery reports, and Content-Type defines the user payload format.

CPIM Message Structure

A CPIM message is composed of message headers, optional extension headers, payload headers, and the payload body. In RCS troubleshooting, the most common focus is whether the CPIM sender and recipient match the SIP/MSRP session context and whether the payload Content-Type matches the body that follows it.

The CPIM envelope can also carry IMDN-related headers so that delivery and display notifications can be correlated with the original instant message. This is why the CPIM message identity should be checked together with the SIP dialog, MSRP Message-ID, and any IMDN report body.

Important Parameters

From indicates the CPIM-level sender. It should be consistent with the authenticated user or asserted identity expected for the RCS session.

To indicates the CPIM-level recipient. In one-to-one chat this usually maps to the remote user's SIP URI or tel URI.

DateTime provides the message creation time. Incorrect time format can cause interworking or logging problems even when MSRP delivery succeeds.

NS declares a namespace used by extension headers. For IMDN usage, it commonly declares the IMDN namespace used by imdn-prefixed fields.

imdn.Message-ID is used to correlate the instant message with IMDN delivery or display notifications.

Content-Type appears at both MSRP and CPIM layers. The MSRP Content-Type can be message/cpim, while the CPIM payload Content-Type can be text/plain, message/imdn+xml, or another RCS-supported payload type.

Troubleshooting Points

When CPIM handling fails, first check that the outer MSRP Content-Type is message/cpim and that the byte range covers the complete CPIM body. Then check the CPIM headers for malformed URI brackets, missing namespace declarations, inconsistent sender or recipient identity, and a payload Content-Type that does not match the body.

For IMDN-related issues, compare the original CPIM imdn.Message-ID with the message identifier in the later delivery or display notification. A mismatch at this layer often makes the user message appear delivered at the transport layer but uncorrelated at the RCS service layer.