Index: /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 2117)
+++ /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 2118)
@@ -834,4 +834,5 @@
      # mime_type:   string
      # body:	    string
+     # acc_id:      integer
 
      def on_pager(call_id, from, to, contact, mime_type, body):
@@ -856,9 +857,10 @@
      * @param body	    The message content.
      * @param rdata	    The incoming MESSAGE request.
+     * @param acc_id	    Account ID most suitable for this message.
      */
     void (*on_pager2)(pjsua_call_id call_id, const pj_str_t *from,
 		      const pj_str_t *to, const pj_str_t *contact,
 		      const pj_str_t *mime_type, const pj_str_t *body,
-		      pjsip_rx_data *rdata);
+		      pjsip_rx_data *rdata, pjsua_acc_id acc_id);
 
     /**
@@ -885,4 +887,5 @@
      # status:	    integer
      # reason:	    string
+     # acc_id:      integer
 
      def on_pager_status(call_id, to, body, user_data, status, reason):
@@ -914,4 +917,6 @@
      *			    message transaction fails because of time out 
      *			    or transport error.
+     * @param acc_id	    Account ID from this the instant message was
+     *			    send.
      */
     void (*on_pager_status2)(pjsua_call_id call_id,
@@ -922,5 +927,6 @@
 			     const pj_str_t *reason,
 			     pjsip_tx_data *tdata,
-			     pjsip_rx_data *rdata);
+			     pjsip_rx_data *rdata,
+			     pjsua_acc_id acc_id);
 
     /**
@@ -951,4 +957,23 @@
 		      const pj_str_t *to, const pj_str_t *contact,
 		      pj_bool_t is_typing);
+
+    /**
+     * Notify application about typing indication.
+     *
+     * @param call_id	    Containts the ID of the call where the IM was
+     *			    sent, or PJSUA_INVALID_ID if the IM was sent
+     *			    outside call context.
+     * @param from	    URI of the sender.
+     * @param to	    URI of the destination message.
+     * @param contact	    The Contact URI of the sender, if present.
+     * @param is_typing	    Non-zero if peer is typing, or zero if peer
+     *			    has stopped typing a message.
+     * @param rdata	    The received request.
+     * @param acc_id	    Account ID most suitable for this message.
+     */
+    void (*on_typing2)(pjsua_call_id call_id, const pj_str_t *from,
+		       const pj_str_t *to, const pj_str_t *contact,
+		       pj_bool_t is_typing, pjsip_rx_data *rdata,
+		       pjsua_acc_id acc_id);
 
     /**
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c	(revision 2117)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c	(revision 2118)
@@ -192,4 +192,19 @@
 	}
 
+	if (pjsua_var.ua_cfg.cb.on_typing2) {
+	    pjsua_acc_id acc_id;
+
+	    if (call_id == PJSUA_INVALID_ID) {
+		acc_id = pjsua_acc_find_for_incoming(rdata);
+	    } else {
+		pjsua_call *call = &pjsua_var.calls[call_id];
+		acc_id = call->acc_id;
+	    }
+
+
+	    (*pjsua_var.ua_cfg.cb.on_typing2)(call_id, from, to, &contact,
+					      is_typing, rdata, acc_id);
+	}
+
     } else {
 	pj_str_t mime_type;
@@ -220,6 +235,16 @@
 
 	if (pjsua_var.ua_cfg.cb.on_pager2) {
+	    pjsua_acc_id acc_id;
+
+	    if (call_id == PJSUA_INVALID_ID) {
+		acc_id = pjsua_acc_find_for_incoming(rdata);
+	    } else {
+		pjsua_call *call = &pjsua_var.calls[call_id];
+		acc_id = call->acc_id;
+	    }
+
 	    (*pjsua_var.ua_cfg.cb.on_pager2)(call_id, from, to, &contact, 
-					     &mime_type, &text_body, rdata);
+					     &mime_type, &text_body, rdata,
+					     acc_id);
 	}
     }
@@ -390,5 +415,5 @@
 						 &tsx->status_text,
 						 tsx->last_tx,
-						 rdata);
+						 rdata, im_data->acc_id);
 	}
     }
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c	(revision 2117)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c	(revision 2118)
@@ -506,5 +506,5 @@
     uapres = (pjsua_srv_pres*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
     if (uapres) {
-	PJ_LOG(3,(THIS_FILE, "Server subscription to %s is %s",
+	PJ_LOG(4,(THIS_FILE, "Server subscription to %s is %s",
 		  uapres->remote, pjsip_evsub_get_state_name(sub)));
 
@@ -984,5 +984,5 @@
     buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
     if (buddy) {
-	PJ_LOG(3,(THIS_FILE, 
+	PJ_LOG(4,(THIS_FILE, 
 		  "Presence subscription to %.*s is %s",
 		  (int)pjsua_var.buddy[buddy->index].uri.slen,
