Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_aud.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_aud.c	(revision 5978)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_aud.c	(revision 5979)
@@ -301,5 +301,5 @@
                                                  &codec_cfg);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status, "Error registering codecs"));
+	pjsua_perror(THIS_FILE, "Error registering codecs", status);
 	goto on_error;
     }
@@ -2446,5 +2446,5 @@
 on_return:
     if (status != PJ_SUCCESS) {
-	PJ_LOG(3,(THIS_FILE, "Failed creating extra sound device"));
+	pjsua_perror(THIS_FILE, "Failed creating extra sound device", status);
 	pjsua_ext_snd_dev_destroy(snd);
     }
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 5978)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 5979)
@@ -4667,5 +4667,6 @@
 				      	      100, NULL, NULL, &response);
     	    if (status != PJ_SUCCESS) {
-		PJ_LOG(3, (THIS_FILE, "Failed to create initial answer")); 
+		PJ_PERROR(3, (THIS_FILE, status,
+			      "Failed to create initial answer"));
     	    	goto on_return;
     	    }
@@ -4673,5 +4674,6 @@
 	    status = pjsip_inv_send_msg(inv, response);
     	    if (status != PJ_SUCCESS) {
-		PJ_LOG(3, (THIS_FILE, "Failed to send initial answer")); 
+		PJ_PERROR(3, (THIS_FILE, status,
+			      "Failed to send initial answer")); 
     	    	goto on_return;
     	    }
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 5978)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 5979)
@@ -115,6 +115,6 @@
 	status = pjmedia_event_mgr_create(pjsua_var.pool, 0, NULL);
 	if (status != PJ_SUCCESS) {
-	    PJ_PERROR(1,(THIS_FILE, status,
-			 "Error creating PJMEDIA event manager"));
+	    pjsua_perror(THIS_FILE, "Error creating PJMEDIA event manager",
+			 status);
 	    goto on_error;
 	}
@@ -1472,6 +1472,6 @@
 						     &msg_data);
 		    if (status != PJ_SUCCESS) {
-			pj_perror(3, THIS_FILE, status,
-				  "Failed requesting keyframe via SIP INFO");
+			PJ_PERROR(3,(THIS_FILE, status,
+				  "Failed requesting keyframe via SIP INFO"));
 		    } else {
 			call_med->last_req_keyframe = now;
@@ -1792,5 +1792,5 @@
 	    call_med->tp_ready = status;
 	    pjsua_set_media_tp_state(call_med, PJSUA_MED_TP_NULL);
-	    PJ_PERROR(1,(THIS_FILE, status, "Error creating media transport"));
+	    pjsua_perror(THIS_FILE, "Error creating media transport", status);
 	    return status;
 	}
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c	(revision 5978)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c	(revision 5979)
@@ -49,6 +49,6 @@
     status = pjmedia_video_format_mgr_create(pjsua_var.pool, 64, 0, NULL);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status,
-		     "Error creating PJMEDIA video format manager"));
+	pjsua_perror(THIS_FILE, "Error creating PJMEDIA video format manager",
+		     status);
 	goto on_error;
     }
@@ -56,6 +56,6 @@
     status = pjmedia_converter_mgr_create(pjsua_var.pool, NULL);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status,
-		     "Error creating PJMEDIA converter manager"));
+	pjsua_perror(THIS_FILE, "Error creating PJMEDIA converter manager",
+		     status);
 	goto on_error;
     }
@@ -63,6 +63,6 @@
     status = pjmedia_vid_codec_mgr_create(pjsua_var.pool, NULL);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status,
-		     "Error creating PJMEDIA video codec manager"));
+	pjsua_perror(THIS_FILE, "Error creating PJMEDIA video codec manager",
+		     status);
 	goto on_error;
     }
@@ -71,6 +71,7 @@
 				     &pjsua_var.vid_conf);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status,
-		     "Error creating PJMEDIA video conference bridge"));
+	pjsua_perror(THIS_FILE,
+		     "Error creating PJMEDIA video conference bridge",
+		     status);
 	goto on_error;
     }
@@ -79,6 +80,6 @@
     status = pjmedia_codec_vid_toolbox_init(NULL, &pjsua_var.cp.factory);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status,
-		     "Error initializing Video Toolbox codec"));
+	pjsua_perror(THIS_FILE, "Error initializing Video Toolbox codec",
+		     status);
 	goto on_error;
     }
@@ -88,6 +89,6 @@
     status = pjmedia_codec_openh264_vid_init(NULL, &pjsua_var.cp.factory);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status,
-		     "Error initializing OpenH264 library"));
+	pjsua_perror(THIS_FILE, "Error initializing OpenH264 library",
+		     status);
 	goto on_error;
     }
@@ -97,6 +98,5 @@
     status = pjmedia_codec_ffmpeg_vid_init(NULL, &pjsua_var.cp.factory);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status,
-		     "Error initializing ffmpeg library"));
+	pjsua_perror(THIS_FILE, "Error initializing ffmpeg library", status);
 	goto on_error;
     }
@@ -105,6 +105,6 @@
     status = pjmedia_vid_dev_subsys_init(&pjsua_var.cp.factory);
     if (status != PJ_SUCCESS) {
-	PJ_PERROR(1,(THIS_FILE, status,
-		     "Error creating PJMEDIA video subsystem"));
+	pjsua_perror(THIS_FILE, "Error creating PJMEDIA video subsystem",
+		     status);
 	goto on_error;
     }
@@ -766,7 +766,8 @@
 			    &enabled);
 	    if (status != PJ_SUCCESS) {
-		PJ_PERROR(1,(THIS_FILE, status,
+		pjsua_perror(THIS_FILE,
 			     "Error activating native preview, falling back "
-			     "to software preview.."));
+			     "to software preview..",
+			     status);
 		w->is_native = PJ_FALSE;
 	    }
@@ -1356,7 +1357,8 @@
 			&enabled);
 	if (status != PJ_SUCCESS) {
-	    PJ_PERROR(1,(THIS_FILE, status,
+	    pjsua_perror(THIS_FILE,
 			 "Error activating native preview, falling back "
-			 "to software preview.."));
+			 "to software preview..",
+			 status);
 	    w->is_native = PJ_FALSE;
 	}
