Index: pjproject/branches/projects/sipit24/pjsip-apps/src/samples/siprtp_report.c
===================================================================
--- pjproject/branches/projects/sipit24/pjsip-apps/src/samples/siprtp_report.c	(revision 2701)
+++ pjproject/branches/projects/sipit24/pjsip-apps/src/samples/siprtp_report.c	(revision 2702)
@@ -78,5 +78,5 @@
     /* Call identification */
     len = pjsip_hdr_print_on(dlg->remote.info, userinfo, sizeof(userinfo));
-    if (len < 1)
+    if (len < 0)
 	pj_ansi_strcpy(userinfo, "<--uri too long-->");
     else
Index: pjproject/branches/projects/sipit24/pjsip/src/pjsip/sip_msg.c
===================================================================
--- pjproject/branches/projects/sipit24/pjsip/src/pjsip/sip_msg.c	(revision 2701)
+++ pjproject/branches/projects/sipit24/pjsip/src/pjsip/sip_msg.c	(revision 2702)
@@ -457,14 +457,16 @@
     /* Print each of the headers. */
     for (hdr=msg->hdr.next; hdr!=&msg->hdr; hdr=hdr->next) {
-	len = (*hdr->vptr->print_on)(hdr, p, end-p);
-	if (len < 1)
+	len = pjsip_hdr_print_on(hdr, p, end-p);
+	if (len < 0)
 	    return -1;
-	p += len;
-
-	if (p+3 >= end)
-	    return -1;
-
-	*p++ = '\r';
-	*p++ = '\n';
+
+	if (len > 0) {
+	    p += len;
+	    if (p+3 >= end)
+		return -1;
+
+	    *p++ = '\r';
+	    *p++ = '\n';
+	}
     }
 
@@ -1602,4 +1604,23 @@
     char *endbuf = buf + size;
     const pjsip_parser_const_t *pc = pjsip_parser_const();
+    pjsip_sip_uri *sip_uri;
+    pjsip_param *p;
+
+    /* Check the proprietary param 'hide', don't print this header 
+     * if it exists in the route URI.
+     */
+    sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(hdr->name_addr.uri);
+    p = sip_uri->other_param.next;
+    while (p != &sip_uri->other_param) {
+	const pj_str_t st_hide = {"hide", 4};
+
+	if (pj_stricmp(&p->name, &st_hide) == 0) {
+	    /* Check if param 'hide' is specified without 'lr'. */
+	    pj_assert(sip_uri->lr_param != 0);
+	    return 0;
+	}
+	p = p->next;
+    }
+
     /* Route and Record-Route don't compact forms */
 
Index: pjproject/branches/projects/sipit24/pjsip/src/pjsip/sip_ua_layer.c
===================================================================
--- pjproject/branches/projects/sipit24/pjsip/src/pjsip/sip_ua_layer.c	(revision 2701)
+++ pjproject/branches/projects/sipit24/pjsip/src/pjsip/sip_ua_layer.c	(revision 2702)
@@ -908,5 +908,5 @@
 
     len = pjsip_hdr_print_on(dlg->remote.info, userinfo, sizeof(userinfo));
-    if (len < 1)
+    if (len < 0)
 	pj_ansi_strcpy(userinfo, "<--uri too long-->");
     else
Index: pjproject/branches/projects/sipit24/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjproject/branches/projects/sipit24/pjsip/src/pjsua-lib/pjsua_call.c	(revision 2701)
+++ pjproject/branches/projects/sipit24/pjsip/src/pjsua-lib/pjsua_call.c	(revision 2702)
@@ -2695,5 +2695,5 @@
 
     len = pjsip_hdr_print_on(dlg->remote.info, userinfo, sizeof(userinfo));
-    if (len < 1)
+    if (len < 0)
 	pj_ansi_strcpy(userinfo, "<--uri too long-->");
     else
Index: pjproject/branches/projects/sipit24/pjsip/src/test/msg_test.c
===================================================================
--- pjproject/branches/projects/sipit24/pjsip/src/test/msg_test.c	(revision 2701)
+++ pjproject/branches/projects/sipit24/pjsip/src/test/msg_test.c	(revision 2702)
@@ -366,6 +366,6 @@
 
     while (hdr1 != &parsed_msg->hdr && hdr2 != &ref_msg->hdr) {
-	len = hdr1->vptr->print_on(hdr1, str1.ptr, BUFLEN);
-	if (len < 1) {
+	len = pjsip_hdr_print_on(hdr1, str1.ptr, BUFLEN);
+	if (len < 0) {
 	    status = -40;
 	    goto on_return;
@@ -374,6 +374,6 @@
 	str1.slen = len;
 
-	len = hdr2->vptr->print_on(hdr2, str2.ptr, BUFLEN);
-	if (len < 1) {
+	len = pjsip_hdr_print_on(hdr2, str2.ptr, BUFLEN);
+	if (len < 0) {
 	    status = -50;
 	    goto on_return;
@@ -1945,5 +1945,5 @@
 	output = (char*) pj_pool_alloc(pool, 1024);
 	len = pjsip_hdr_print_on(parsed_hdr1, output, 1024);
-	if (len < 1 || len >= 1024) {
+	if (len < 0 || len >= 1024) {
 	    PJ_LOG(3,(THIS_FILE, "    header too long: %s: %s", test->hname, test->hcontent));
 	    return -530;
