Index: /pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/Makefile
===================================================================
--- /pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/Makefile	(revision 4669)
+++ /pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/Makefile	(revision 4670)
@@ -27,4 +27,11 @@
   JAVA_BIN := $(dir $(JAVAC_PATH))
   JAVA_HOME := $(patsubst %/bin/,%,$(JAVA_BIN))
+else
+  ifeq (exists, $(shell test -d $(JAVA_HOME)/bin && echo exists ))
+    JAVA_BIN := $(JAVA_HOME)/bin
+  else
+    JAVA_BIN := $(JAVA_HOME)
+  endif
+  #$(error $(JAVA_BIN))
 endif
 
Index: /pjproject/branches/projects/pjsua2/pjsip/build/pjsua2_lib.vcproj
===================================================================
--- /pjproject/branches/projects/pjsua2/pjsip/build/pjsua2_lib.vcproj	(revision 4669)
+++ /pjproject/branches/projects/pjsua2/pjsip/build/pjsua2_lib.vcproj	(revision 4670)
@@ -3130,4 +3130,8 @@
 			</File>
 			<File
+				RelativePath="..\src\pjsua2\call.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\src\pjsua2\endpoint.cpp"
 				>
@@ -3135,4 +3139,8 @@
 			<File
 				RelativePath="..\src\pjsua2\json.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\src\pjsua2\media.cpp"
 				>
 			</File>
@@ -3167,4 +3175,8 @@
 			</File>
 			<File
+				RelativePath="..\include\pjsua2\call.hpp"
+				>
+			</File>
+			<File
 				RelativePath="..\include\pjsua2\config.hpp"
 				>
@@ -3180,4 +3192,8 @@
 			<File
 				RelativePath="..\include\pjsua2\json.hpp"
+				>
+			</File>
+			<File
+				RelativePath="..\include\pjsua2\media.hpp"
 				>
 			</File>
Index: /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/call.hpp
===================================================================
--- /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/call.hpp	(revision 4669)
+++ /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/call.hpp	(revision 4670)
@@ -445,5 +445,5 @@
      * Local URI
      */
-    string		localURI;
+    string		localUri;
     
     /**
@@ -455,5 +455,5 @@
      * Remote URI
      */
-    string		remoteURI;
+    string		remoteUri;
     
     /**
@@ -1452,5 +1452,5 @@
      */
     virtual void onCallState(OnCallStateParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1464,5 +1464,5 @@
      */
     virtual void onCallTsxState(OnCallTsxStateParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1476,5 +1476,5 @@
      */
     virtual void onCallMediaState(OnCallMediaStateParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1488,5 +1488,5 @@
      */
     virtual void onCallSdpCreated(OnCallSdpCreatedParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1499,5 +1499,5 @@
      */
     virtual void onStreamCreated(OnStreamCreatedParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1508,5 +1508,5 @@
      */
     virtual void onStreamDestroyed(OnStreamDestroyedParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1516,5 +1516,5 @@
      */
     virtual void onDtmfDigit(OnDtmfDigitParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1528,5 +1528,5 @@
      */
     virtual void onCallTransferRequest(OnCallTransferRequestParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1539,5 +1539,5 @@
      */
     virtual void onCallTransferStatus(OnCallTransferStatusParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1548,5 +1548,5 @@
      */
     virtual void onCallReplaceRequest(OnCallReplaceRequestParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1561,5 +1561,5 @@
      */
     virtual void onCallReplaced(OnCallReplacedParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1575,5 +1575,5 @@
      */
     virtual void onCallRxOffer(OnCallRxOfferParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1583,5 +1583,5 @@
      */
     virtual void onInstantMessage(OnInstantMessageParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1592,5 +1592,5 @@
      */
     virtual void onInstantMessageStatus(OnInstantMessageStatusParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1600,5 +1600,5 @@
      */
     virtual void onTypingIndication(OnTypingIndicationParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1645,4 +1645,5 @@
     virtual pjsip_redirect_op onCallRedirected(OnCallRedirectedParam &prm)
     {
+	PJ_UNUSED_ARG(prm);
         return PJSIP_REDIRECT_STOP;
     }
@@ -1654,5 +1655,5 @@
      */
     virtual void onCallMediaTransportState(OnCallMediaTransportStateParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1667,5 +1668,5 @@
      */
     virtual void onCallMediaEvent(OnCallMediaEventParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
     
     /**
@@ -1683,5 +1684,5 @@
     virtual void
     onCreateMediaTransport(OnCreateMediaTransportParam &prm)
-    {}
+    { PJ_UNUSED_ARG(prm); }
 
 private:
Index: /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/endpoint.hpp
===================================================================
--- /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/endpoint.hpp	(revision 4669)
+++ /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/endpoint.hpp	(revision 4670)
@@ -1135,7 +1135,8 @@
 private:
     /*
-     * Account
+     * Account & Call lookups
      */
     static Account	*lookupAcc(int acc_id, const char *op);
+    static Call		*lookupCall(int call_id, const char *op);
 
     /* static callbacks */
Index: /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/types.hpp
===================================================================
--- /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/types.hpp	(revision 4669)
+++ /pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/types.hpp	(revision 4670)
@@ -22,4 +22,5 @@
 #ifdef _MSC_VER
 #   pragma warning( disable : 4290 ) // exception spec ignored
+#   pragma warning( disable : 4512 ) // can't generate assignment op
 #endif
 
@@ -85,8 +86,9 @@
 
 /*
- * Forward declaration of Account to be used
+ * Forward declaration of Account and Call to be used
  * by Endpoint.
  */
 class Account;
+class Call;
 
 
Index: /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/call.cpp
===================================================================
--- /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/call.cpp	(revision 4669)
+++ /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/call.cpp	(revision 4670)
@@ -172,4 +172,5 @@
 CallVidSetStreamParam::CallVidSetStreamParam()
 {
+#if PJSUA_HAS_VIDEO
     pjsua_call_vid_strm_op_param prm;
     
@@ -178,4 +179,5 @@
     this->dir    = prm.dir;
     this->capDev = prm.cap_dev;
+#endif
 }
 
@@ -242,12 +244,12 @@
 void CallInfo::fromPj(const pjsua_call_info &pci)
 {
-    int mi;
+    unsigned mi;
     
     id 			= pci.id;
     role                = pci.role;
     accId               = pci.acc_id;
-    localURI            = pj2Str(pci.local_info);
+    localUri            = pj2Str(pci.local_info);
     localContact        = pj2Str(pci.local_contact);
-    remoteURI           = pj2Str(pci.remote_info);
+    remoteUri           = pj2Str(pci.remote_info);
     remoteContact       = pj2Str(pci.remote_contact);
     callIdString        = pj2Str(pci.call_id);
@@ -259,5 +261,5 @@
     connectDuration.fromPj(pci.connect_duration);
     totalDuration.fromPj(pci.total_duration);
-    remOfferer          = pci.rem_offerer;
+    remOfferer          = PJ2BOOL(pci.rem_offerer);
     remAudioCount       = pci.rem_aud_cnt;
     remVideoCount       = pci.rem_vid_cnt;
@@ -606,4 +608,6 @@
     return pjsua_call_vid_stream_is_running(id, med_idx, dir);
 #else
+    PJ_UNUSED_ARG(med_idx);
+    PJ_UNUSED_ARG(dir);
     return false;
 #endif
@@ -621,5 +625,7 @@
     PJSUA2_CHECK_EXPR( pjsua_call_set_vid_strm(id, op, &prm) );
 #else
-    PJSUA2_RAISE_ERROR(PJ_EINVOP);
+    PJ_UNUSED_ARG(op);
+    PJ_UNUSED_ARG(param);
+    PJSUA2_RAISE_ERROR(PJ_EINVALIDOP);
 #endif
 }
Index: /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/endpoint.cpp
===================================================================
--- /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/endpoint.cpp	(revision 4669)
+++ /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/endpoint.cpp	(revision 4670)
@@ -19,4 +19,5 @@
 #include <pjsua2/endpoint.hpp>
 #include <pjsua2/account.hpp>
+#include <pjsua2/call.hpp>
 #include <pjsua2/presence.hpp>
 #include <algorithm>
@@ -487,4 +488,16 @@
 }
 
+Call *Endpoint::lookupCall(int call_id, const char *op)
+{
+    Call *call = Call::lookup(call_id);
+    if (!call) {
+	PJ_LOG(1,(THIS_FILE,
+		  "Error: cannot find Call instance for call id %d in "
+		  "%s", call_id, op));
+    }
+
+    return call;
+}
+
 void Endpoint::on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id,
                                 pjsip_rx_data *rdata)
@@ -596,7 +609,11 @@
 
     if (call_id != PJSUA_INVALID_ID) {
-	// TODO:
-	//	handle call pager
-	return;
+	Call *call = lookupCall(call_id, "on_pager2()");
+	if (!call) {
+	    /* Ignored */
+	    return;
+	}
+
+	call->onInstantMessage(prm);
     } else {
 	Account *acc = lookupAcc(acc_id, "on_pager2()");
@@ -632,6 +649,11 @@
 
     if (call_id != PJSUA_INVALID_ID) {
-	// TODO:
-	//	handle call pager
+	Call *call = lookupCall(call_id, "on_pager_status2()");
+	if (!call) {
+	    /* Ignored */
+	    return;
+	}
+
+	call->onInstantMessageStatus(prm);
     } else {
 	Account *acc = lookupAcc(acc_id, "on_pager_status2()");
@@ -661,6 +683,11 @@
 
     if (call_id != PJSUA_INVALID_ID) {
-	// TODO:
-	//	handle call indication
+	Call *call = lookupCall(call_id, "on_typing2()");
+	if (!call) {
+	    /* Ignored */
+	    return;
+	}
+
+	call->onTypingIndication(prm);
     } else {
 	Account *acc = lookupAcc(acc_id, "on_typing2()");
@@ -722,4 +749,6 @@
                                  pjsip_event *e)
 {
+    PJ_UNUSED_ARG(tsx);
+
     Call *call = Call::lookup(call_id);
     if (!call) {
@@ -858,6 +887,6 @@
     prm.statusCode = (pjsip_status_code)st_code;
     prm.reason = pj2Str(*st_text);
-    prm.finalNotify = final;
-    prm.cont = *p_cont;
+    prm.finalNotify = PJ2BOOL(final);
+    prm.cont = PJ2BOOL(*p_cont);
     
     call->onCallTransferStatus(prm);
@@ -910,4 +939,6 @@
                                 pjsua_call_setting *opt)
 {
+    PJ_UNUSED_ARG(reserved);
+
     Call *call = Call::lookup(call_id);
     if (!call) {
Index: /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp
===================================================================
--- /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp	(revision 4669)
+++ /pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp	(revision 4670)
@@ -313,4 +313,6 @@
 				        throw(Error)
 {
+    PJ_UNUSED_ARG(max_size);
+
     pj_str_t pj_name = str2Pj(file_name);
 
@@ -427,5 +429,5 @@
 bool AudDevManager::sndIsActive() const
 {
-    return pjsua_snd_is_active();
+    return PJ2BOOL(pjsua_snd_is_active());
 }
 
