Added incoming call notification

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@216 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip/src/pjsua/pjsua_inv.c b/pjsip/src/pjsua/pjsua_inv.c
index 824943c..5789cbc 100644
--- a/pjsip/src/pjsua/pjsua_inv.c
+++ b/pjsip/src/pjsua/pjsua_inv.c
@@ -283,6 +283,8 @@
     status = pjsip_dlg_create_response(dlg, rdata, 100, NULL, &response);
     if (status != PJ_SUCCESS) {
 	
+	pjsua_perror(THIS_FILE, "Unable to create 100 response", status);
+
 	pjsip_dlg_respond(dlg, rdata, 500, NULL);
 
 	/* Free call socket. */
@@ -293,8 +295,19 @@
     } else {
 	status = pjsip_dlg_send_response(dlg, pjsip_rdata_get_tsx(rdata), 
 					 response);
+	if (status != PJ_SUCCESS)
+	    pjsua_perror(THIS_FILE, "Unable to send 100 response", status);
     }
 
+    PJ_LOG(3,(THIS_FILE,
+	      "\nIncoming call!!\n"
+	      "From: %.*s\n"
+	      "To:   %.*s\n"
+	      "(press 'a' to answer, 'h' to decline)",
+	      (int)dlg->remote.info_str.slen,
+	      dlg->remote.info_str.ptr,
+	      (int)dlg->local.info_str.slen,
+	      dlg->local.info_str.ptr));
     /* This INVITE request has been handled. */
     return PJ_TRUE;
 }