Misc update & fix:

- added new files (call & media) to VS2005 project
 - fixed compile warnings
 - fixed compile error when video is disabled
 - fixed Makefile when JAVA_HOME env var is set



git-svn-id: https://svn.pjsip.org/repos/pjproject/branches/projects/pjsua2@4670 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Nanang Izzuddin 2013-12-04 02:38:20 +00:00
parent b23faaba40
commit cc45350a25
8 changed files with 103 additions and 37 deletions

View File

@ -26,6 +26,13 @@ ifeq ("$(JAVA_HOME)","")
JAVAC_PATH := $(realpath $(JAVAC_PATH))
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
# OS specific

View File

@ -3128,6 +3128,10 @@
RelativePath="..\src\pjsua2\account.cpp"
>
</File>
<File
RelativePath="..\src\pjsua2\call.cpp"
>
</File>
<File
RelativePath="..\src\pjsua2\endpoint.cpp"
>
@ -3136,6 +3140,10 @@
RelativePath="..\src\pjsua2\json.cpp"
>
</File>
<File
RelativePath="..\src\pjsua2\media.cpp"
>
</File>
<File
RelativePath="..\src\pjsua2\persistent.cpp"
>
@ -3165,6 +3173,10 @@
RelativePath="..\include\pjsua2\account.hpp"
>
</File>
<File
RelativePath="..\include\pjsua2\call.hpp"
>
</File>
<File
RelativePath="..\include\pjsua2\config.hpp"
>
@ -3181,6 +3193,10 @@
RelativePath="..\include\pjsua2\json.hpp"
>
</File>
<File
RelativePath="..\include\pjsua2\media.hpp"
>
</File>
<File
RelativePath="..\include\pjsua2\persistent.hpp"
>

View File

@ -444,7 +444,7 @@ struct CallInfo
/**
* Local URI
*/
string localURI;
string localUri;
/**
* Local Contact
@ -454,7 +454,7 @@ struct CallInfo
/**
* Remote URI
*/
string remoteURI;
string remoteUri;
/**
* Remote contact
@ -1451,7 +1451,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallState(OnCallStateParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* This is a general notification callback which is called whenever
@ -1463,7 +1463,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallTsxState(OnCallTsxStateParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application when media state in the call has changed.
@ -1475,7 +1475,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallMediaState(OnCallMediaStateParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application when a call has just created a local SDP (for
@ -1487,7 +1487,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallSdpCreated(OnCallSdpCreatedParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application when media session is created and before it is
@ -1498,7 +1498,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onStreamCreated(OnStreamCreatedParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application when media session has been unregistered from the
@ -1507,7 +1507,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onStreamDestroyed(OnStreamDestroyedParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application upon incoming DTMF digits.
@ -1515,7 +1515,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onDtmfDigit(OnDtmfDigitParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application on call being transfered (i.e. REFER is received).
@ -1527,7 +1527,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallTransferRequest(OnCallTransferRequestParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application of the status of previously sent call
@ -1538,7 +1538,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallTransferStatus(OnCallTransferStatusParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application about incoming INVITE with Replaces header.
@ -1547,7 +1547,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallReplaceRequest(OnCallReplaceRequestParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application that an existing call has been replaced with
@ -1560,7 +1560,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallReplaced(OnCallReplacedParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application when call has received new offer from remote
@ -1574,7 +1574,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallRxOffer(OnCallRxOfferParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application on incoming MESSAGE request.
@ -1582,7 +1582,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onInstantMessage(OnInstantMessageParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application about the delivery status of outgoing MESSAGE
@ -1591,7 +1591,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onInstantMessageStatus(OnInstantMessageStatusParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notify application about typing indication.
@ -1599,7 +1599,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onTypingIndication(OnTypingIndicationParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* This callback is called when the call is about to resend the
@ -1644,6 +1644,7 @@ public:
*/
virtual pjsip_redirect_op onCallRedirected(OnCallRedirectedParam &prm)
{
PJ_UNUSED_ARG(prm);
return PJSIP_REDIRECT_STOP;
}
@ -1653,7 +1654,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallMediaTransportState(OnCallMediaTransportStateParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* Notification about media events such as video notifications. This
@ -1666,7 +1667,7 @@ public:
* @param prm Callback parameter.
*/
virtual void onCallMediaEvent(OnCallMediaEventParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
/**
* This callback can be used by application to implement custom media
@ -1682,7 +1683,7 @@ public:
*/
virtual void
onCreateMediaTransport(OnCreateMediaTransportParam &prm)
{}
{ PJ_UNUSED_ARG(prm); }
private:
Account &acc;

View File

@ -1134,9 +1134,10 @@ private:
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 */
static void on_incoming_call(pjsua_acc_id acc_id,

View File

@ -21,6 +21,7 @@
#ifdef _MSC_VER
# pragma warning( disable : 4290 ) // exception spec ignored
# pragma warning( disable : 4512 ) // can't generate assignment op
#endif
/**
@ -84,10 +85,11 @@ typedef void *TimerEntry;
typedef void *GenericData;
/*
* Forward declaration of Account to be used
* Forward declaration of Account and Call to be used
* by Endpoint.
*/
class Account;
class Call;
/**

View File

@ -171,12 +171,14 @@ CallSendRequestParam::CallSendRequestParam()
CallVidSetStreamParam::CallVidSetStreamParam()
{
#if PJSUA_HAS_VIDEO
pjsua_call_vid_strm_op_param prm;
pjsua_call_vid_strm_op_param_default(&prm);
this->medIdx = prm.med_idx;
this->dir = prm.dir;
this->capDev = prm.cap_dev;
#endif
}
CallSetting::CallSetting(pj_bool_t useDefaultValues)
@ -241,14 +243,14 @@ void CallMediaInfo::fromPj(const pjsua_call_media_info &prm)
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);
setting.fromPj(pci.setting);
@ -258,7 +260,7 @@ void CallInfo::fromPj(const pjsua_call_info &pci)
lastReason = pj2Str(pci.last_status_text);
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;
@ -605,6 +607,8 @@ bool Call::vidStreamIsRunning(int med_idx, pjmedia_dir dir) const
#if PJSUA_HAS_VIDEO
return pjsua_call_vid_stream_is_running(id, med_idx, dir);
#else
PJ_UNUSED_ARG(med_idx);
PJ_UNUSED_ARG(dir);
return false;
#endif
}
@ -620,7 +624,9 @@ void Call::vidSetStream(pjsua_call_vid_strm_op op,
prm.cap_dev = param.capDev;
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
}

View File

@ -18,6 +18,7 @@
*/
#include <pjsua2/endpoint.hpp>
#include <pjsua2/account.hpp>
#include <pjsua2/call.hpp>
#include <pjsua2/presence.hpp>
#include <algorithm>
#include "util.hpp"
@ -486,6 +487,18 @@ Account *Endpoint::lookupAcc(int acc_id, const char *op)
return acc;
}
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)
{
@ -595,9 +608,13 @@ void Endpoint::on_pager2(pjsua_call_id call_id,
prm.rdata.fromPj(*rdata);
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()");
if (!acc) {
@ -631,8 +648,13 @@ void Endpoint::on_pager_status2( pjsua_call_id call_id,
prm.rdata.fromPj(*rdata);
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()");
if (!acc) {
@ -660,8 +682,13 @@ void Endpoint::on_typing2( pjsua_call_id call_id,
prm.rdata.fromPj(*rdata);
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()");
if (!acc) {
@ -721,6 +748,8 @@ void Endpoint::on_call_tsx_state(pjsua_call_id call_id,
pjsip_transaction *tsx,
pjsip_event *e)
{
PJ_UNUSED_ARG(tsx);
Call *call = Call::lookup(call_id);
if (!call) {
return;
@ -857,8 +886,8 @@ void Endpoint::on_call_transfer_status(pjsua_call_id call_id,
OnCallTransferStatusParam prm;
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);
@ -909,6 +938,8 @@ void Endpoint::on_call_rx_offer(pjsua_call_id call_id,
pjsip_status_code *code,
pjsua_call_setting *opt)
{
PJ_UNUSED_ARG(reserved);
Call *call = Call::lookup(call_id);
if (!call) {
return;

View File

@ -312,6 +312,8 @@ void AudioMediaRecorder::createRecorder(const string &file_name,
unsigned options)
throw(Error)
{
PJ_UNUSED_ARG(max_size);
pj_str_t pj_name = str2Pj(file_name);
PJSUA2_CHECK_EXPR( pjsua_recorder_create(&pj_name,
@ -426,7 +428,7 @@ unsigned AudDevManager::getEcTail() const throw(Error)
bool AudDevManager::sndIsActive() const
{
return pjsua_snd_is_active();
return PJ2BOOL(pjsua_snd_is_active());
}
void AudDevManager::refreshDevs() throw(Error)