diff --git a/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/protocol/sip/SipUtils.java b/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/protocol/sip/SipUtils.java
index 7605fb5..13fa53a 100644
--- a/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/protocol/sip/SipUtils.java
+++ b/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/protocol/sip/SipUtils.java
@@ -54,6 +54,7 @@
 import javax.sip.address.SipURI;
 import javax.sip.address.URI;
 import javax.sip.header.ContactHeader;
+import javax.sip.header.Header;
 import javax.sip.header.HeaderFactory;
 import javax.sip.header.ViaHeader;
 import javax.sip.message.Request;
@@ -262,6 +263,7 @@
 
         Via via = (Via) invite.getTopmostVia().clone();
         via.removeParameter("branch");
+        via.setBranch(Utils.getInstance().generateBranchId());
         request.addHeader(via);
         request.addHeader(
                 sHeaderFactory.createFromHeader(invite.getFrom().getAddress(),
@@ -290,6 +292,27 @@
         if (code == Response.OK) {
             response.setMessageContent(SDP_CONTENT_TYPE, SDP_CONTENT_SUB_TYPE, sdp.encode());
         }
+        response.setToTag(Utils.getInstance().generateTag());
+
+        // Set a Contact header.
+        response.setHeader(generateContactHeader(configuration));
+
+        // Set Conversation-ID and Contribution-ID
+        Header conversationIdHeader = invite.getHeader(CONVERSATION_ID_HEADER_NAME);
+        if (conversationIdHeader != null) {
+            response.setHeader((Header) conversationIdHeader.clone());
+        }
+        Header contributionIdHeader = invite.getHeader(CONTRIBUTION_ID_HEADER_NAME);
+        if (conversationIdHeader != null) {
+            response.setHeader((Header) contributionIdHeader.clone());
+        }
+
+        // Set P-Preferred-Identity
+        List<String> associatedUris = configuration.getAssociatedUris();
+        String preferredUri = Iterables.getFirst(associatedUris,
+                configuration.getPublicUserIdentity());
+        response.setHeader(
+                sHeaderFactory.createHeader(PPreferredIdentityHeader.NAME, preferredUri));
 
         // Set PANI and PLANI if exists
         if (configuration.getPaniHeader() != null) {
diff --git a/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/service/chat/MinimalCpmChatService.java b/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/service/chat/MinimalCpmChatService.java
index b204de6..4b913f7 100644
--- a/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/service/chat/MinimalCpmChatService.java
+++ b/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/service/chat/MinimalCpmChatService.java
@@ -54,7 +54,7 @@
 public class MinimalCpmChatService implements ImsService {
     public static final String CPM_SESSION_TAG =
             "+g.3gpp.icsi-ref=\"urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.cpm.session\"";
-    private static final String TAG = SimpleChatSession.class.getSimpleName();
+    private static final String TAG = MinimalCpmChatService.class.getSimpleName();
     private final Map<String, SimpleChatSession> mTransactions = new HashMap<>();
     private final Map<String, SimpleChatSession> mDialogs = new HashMap<>();
 
@@ -112,7 +112,7 @@
     }
 
     ListenableFuture<Boolean> sendSipRequest(SIPRequest msg, SimpleChatSession session) {
-        Log.i(TAG, "sendSipRequest");
+        Log.i(TAG, "sendSipRequest:\r\n" + msg);
         if (!TextUtils.equals(msg.getMethod(), Request.ACK)) {
             mTransactions.put(msg.getTransactionId(), session);
         }
@@ -126,7 +126,7 @@
     }
 
     ListenableFuture<Boolean> sendSipResponse(SIPResponse msg, SimpleChatSession session) {
-        Log.i(TAG, "sendSipRequest");
+        Log.i(TAG, "sendSipResponse:\r\n" + msg);
         if (TextUtils.equals(msg.getCSeq().getMethod(), Request.BYE)) {
             mDialogs.remove(msg.getDialogId(/* isServer= */ true));
         } else if (TextUtils.equals(msg.getCSeq().getMethod(), Request.INVITE)
@@ -139,6 +139,7 @@
     }
 
     private void handleRequest(SIPRequest request) {
+        Log.i(TAG, "handleRequest:\r\n" + request);
         String dialogId = request.getDialogId(/* isServer= */ true);
         if (mDialogs.containsKey(dialogId)) {
             SimpleChatSession session = mDialogs.get(dialogId);
diff --git a/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/service/chat/SimpleChatSession.java b/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/service/chat/SimpleChatSession.java
index f66e230..4cc474c 100644
--- a/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/service/chat/SimpleChatSession.java
+++ b/testapps/TestRcsApp/aosp_test_rcsclient/src/com/android/libraries/rcs/simpleclient/service/chat/SimpleChatSession.java
@@ -167,8 +167,10 @@
         mStartFuture = future;
         mRemoteUri = SipUtils.createUri(telUriContact);
         try {
-            SipSessionConfiguration configuration = mContext.getSipSession().getSessionConfiguration();
-            SimpleSdpMessage sdp = SdpUtils.createSdpForMsrp(configuration.getLocalIpAddress(), false);
+            SipSessionConfiguration configuration =
+                    mContext.getSipSession().getSessionConfiguration();
+            SimpleSdpMessage sdp = SdpUtils.createSdpForMsrp(configuration.getLocalIpAddress(),
+                    false);
             SIPRequest invite =
                     SipUtils.buildInvite(
                             mContext.getSipSession().getSessionConfiguration(),
@@ -229,6 +231,7 @@
         try {
             SIPResponse response = SipUtils.buildInviteResponse(configuration, invite, statusCode,
                     sdp);
+            mLocalSdp = sdp;
             return Futures.transform(
                     mService.sendSipResponse(response, this), result -> null,
                     MoreExecutors.directExecutor());
@@ -467,6 +470,7 @@
 
         String contentType = contentTypeHeader.value();
         if ("message/cpim".equals(contentType)) {
+            Log.d(TAG, "Received CPIM: " + new String(chunk.content(), UTF_8));
             try {
                 SimpleCpimMessage cpim = SimpleCpimMessage.parse(chunk.content());
                 if (mListener != null) {
