mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 19:48:07 +00:00
Merge branch 'master' of git.linphone.org:linphone
This commit is contained in:
commit
16d4eb519a
54 changed files with 3359 additions and 470 deletions
|
|
@ -233,6 +233,4 @@ clean-local:
|
|||
discovery:
|
||||
touch specs.cpp
|
||||
$(CC) --include $(top_builddir)/config.h \
|
||||
--include $(top_builddir)/mediastreamer2/mediastreamer-config.h \
|
||||
--include $(top_builddir)/oRTP/ortp-config.h \
|
||||
$(TUNNEL_CFLAGS) $(CFLAGS) $(MEDIASTREAMER2_CFLAGS) $(ORTP_CFLAGS) -E -P -v -dD specs.cpp
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ LOCAL_CFLAGS += \
|
|||
-DENABLE_TRACE \
|
||||
-DLINPHONE_VERSION=\"$(LINPHONE_VERSION)\" \
|
||||
-DLINPHONE_PLUGINS_DIR=\"\\tmp\" \
|
||||
-DLOG_DOMAIN=$(MY_LOG_DOMAIN)
|
||||
-DLOG_DOMAIN=$(MY_LOG_DOMAIN) \
|
||||
-DHAVE_EXOSIP_TRYLOCK=1
|
||||
|
||||
LOCAL_CFLAGS += -DIN_LINPHONE
|
||||
|
||||
|
|
@ -80,7 +81,8 @@ LOCAL_C_INCLUDES += \
|
|||
$(LOCAL_PATH)/../oRTP/include \
|
||||
$(LOCAL_PATH)/../mediastreamer2/include \
|
||||
$(LOCAL_PATH)/../../externals/exosip/include \
|
||||
$(LOCAL_PATH)/../../externals/osip/include
|
||||
$(LOCAL_PATH)/../../externals/osip/include \
|
||||
$(LOCAL_PATH)/../../../gen
|
||||
|
||||
LOCAL_LDLIBS += -llog -ldl
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ if test "$mingw_found" != "yes" ; then
|
|||
dnl AM_GNU_GETTEXT pollutes CPPFLAGS: workaround this.
|
||||
CPPFLAGS_save=$CPPFLAGS
|
||||
AM_GNU_GETTEXT([external])
|
||||
AC_SUBST(INTLLIBS)
|
||||
CPPFLAGS=$CPPFLAGS_save
|
||||
LIBS="$LIBS $LIBINTL"
|
||||
else
|
||||
|
|
|
|||
|
|
@ -29,13 +29,12 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_READLINE
|
||||
#ifdef HAVE_READLINE_H
|
||||
#include <readline.h>
|
||||
#define HAVE_READLINE
|
||||
#else
|
||||
#ifdef HAVE_READLINE_READLINE_H
|
||||
#include <readline/readline.h>
|
||||
#define HAVE_READLINE
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_HISTORY_H
|
||||
|
|
@ -45,6 +44,7 @@
|
|||
#include <readline/history.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef PARAMS
|
||||
/**************************************************************************
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ int TunnelManager::eXosipRecvfrom(int fd, void *buf, size_t len, int flags, stru
|
|||
int TunnelManager::eXosipSelect(int max_fds, fd_set *s1, fd_set *s2, fd_set *s3, struct timeval *tv,void* userdata){
|
||||
struct timeval begin,cur;
|
||||
TunnelManager* lTunnelMgr=(TunnelManager*)userdata;
|
||||
if (tv!=0 && tv->tv_sec){
|
||||
if (s1 && tv!=0 && tv->tv_sec){
|
||||
/*this is the select from udp.c, the one that is interesting to us*/
|
||||
NativeSocket udp_fd=(NativeSocket)eXosip_get_udp_socket();
|
||||
NativeSocket controlfd=(NativeSocket)eXosip_get_control_fd();
|
||||
|
||||
FD_ZERO(s1);
|
||||
FD_ZERO(s1);
|
||||
gettimeofday(&begin,NULL);
|
||||
do{
|
||||
struct timeval abit;
|
||||
|
|
@ -258,7 +258,7 @@ void TunnelManager::processTunnelEvent(const Event &ev){
|
|||
lTransport.tls_port=0;
|
||||
lTransport.dtls_port=0;
|
||||
|
||||
linphone_core_set_sip_transports(mCore, &lTransport);
|
||||
linphone_core_set_sip_transports(mCore, &lTransport);
|
||||
//register
|
||||
if (lProxy) {
|
||||
linphone_proxy_config_done(lProxy);
|
||||
|
|
|
|||
|
|
@ -27,9 +27,63 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
static void register_failure(SalOp *op, SalError error, SalReason reason, const char *details);
|
||||
|
||||
static bool_t media_parameters_changed(LinphoneCall *call, SalMediaDescription *oldmd, SalMediaDescription *newmd){
|
||||
if (call->params.in_conference!=call->current_params.in_conference) return TRUE;
|
||||
return !sal_media_description_equals(oldmd,newmd) || call->up_bw!=linphone_core_get_upload_bandwidth(call->core);
|
||||
static int media_parameters_changed(LinphoneCall *call, SalMediaDescription *oldmd, SalMediaDescription *newmd) {
|
||||
if (call->params.in_conference != call->current_params.in_conference) return SAL_MEDIA_DESCRIPTION_CHANGED;
|
||||
if (call->up_bw != linphone_core_get_upload_bandwidth(call->core)) return SAL_MEDIA_DESCRIPTION_CHANGED;
|
||||
return sal_media_description_equals(oldmd, newmd);
|
||||
}
|
||||
|
||||
void linphone_core_update_streams_destinations(LinphoneCore *lc, LinphoneCall *call, SalMediaDescription *old_md, SalMediaDescription *new_md) {
|
||||
SalStreamDescription *old_audiodesc = NULL;
|
||||
SalStreamDescription *old_videodesc = NULL;
|
||||
SalStreamDescription *new_audiodesc = NULL;
|
||||
SalStreamDescription *new_videodesc = NULL;
|
||||
char *rtp_addr, *rtcp_addr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < old_md->nstreams; i++) {
|
||||
if (old_md->streams[i].type == SalAudio) {
|
||||
old_audiodesc = &old_md->streams[i];
|
||||
} else if (old_md->streams[i].type == SalVideo) {
|
||||
old_videodesc = &old_md->streams[i];
|
||||
}
|
||||
}
|
||||
for (i = 0; i < new_md->nstreams; i++) {
|
||||
if (new_md->streams[i].type == SalAudio) {
|
||||
new_audiodesc = &new_md->streams[i];
|
||||
} else if (new_md->streams[i].type == SalVideo) {
|
||||
new_videodesc = &new_md->streams[i];
|
||||
}
|
||||
}
|
||||
if (call->audiostream && new_audiodesc) {
|
||||
rtp_addr = (new_audiodesc->rtp_addr[0] != '\0') ? new_audiodesc->rtp_addr : new_md->addr;
|
||||
rtcp_addr = (new_audiodesc->rtcp_addr[0] != '\0') ? new_audiodesc->rtcp_addr : new_md->addr;
|
||||
ms_message("Change audio stream destination: RTP=%s:%d RTCP=%s:%d", rtp_addr, new_audiodesc->rtp_port, rtcp_addr, new_audiodesc->rtcp_port);
|
||||
rtp_session_set_remote_addr_full(call->audiostream->session, rtp_addr, new_audiodesc->rtp_port, rtcp_addr, new_audiodesc->rtcp_port);
|
||||
}
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (call->videostream && new_videodesc) {
|
||||
rtp_addr = (new_videodesc->rtp_addr[0] != '\0') ? new_videodesc->rtp_addr : new_md->addr;
|
||||
rtcp_addr = (new_videodesc->rtcp_addr[0] != '\0') ? new_videodesc->rtcp_addr : new_md->addr;
|
||||
ms_message("Change video stream destination: RTP=%s:%d RTCP=%s:%d", rtp_addr, new_videodesc->rtp_port, rtcp_addr, new_videodesc->rtcp_port);
|
||||
rtp_session_set_remote_addr_full(call->videostream->session, rtp_addr, new_videodesc->rtp_port, rtcp_addr, new_videodesc->rtcp_port);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Copy address and port values from new_md to old_md since we will keep old_md as resultdesc */
|
||||
strcpy(old_md->addr, new_md->addr);
|
||||
if (old_audiodesc && new_audiodesc) {
|
||||
strcpy(old_audiodesc->rtp_addr, new_audiodesc->rtp_addr);
|
||||
strcpy(old_audiodesc->rtcp_addr, new_audiodesc->rtcp_addr);
|
||||
old_audiodesc->rtp_port = new_audiodesc->rtp_port;
|
||||
old_audiodesc->rtcp_port = new_audiodesc->rtcp_port;
|
||||
}
|
||||
if (old_videodesc && new_videodesc) {
|
||||
strcpy(old_videodesc->rtp_addr, new_videodesc->rtp_addr);
|
||||
strcpy(old_videodesc->rtcp_addr, new_videodesc->rtcp_addr);
|
||||
old_videodesc->rtp_port = new_videodesc->rtp_port;
|
||||
old_videodesc->rtcp_port = new_videodesc->rtcp_port;
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMediaDescription *new_md){
|
||||
|
|
@ -46,13 +100,11 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
|
|||
call->media_pending=TRUE;
|
||||
}
|
||||
call->resultdesc=new_md;
|
||||
if (call->ice_session != NULL) {
|
||||
linphone_core_deactivate_ice_for_deactivated_media_streams(call, call->resultdesc);
|
||||
}
|
||||
if ((call->audiostream && call->audiostream->ticker) || (call->videostream && call->videostream->ticker)){
|
||||
/* we already started media: check if we really need to restart it*/
|
||||
if (oldmd){
|
||||
if (!media_parameters_changed(call,oldmd,new_md) && !call->playing_ringbacktone){
|
||||
int md_changed = media_parameters_changed(call, oldmd, new_md);
|
||||
if ((md_changed == SAL_MEDIA_DESCRIPTION_UNCHANGED) && !call->playing_ringbacktone) {
|
||||
/*as nothing has changed, keep the oldmd */
|
||||
call->resultdesc=oldmd;
|
||||
sal_media_description_unref(new_md);
|
||||
|
|
@ -69,6 +121,12 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
|
|||
}
|
||||
ms_message("No need to restart streams, SDP is unchanged.");
|
||||
return;
|
||||
} else if ((md_changed == SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED) && !call->playing_ringbacktone) {
|
||||
call->resultdesc = oldmd;
|
||||
ms_message("Network parameters have changed, update them.");
|
||||
linphone_core_update_streams_destinations(lc, call, oldmd, new_md);
|
||||
sal_media_description_unref(new_md);
|
||||
return;
|
||||
}else{
|
||||
ms_message("Media descriptions are different, need to restart the streams.");
|
||||
}
|
||||
|
|
@ -269,6 +327,7 @@ static void call_accepted(SalOp *op){
|
|||
}
|
||||
|
||||
md=sal_call_get_final_media_description(op);
|
||||
call->params.has_video &= linphone_core_media_description_contains_video_stream(md);
|
||||
|
||||
if (call->state==LinphoneCallOutgoingProgress ||
|
||||
call->state==LinphoneCallOutgoingRinging ||
|
||||
|
|
@ -302,11 +361,7 @@ static void call_accepted(SalOp *op){
|
|||
linphone_core_update_streams (lc,call,md);
|
||||
linphone_call_set_state(call,LinphoneCallPausedByRemote,"Call paused by remote");
|
||||
}else{
|
||||
if (call->state==LinphoneCallStreamsRunning){
|
||||
/*media was running before, the remote as acceted a call modification (that is
|
||||
a reinvite made by us. We must notify the application this reinvite was accepted*/
|
||||
linphone_call_set_state(call, LinphoneCallUpdated, "Call updated");
|
||||
}else{
|
||||
if (call->state!=LinphoneCallUpdating){
|
||||
if (call->state==LinphoneCallResuming){
|
||||
if (lc->vtable.display_status){
|
||||
lc->vtable.display_status(lc,_("Call resumed."));
|
||||
|
|
@ -343,11 +398,6 @@ static void call_ack(SalOp *op){
|
|||
if (call->media_pending){
|
||||
SalMediaDescription *md=sal_call_get_final_media_description(op);
|
||||
if (md && !sal_media_description_empty(md)){
|
||||
if (call->state==LinphoneCallStreamsRunning){
|
||||
/*media was running before, the remote as acceted a call modification (that is
|
||||
a reinvite made by us. We must notify the application this reinvite was accepted*/
|
||||
linphone_call_set_state(call, LinphoneCallUpdated, "Call updated");
|
||||
}
|
||||
linphone_core_update_streams (lc,call,md);
|
||||
linphone_call_set_state (call,LinphoneCallStreamsRunning,"Connected (streams running)");
|
||||
}else{
|
||||
|
|
@ -815,14 +865,24 @@ static LinphoneChatMessageState chatStatusSal2Linphone(SalTextDeliveryStatus sta
|
|||
return LinphoneChatMessageStateIdle;
|
||||
}
|
||||
|
||||
static int op_equals(LinphoneCall *a, SalOp *b) {
|
||||
return a->op !=b; /*return 0 if equals*/
|
||||
}
|
||||
static void text_delivery_update(SalOp *op, SalTextDeliveryStatus status){
|
||||
LinphoneChatMessage *chat_msg=(LinphoneChatMessage* )sal_op_get_user_pointer(op);
|
||||
const MSList* calls = linphone_core_get_calls(chat_msg->chat_room->lc);
|
||||
|
||||
if (chat_msg && chat_msg->cb) {
|
||||
chat_msg->cb(chat_msg
|
||||
,chatStatusSal2Linphone(status)
|
||||
,chat_msg->cb_ud);
|
||||
}
|
||||
linphone_chat_message_destroy(chat_msg);
|
||||
|
||||
if (!ms_list_find_custom((MSList*)calls, (MSCompareFunc) op_equals, op)) {
|
||||
/*op was only create for messaging purpose, destroying*/
|
||||
sal_op_release(op);
|
||||
}
|
||||
}
|
||||
|
||||
SalCallbacks linphone_sal_callbacks={
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "linphonecore.h"
|
||||
#include "private.h"
|
||||
#include "linphonecore.h"
|
||||
#include "private.h"
|
||||
#include "lpconfig.h"
|
||||
|
||||
LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char *to){
|
||||
LinphoneAddress *parsed_url=NULL;
|
||||
|
|
@ -45,8 +46,6 @@
|
|||
lc->chatrooms=ms_list_remove(lc->chatrooms,(void *) cr);
|
||||
linphone_address_destroy(cr->peer_url);
|
||||
ms_free(cr->peer);
|
||||
if (cr->op)
|
||||
sal_op_release(cr->op);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -56,26 +55,24 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM
|
|||
SalOp *op=NULL;
|
||||
LinphoneCall *call;
|
||||
char* content_type;
|
||||
if((call = linphone_core_get_call_by_remote_address(cr->lc,cr->peer))!=NULL){
|
||||
if (call->state==LinphoneCallConnected ||
|
||||
call->state==LinphoneCallStreamsRunning ||
|
||||
call->state==LinphoneCallPaused ||
|
||||
call->state==LinphoneCallPausing ||
|
||||
call->state==LinphoneCallPausedByRemote){
|
||||
ms_message("send SIP message through the existing call.");
|
||||
op = call->op;
|
||||
call->pending_message=msg;
|
||||
|
||||
if (lp_config_get_int(cr->lc->config,"sip","chat_use_call_dialogs",1)){
|
||||
if((call = linphone_core_get_call_by_remote_address(cr->lc,cr->peer))!=NULL){
|
||||
if (call->state==LinphoneCallConnected ||
|
||||
call->state==LinphoneCallStreamsRunning ||
|
||||
call->state==LinphoneCallPaused ||
|
||||
call->state==LinphoneCallPausing ||
|
||||
call->state==LinphoneCallPausedByRemote){
|
||||
ms_message("send SIP message through the existing call.");
|
||||
op = call->op;
|
||||
call->pending_message=msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (op==NULL){
|
||||
/*sending out of calls*/
|
||||
op = sal_op_new(cr->lc->sal);
|
||||
sal_op_set_route(op,route);
|
||||
if (cr->op!=NULL){
|
||||
sal_op_release (cr->op);
|
||||
cr->op=NULL;
|
||||
}
|
||||
cr->op=op;
|
||||
sal_op_set_user_pointer(op, msg); /*if out of call, directly store msg*/
|
||||
}
|
||||
if (msg->external_body_url) {
|
||||
|
|
|
|||
|
|
@ -36,41 +36,50 @@ static void ecc_init_filters(EcCalibrator *ecc){
|
|||
|
||||
ecc->sndread=ms_snd_card_create_reader(ecc->play_card);
|
||||
ms_filter_call_method(ecc->sndread,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
|
||||
ms_filter_call_method(ecc->sndread,MS_FILTER_GET_SAMPLE_RATE,&rate);
|
||||
ecc->read_resampler=ms_filter_new(MS_RESAMPLE_ID);
|
||||
ms_filter_call_method(ecc->read_resampler,MS_FILTER_SET_SAMPLE_RATE,&rate);
|
||||
ms_filter_call_method(ecc->read_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&ecc->rate);
|
||||
|
||||
|
||||
ecc->det=ms_filter_new(MS_TONE_DETECTOR_ID);
|
||||
ms_filter_call_method(ecc->det,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
|
||||
ecc->rec=ms_filter_new(MS_FILE_REC_ID);
|
||||
|
||||
ms_filter_link(ecc->sndread,0,ecc->det,0);
|
||||
ms_filter_link(ecc->sndread,0,ecc->read_resampler,0);
|
||||
ms_filter_link(ecc->read_resampler,0,ecc->det,0);
|
||||
ms_filter_link(ecc->det,0,ecc->rec,0);
|
||||
|
||||
ecc->play=ms_filter_new(MS_FILE_PLAYER_ID);
|
||||
ecc->gen=ms_filter_new(MS_DTMF_GEN_ID);
|
||||
ms_filter_call_method(ecc->gen,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
|
||||
ecc->resampler=ms_filter_new(MS_RESAMPLE_ID);
|
||||
ecc->write_resampler=ms_filter_new(MS_RESAMPLE_ID);
|
||||
ecc->sndwrite=ms_snd_card_create_writer(ecc->capt_card);
|
||||
|
||||
ms_filter_link(ecc->play,0,ecc->gen,0);
|
||||
ms_filter_link(ecc->gen,0,ecc->resampler,0);
|
||||
ms_filter_link(ecc->resampler,0,ecc->sndwrite,0);
|
||||
|
||||
|
||||
ms_filter_call_method(ecc->sndwrite,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
|
||||
ms_filter_call_method(ecc->sndwrite,MS_FILTER_GET_SAMPLE_RATE,&rate);
|
||||
ms_filter_call_method(ecc->resampler,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
|
||||
ms_filter_call_method(ecc->resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&rate);
|
||||
ms_filter_call_method(ecc->write_resampler,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
|
||||
ms_filter_call_method(ecc->write_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&rate);
|
||||
|
||||
ms_filter_link(ecc->play,0,ecc->gen,0);
|
||||
ms_filter_link(ecc->gen,0,ecc->write_resampler,0);
|
||||
ms_filter_link(ecc->write_resampler,0,ecc->sndwrite,0);
|
||||
|
||||
ms_ticker_attach(ecc->ticker,ecc->play);
|
||||
ms_ticker_attach(ecc->ticker,ecc->sndread);
|
||||
ms_ticker_attach(ecc->ticker,ecc->play);
|
||||
|
||||
}
|
||||
|
||||
static void ecc_deinit_filters(EcCalibrator *ecc){
|
||||
ms_ticker_detach(ecc->ticker,ecc->play);
|
||||
ms_ticker_detach(ecc->ticker,ecc->sndread);
|
||||
ms_ticker_detach(ecc->ticker,ecc->play);
|
||||
|
||||
ms_filter_unlink(ecc->play,0,ecc->gen,0);
|
||||
ms_filter_unlink(ecc->gen,0,ecc->resampler,0);
|
||||
ms_filter_unlink(ecc->resampler,0,ecc->sndwrite,0);
|
||||
ms_filter_unlink(ecc->gen,0,ecc->write_resampler,0);
|
||||
ms_filter_unlink(ecc->write_resampler,0,ecc->sndwrite,0);
|
||||
|
||||
ms_filter_unlink(ecc->sndread,0,ecc->det,0);
|
||||
ms_filter_unlink(ecc->sndread,0,ecc->read_resampler,0);
|
||||
ms_filter_unlink(ecc->read_resampler,0,ecc->det,0);
|
||||
ms_filter_unlink(ecc->det,0,ecc->rec,0);
|
||||
|
||||
ms_filter_destroy(ecc->sndread);
|
||||
|
|
@ -78,7 +87,8 @@ static void ecc_deinit_filters(EcCalibrator *ecc){
|
|||
ms_filter_destroy(ecc->rec);
|
||||
ms_filter_destroy(ecc->play);
|
||||
ms_filter_destroy(ecc->gen);
|
||||
ms_filter_destroy(ecc->resampler);
|
||||
ms_filter_destroy(ecc->read_resampler);
|
||||
ms_filter_destroy(ecc->write_resampler);
|
||||
ms_filter_destroy(ecc->sndwrite);
|
||||
|
||||
ms_ticker_destroy(ecc->ticker);
|
||||
|
|
@ -104,7 +114,6 @@ static void ecc_play_tones(EcCalibrator *ecc){
|
|||
MSDtmfGenCustomTone tone;
|
||||
MSToneDetectorDef expected_tone;
|
||||
|
||||
|
||||
ms_filter_set_notify_callback(ecc->det,on_tone_received,ecc);
|
||||
|
||||
expected_tone.frequency=2000;
|
||||
|
|
@ -113,7 +122,7 @@ static void ecc_play_tones(EcCalibrator *ecc){
|
|||
|
||||
ms_filter_call_method (ecc->det,MS_TONE_DETECTOR_ADD_SCAN,&expected_tone);
|
||||
|
||||
tone.frequency=1000;
|
||||
tone.frequency=1300;
|
||||
tone.duration=1000;
|
||||
tone.amplitude=1.0;
|
||||
|
||||
|
|
@ -132,20 +141,29 @@ static void ecc_play_tones(EcCalibrator *ecc){
|
|||
ms_filter_call_method(ecc->gen,MS_DTMF_GEN_PLAY_CUSTOM,&tone);
|
||||
ms_sleep(1);
|
||||
|
||||
if (ecc->sent_count==3 && ecc->recv_count==3){
|
||||
int delay=ecc->acc/3;
|
||||
if (delay<0){
|
||||
ms_error("Quite surprising calibration result, delay=%i",delay);
|
||||
ecc->status=LinphoneEcCalibratorFailed;
|
||||
}else{ms_message("Echo calibration estimated delay to be %i ms",delay);
|
||||
ecc->delay=delay;
|
||||
ecc->status=LinphoneEcCalibratorDone;
|
||||
if (ecc->sent_count==3) {
|
||||
if (ecc->recv_count==3){
|
||||
int delay=ecc->acc/3;
|
||||
if (delay<0){
|
||||
ms_error("Quite surprising calibration result, delay=%i",delay);
|
||||
ecc->status=LinphoneEcCalibratorFailed;
|
||||
}else{
|
||||
ms_message("Echo calibration estimated delay to be %i ms",delay);
|
||||
ecc->delay=delay;
|
||||
ecc->status=LinphoneEcCalibratorDone;
|
||||
}
|
||||
} else if (ecc->recv_count == 0) {
|
||||
ms_message("Echo calibration succeeded, no echo has been detected");
|
||||
ecc->status = LinphoneEcCalibratorDoneNoEcho;
|
||||
} else {
|
||||
ecc->status = LinphoneEcCalibratorFailed;
|
||||
}
|
||||
}else{
|
||||
ms_error("Echo calibration failed, tones received = %i",ecc->recv_count);
|
||||
ecc->status=LinphoneEcCalibratorFailed;
|
||||
}
|
||||
|
||||
if (ecc->status == LinphoneEcCalibratorFailed) {
|
||||
ms_error("Echo calibration failed, tones received = %i",ecc->recv_count);
|
||||
}
|
||||
}
|
||||
|
||||
static void * ecc_thread(void *p){
|
||||
|
|
|
|||
|
|
@ -396,8 +396,8 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf)
|
|||
void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend* fl){
|
||||
MSList *el=ms_list_find(lc->friends,(void *)fl);
|
||||
if (el!=NULL){
|
||||
lc->friends=ms_list_remove_link(lc->friends,el);
|
||||
linphone_friend_destroy((LinphoneFriend*)el->data);
|
||||
lc->friends=ms_list_remove_link(lc->friends,el);
|
||||
linphone_core_write_friends_config(lc);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
|
|||
public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {}
|
||||
public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {}
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){}
|
||||
public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) {}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ public class TutorialChatRoom implements LinphoneCoreListener {
|
|||
public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {}
|
||||
public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {}
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){}
|
||||
public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) {}
|
||||
|
||||
public void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from, String message) {
|
||||
write("Message ["+message+"] received from ["+from.asString()+"]");
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {}
|
||||
public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {}
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){}
|
||||
public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) {}
|
||||
/*
|
||||
* Call state notification listener
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {}
|
||||
public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {}
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){}
|
||||
public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) {}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Check tutorial was called with the right number of arguments
|
||||
|
|
|
|||
|
|
@ -277,6 +277,7 @@ static SalMediaDescription *_create_local_media_description(LinphoneCore *lc, Li
|
|||
update_media_description_from_stun(md,&call->ac,&call->vc);
|
||||
if (call->ice_session != NULL) {
|
||||
linphone_core_update_local_media_description_from_ice(md, call->ice_session);
|
||||
linphone_core_update_ice_state_in_call_stats(call);
|
||||
}
|
||||
linphone_address_destroy(addr);
|
||||
return md;
|
||||
|
|
@ -297,17 +298,35 @@ SalMediaDescription *create_local_media_description(LinphoneCore *lc, LinphoneCa
|
|||
return _create_local_media_description(lc,call,id,id);
|
||||
}
|
||||
|
||||
static int find_port_offset(LinphoneCore *lc){
|
||||
static int find_port_offset(LinphoneCore *lc, SalStreamType type){
|
||||
int offset;
|
||||
MSList *elem;
|
||||
int audio_port;
|
||||
int tried_port;
|
||||
int existing_port;
|
||||
bool_t already_used=FALSE;
|
||||
for(offset=0;offset<100;offset+=2){
|
||||
audio_port=linphone_core_get_audio_port (lc)+offset;
|
||||
switch (type) {
|
||||
default:
|
||||
case SalAudio:
|
||||
tried_port=linphone_core_get_audio_port (lc)+offset;
|
||||
break;
|
||||
case SalVideo:
|
||||
tried_port=linphone_core_get_video_port (lc)+offset;
|
||||
break;
|
||||
}
|
||||
already_used=FALSE;
|
||||
for(elem=lc->calls;elem!=NULL;elem=elem->next){
|
||||
LinphoneCall *call=(LinphoneCall*)elem->data;
|
||||
if (call->audio_port==audio_port) {
|
||||
switch (type) {
|
||||
default:
|
||||
case SalAudio:
|
||||
existing_port = call->audio_port;
|
||||
break;
|
||||
case SalVideo:
|
||||
existing_port = call->video_port;
|
||||
break;
|
||||
}
|
||||
if (existing_port==tried_port) {
|
||||
already_used=TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -321,8 +340,54 @@ static int find_port_offset(LinphoneCore *lc){
|
|||
return offset;
|
||||
}
|
||||
|
||||
static int select_random_port(LinphoneCore *lc, SalStreamType type) {
|
||||
MSList *elem;
|
||||
int nb_tries;
|
||||
int tried_port = 0;
|
||||
int existing_port = 0;
|
||||
int min_port = 0, max_port = 0;
|
||||
bool_t already_used = FALSE;
|
||||
|
||||
switch (type) {
|
||||
default:
|
||||
case SalAudio:
|
||||
linphone_core_get_audio_port_range(lc, &min_port, &max_port);
|
||||
break;
|
||||
case SalVideo:
|
||||
linphone_core_get_video_port_range(lc, &min_port, &max_port);
|
||||
break;
|
||||
}
|
||||
tried_port = (rand() % (max_port - min_port) + min_port) & ~0x1;
|
||||
if (tried_port < min_port) tried_port = min_port + 2;
|
||||
for (nb_tries = 0; nb_tries < 100; nb_tries++) {
|
||||
for (elem = lc->calls; elem != NULL; elem = elem->next) {
|
||||
LinphoneCall *call = (LinphoneCall *)elem->data;
|
||||
switch (type) {
|
||||
default:
|
||||
case SalAudio:
|
||||
existing_port = call->audio_port;
|
||||
break;
|
||||
case SalVideo:
|
||||
existing_port = call->video_port;
|
||||
break;
|
||||
}
|
||||
if (existing_port == tried_port) {
|
||||
already_used = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!already_used) break;
|
||||
}
|
||||
if (nb_tries == 100) {
|
||||
ms_error("Could not find any free port!");
|
||||
return -1;
|
||||
}
|
||||
return tried_port;
|
||||
}
|
||||
|
||||
static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from, LinphoneAddress *to){
|
||||
int port_offset;
|
||||
int min_port, max_port;
|
||||
call->magic=linphone_call_magic;
|
||||
call->refcnt=1;
|
||||
call->state=LinphoneCallIdle;
|
||||
|
|
@ -332,10 +397,26 @@ static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from,
|
|||
call->log=linphone_call_log_new(call, from, to);
|
||||
call->owns_call_log=TRUE;
|
||||
linphone_core_notify_all_friends(call->core,LinphoneStatusOnThePhone);
|
||||
port_offset=find_port_offset (call->core);
|
||||
if (port_offset==-1) return;
|
||||
call->audio_port=linphone_core_get_audio_port(call->core)+port_offset;
|
||||
call->video_port=linphone_core_get_video_port(call->core)+port_offset;
|
||||
linphone_core_get_audio_port_range(call->core, &min_port, &max_port);
|
||||
if (min_port == max_port) {
|
||||
/* Used fixed RTP audio port. */
|
||||
port_offset=find_port_offset (call->core, SalAudio);
|
||||
if (port_offset==-1) return;
|
||||
call->audio_port=linphone_core_get_audio_port(call->core)+port_offset;
|
||||
} else {
|
||||
/* Select random RTP audio port in the specified range. */
|
||||
call->audio_port = select_random_port(call->core, SalAudio);
|
||||
}
|
||||
linphone_core_get_video_port_range(call->core, &min_port, &max_port);
|
||||
if (min_port == max_port) {
|
||||
/* Used fixed RTP video port. */
|
||||
port_offset=find_port_offset (call->core, SalVideo);
|
||||
if (port_offset==-1) return;
|
||||
call->video_port=linphone_core_get_video_port(call->core)+port_offset;
|
||||
} else {
|
||||
/* Select random RTP video port in the specified range. */
|
||||
call->video_port = select_random_port(call->core, SalVideo);
|
||||
}
|
||||
linphone_call_init_stats(&call->stats[LINPHONE_CALL_STATS_AUDIO], LINPHONE_CALL_STATS_AUDIO);
|
||||
linphone_call_init_stats(&call->stats[LINPHONE_CALL_STATS_VIDEO], LINPHONE_CALL_STATS_VIDEO);
|
||||
}
|
||||
|
|
@ -411,6 +492,7 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
|
|||
linphone_address_clean(from);
|
||||
linphone_core_get_local_ip(lc,linphone_address_get_domain(from),call->localip);
|
||||
linphone_call_init_common(call, from, to);
|
||||
call->log->call_id=ms_strdup(sal_op_get_call_id(op)); /*must be known at that time*/
|
||||
linphone_core_init_default_params(lc, &call->params);
|
||||
call->params.has_video &= !!lc->video_policy.automatically_accept;
|
||||
call->params.has_video &= linphone_core_media_description_contains_video_stream(sal_call_get_remote_media_description(op));
|
||||
|
|
@ -520,8 +602,8 @@ const char *linphone_call_state_to_string(LinphoneCallState cs){
|
|||
return "LinphoneCallUpdatedByRemote";
|
||||
case LinphoneCallIncomingEarlyMedia:
|
||||
return "LinphoneCallIncomingEarlyMedia";
|
||||
case LinphoneCallUpdated:
|
||||
return "LinphoneCallUpdated";
|
||||
case LinphoneCallUpdating:
|
||||
return "LinphoneCallUpdating";
|
||||
case LinphoneCallReleased:
|
||||
return "LinphoneCallReleased";
|
||||
}
|
||||
|
|
@ -580,6 +662,7 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const
|
|||
|
||||
static void linphone_call_destroy(LinphoneCall *obj)
|
||||
{
|
||||
linphone_call_delete_ice_session(obj);
|
||||
if (obj->op!=NULL) {
|
||||
sal_op_release(obj->op);
|
||||
obj->op=NULL;
|
||||
|
|
@ -603,9 +686,6 @@ static void linphone_call_destroy(LinphoneCall *obj)
|
|||
if (obj->auth_token) {
|
||||
ms_free(obj->auth_token);
|
||||
}
|
||||
if (obj->ice_session) {
|
||||
ice_session_destroy(obj->ice_session);
|
||||
}
|
||||
|
||||
ms_free(obj);
|
||||
}
|
||||
|
|
@ -853,6 +933,9 @@ const PayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallP
|
|||
return cp->video_codec;
|
||||
}
|
||||
|
||||
bool_t linphone_call_params_low_bandwidth_enabled(const LinphoneCallParams *cp) {
|
||||
return cp->low_bandwidth;
|
||||
}
|
||||
/**
|
||||
* Returns whether video is enabled.
|
||||
**/
|
||||
|
|
@ -1074,8 +1157,7 @@ void linphone_call_init_media_streams(LinphoneCall *call){
|
|||
|
||||
static int dtmf_tab[16]={'0','1','2','3','4','5','6','7','8','9','*','#','A','B','C','D'};
|
||||
|
||||
static void linphone_core_dtmf_received(RtpSession* s, int dtmf, void* user_data){
|
||||
LinphoneCore* lc = (LinphoneCore*)user_data;
|
||||
static void linphone_core_dtmf_received(LinphoneCore *lc, int dtmf){
|
||||
if (dtmf<0 || dtmf>15){
|
||||
ms_warning("Bad dtmf value %i",dtmf);
|
||||
return;
|
||||
|
|
@ -1165,7 +1247,7 @@ static void post_configure_audio_streams(LinphoneCall*call){
|
|||
if (lc->vtable.dtmf_received!=NULL){
|
||||
/* replace by our default action*/
|
||||
audio_stream_play_received_dtmfs(call->audiostream,FALSE);
|
||||
rtp_session_signal_connect(call->audiostream->session,"telephone-event",(RtpCallback)linphone_core_dtmf_received,(unsigned long)lc);
|
||||
/*rtp_session_signal_connect(call->audiostream->session,"telephone-event",(RtpCallback)linphone_core_dtmf_received,(unsigned long)lc);*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1370,6 +1452,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
|
|||
linphone_call_add_to_conf(call, mute);
|
||||
}
|
||||
call->current_params.in_conference=call->params.in_conference;
|
||||
call->current_params.low_bandwidth=call->params.low_bandwidth;
|
||||
}else ms_warning("No audio stream accepted ?");
|
||||
}
|
||||
}
|
||||
|
|
@ -1570,7 +1653,6 @@ static void linphone_call_log_fill_stats(LinphoneCallLog *log, AudioStream *st){
|
|||
|
||||
void linphone_call_stop_audio_stream(LinphoneCall *call) {
|
||||
if (call->audiostream!=NULL) {
|
||||
call->audiostream->ice_check_list = NULL;
|
||||
rtp_session_unregister_event_queue(call->audiostream->session,call->audiostream_app_evq);
|
||||
ortp_ev_queue_flush(call->audiostream_app_evq);
|
||||
ortp_ev_queue_destroy(call->audiostream_app_evq);
|
||||
|
|
@ -1596,7 +1678,6 @@ void linphone_call_stop_audio_stream(LinphoneCall *call) {
|
|||
void linphone_call_stop_video_stream(LinphoneCall *call) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (call->videostream!=NULL){
|
||||
call->videostream->ice_check_list = NULL;
|
||||
rtp_session_unregister_event_queue(call->videostream->session,call->videostream_app_evq);
|
||||
ortp_ev_queue_flush(call->videostream_app_evq);
|
||||
ortp_ev_queue_destroy(call->videostream_app_evq);
|
||||
|
|
@ -1818,9 +1899,8 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
|
|||
ice_session_compute_candidates_foundations(call->ice_session);
|
||||
ice_session_eliminate_redundant_candidates(call->ice_session);
|
||||
ice_session_choose_default_candidates(call->ice_session);
|
||||
ping_time = ice_session_gathering_duration(call->ice_session);
|
||||
ping_time = ice_session_average_gathering_round_trip_time(call->ice_session);
|
||||
if (ping_time >=0) {
|
||||
ping_time /= ice_session_nb_check_lists(call->ice_session);
|
||||
call->ping_time=ping_time;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1828,7 +1908,7 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
|
|||
linphone_call_delete_ice_session(call);
|
||||
}
|
||||
switch (call->state) {
|
||||
case LinphoneCallStreamsRunning:
|
||||
case LinphoneCallUpdating:
|
||||
linphone_core_start_update_call(call->core, call);
|
||||
break;
|
||||
case LinphoneCallUpdatedByRemote:
|
||||
|
|
@ -1838,13 +1918,16 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
|
|||
linphone_call_stop_media_streams_for_ice_gathering(call);
|
||||
linphone_core_proceed_with_invite_if_ready(call->core, call, NULL);
|
||||
break;
|
||||
default:
|
||||
case LinphoneCallIdle:
|
||||
linphone_call_stop_media_streams_for_ice_gathering(call);
|
||||
linphone_core_notify_incoming_call(call->core, call);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (evt == ORTP_EVENT_ICE_LOSING_PAIRS_COMPLETED) {
|
||||
linphone_core_start_accept_call_update(call->core, call);
|
||||
linphone_core_update_ice_state_in_call_stats(call);
|
||||
} else if (evt == ORTP_EVENT_ICE_RESTART_NEEDED) {
|
||||
ice_session_restart(call->ice_session);
|
||||
ice_session_set_role(call->ice_session, IR_Controlling);
|
||||
|
|
@ -1949,6 +2032,8 @@ void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapse
|
|||
} else if ((evt == ORTP_EVENT_ICE_SESSION_PROCESSING_FINISHED) || (evt == ORTP_EVENT_ICE_GATHERING_FINISHED)
|
||||
|| (evt == ORTP_EVENT_ICE_LOSING_PAIRS_COMPLETED) || (evt == ORTP_EVENT_ICE_RESTART_NEEDED)) {
|
||||
handle_ice_events(call, ev);
|
||||
} else if (evt==ORTP_EVENT_TELEPHONE_EVENT){
|
||||
linphone_core_dtmf_received(lc,evd->info.telephone_event);
|
||||
}
|
||||
ortp_event_destroy(ev);
|
||||
}
|
||||
|
|
@ -2007,3 +2092,39 @@ void linphone_call_set_transfer_state(LinphoneCall* call, LinphoneCallState stat
|
|||
bool_t linphone_call_is_in_conference(const LinphoneCall *call) {
|
||||
return call->params.in_conference;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Perform a zoom of the video displayed during a call.
|
||||
* @param call the call.
|
||||
* @param zoom_factor a floating point number describing the zoom factor. A value 1.0 corresponds to no zoom applied.
|
||||
* @param cx a floating point number pointing the horizontal center of the zoom to be applied. This value should be between 0.0 and 1.0.
|
||||
* @param cy a floating point number pointing the vertical center of the zoom to be applied. This value should be between 0.0 and 1.0.
|
||||
*
|
||||
* cx and cy are updated in return in case their coordinates were to excentrated for the requested zoom factor. The zoom ensures that all the screen is fullfilled with the video.
|
||||
**/
|
||||
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy) {
|
||||
VideoStream* vstream = call->videostream;
|
||||
if (vstream) {
|
||||
float zoom[3];
|
||||
|
||||
if (zoom_factor < 1)
|
||||
zoom_factor = 1;
|
||||
float halfsize = 0.5 * 1.0 / zoom_factor;
|
||||
|
||||
if ((*cx - halfsize) < 0)
|
||||
*cx = 0 + halfsize;
|
||||
if ((*cx + halfsize) > 1)
|
||||
*cx = 1 - halfsize;
|
||||
if ((*cy - halfsize) < 0)
|
||||
*cy = 0 + halfsize;
|
||||
if ((*cy + halfsize) > 1)
|
||||
*cy = 1 - halfsize;
|
||||
|
||||
zoom[0] = zoom_factor;
|
||||
zoom[1] = *cx;
|
||||
zoom[2] = *cy;
|
||||
ms_filter_call_method(vstream->output, MS_VIDEO_DISPLAY_ZOOM, &zoom);
|
||||
}else ms_warning("Could not apply zoom: video output wasn't activated.");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ void call_logs_write_to_config_file(LinphoneCore *lc){
|
|||
if (cl->refkey) lp_config_set_string(cfg,logsection,"refkey",cl->refkey);
|
||||
lp_config_set_float(cfg,logsection,"quality",cl->quality);
|
||||
lp_config_set_int(cfg,logsection,"video_enabled", cl->video_enabled);
|
||||
lp_config_set_string(cfg,logsection,"call_id",cl->call_id);
|
||||
}
|
||||
for(;i<lc->max_call_logs;++i){
|
||||
snprintf(logsection,sizeof(logsection),"call_log_%i",i);
|
||||
|
|
@ -189,6 +190,8 @@ static void call_logs_read_from_config_file(LinphoneCore *lc){
|
|||
if (tmp) cl->refkey=ms_strdup(tmp);
|
||||
cl->quality=lp_config_get_float(cfg,logsection,"quality",-1);
|
||||
cl->video_enabled=lp_config_get_int(cfg,logsection,"video_enabled",0);
|
||||
cl->call_id=lp_config_get_string(cfg,logsection,"call_id",NULL);
|
||||
if(cl->call_id) cl->call_id=ms_strdup(cl->call_id);
|
||||
lc->call_logs=ms_list_append(lc->call_logs,cl);
|
||||
}else break;
|
||||
}
|
||||
|
|
@ -296,6 +299,7 @@ void linphone_call_log_destroy(LinphoneCallLog *cl){
|
|||
if (cl->from!=NULL) linphone_address_destroy(cl->from);
|
||||
if (cl->to!=NULL) linphone_address_destroy(cl->to);
|
||||
if (cl->refkey!=NULL) ms_free(cl->refkey);
|
||||
if (cl->call_id) ms_free((void*)cl->call_id);
|
||||
ms_free(cl);
|
||||
}
|
||||
|
||||
|
|
@ -616,22 +620,34 @@ static void sip_config_read(LinphoneCore *lc)
|
|||
sal_use_one_matching_codec_policy(lc->sal,lp_config_get_int(lc->config,"sip","only_one_codec",0));
|
||||
sal_use_double_registrations(lc->sal,lp_config_get_int(lc->config,"sip","use_double_registrations",1));
|
||||
sal_set_dscp(lc->sal,linphone_core_get_sip_dscp(lc));
|
||||
sal_use_dates(lc->sal,lp_config_get_int(lc->config,"sip","put_date",0));
|
||||
}
|
||||
|
||||
static void rtp_config_read(LinphoneCore *lc)
|
||||
{
|
||||
int port;
|
||||
int min_port, max_port;
|
||||
int jitt_comp;
|
||||
int nortp_timeout;
|
||||
bool_t rtp_no_xmit_on_audio_mute;
|
||||
bool_t adaptive_jitt_comp_enabled;
|
||||
|
||||
port=lp_config_get_int(lc->config,"rtp","audio_rtp_port",7078);
|
||||
linphone_core_set_audio_port(lc,port);
|
||||
if (lp_config_get_range(lc->config, "rtp", "audio_rtp_port", &min_port, &max_port, 7078, 7078) == TRUE) {
|
||||
if (min_port <= 0) min_port = 1;
|
||||
if (max_port > 65535) max_port = 65535;
|
||||
linphone_core_set_audio_port_range(lc, min_port, max_port);
|
||||
} else {
|
||||
min_port = lp_config_get_int(lc->config, "rtp", "audio_rtp_port", 7078);
|
||||
linphone_core_set_audio_port(lc, min_port);
|
||||
}
|
||||
|
||||
port=lp_config_get_int(lc->config,"rtp","video_rtp_port",9078);
|
||||
if (port==0) port=9078;
|
||||
linphone_core_set_video_port(lc,port);
|
||||
if (lp_config_get_range(lc->config, "rtp", "video_rtp_port", &min_port, &max_port, 9078, 9078) == TRUE) {
|
||||
if (min_port <= 0) min_port = 1;
|
||||
if (max_port > 65535) max_port = 65535;
|
||||
linphone_core_set_video_port_range(lc, min_port, max_port);
|
||||
} else {
|
||||
min_port = lp_config_get_int(lc->config, "rtp", "video_rtp_port", 9078);
|
||||
linphone_core_set_video_port(lc, min_port);
|
||||
}
|
||||
|
||||
jitt_comp=lp_config_get_int(lc->config,"rtp","audio_jitt_comp",60);
|
||||
linphone_core_set_audio_jittcomp(lc,jitt_comp);
|
||||
|
|
@ -700,25 +716,28 @@ static bool_t get_codec(LpConfig *config, const char* type, int index, PayloadTy
|
|||
}
|
||||
|
||||
#define RANK_END 10000
|
||||
static const char *codec_pref_order[]={
|
||||
"SILK",
|
||||
"speex",
|
||||
"iLBC",
|
||||
"amr",
|
||||
"gsm",
|
||||
"pcmu",
|
||||
"pcma",
|
||||
"VP8",
|
||||
"H264",
|
||||
"MP4V-ES",
|
||||
"H263-1998",
|
||||
NULL,
|
||||
|
||||
typedef struct codec_desc{
|
||||
const char *name;
|
||||
int rate;
|
||||
}codec_desc_t;
|
||||
|
||||
static codec_desc_t codec_pref_order[]={
|
||||
{"SILK", 16000},
|
||||
{"speex", 16000},
|
||||
{"speex", 8000},
|
||||
{"pcmu",8000},
|
||||
{"pcma",8000},
|
||||
{"VP8",90000},
|
||||
{"H264",90000},
|
||||
{"MP4V-ES",90000},
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
static int find_codec_rank(const char *mime){
|
||||
static int find_codec_rank(const char *mime, int clock_rate){
|
||||
int i;
|
||||
for(i=0;codec_pref_order[i]!=NULL;++i){
|
||||
if (strcasecmp(codec_pref_order[i],mime)==0)
|
||||
for(i=0;codec_pref_order[i].name!=NULL;++i){
|
||||
if (strcasecmp(codec_pref_order[i].name,mime)==0 && clock_rate==codec_pref_order[i].rate)
|
||||
return i;
|
||||
}
|
||||
return RANK_END;
|
||||
|
|
@ -726,8 +745,8 @@ static int find_codec_rank(const char *mime){
|
|||
|
||||
static int codec_compare(const PayloadType *a, const PayloadType *b){
|
||||
int ra,rb;
|
||||
ra=find_codec_rank(a->mime_type);
|
||||
rb=find_codec_rank(b->mime_type);
|
||||
ra=find_codec_rank(a->mime_type,a->clock_rate);
|
||||
rb=find_codec_rank(b->mime_type,b->clock_rate);
|
||||
if (ra>rb) return 1;
|
||||
if (ra<rb) return -1;
|
||||
return 0;
|
||||
|
|
@ -747,7 +766,7 @@ static MSList *add_missing_codecs(SalStreamType mtype, MSList *l){
|
|||
if (pt && ms_filter_codec_supported(pt->mime_type)){
|
||||
if (ms_list_find(l,pt)==NULL){
|
||||
/*unranked codecs are disabled by default*/
|
||||
if (find_codec_rank(pt->mime_type)!=RANK_END){
|
||||
if (find_codec_rank(pt->mime_type, pt->clock_rate)!=RANK_END){
|
||||
payload_type_set_flag(pt,PAYLOAD_TYPE_ENABLED);
|
||||
}
|
||||
ms_message("Adding new codec %s/%i with fmtp %s",
|
||||
|
|
@ -823,6 +842,7 @@ static void video_config_read(LinphoneCore *lc){
|
|||
const char *str;
|
||||
#ifdef VIDEO_ENABLED
|
||||
LinphoneVideoPolicy vpol;
|
||||
memset(&vpol, 0, sizeof(LinphoneVideoPolicy));
|
||||
#endif
|
||||
build_video_devices_table(lc);
|
||||
|
||||
|
|
@ -1079,6 +1099,7 @@ static void misc_config_read (LinphoneCore *lc) {
|
|||
static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, const char *config_path,
|
||||
const char *factory_config_path, void * userdata)
|
||||
{
|
||||
ms_message("Initializing LinphoneCore %s", linphone_core_get_version());
|
||||
memset (lc, 0, sizeof (LinphoneCore));
|
||||
lc->data=userdata;
|
||||
lc->ringstream_autorelease=TRUE;
|
||||
|
|
@ -1432,7 +1453,18 @@ int linphone_core_get_video_jittcomp(LinphoneCore *lc)
|
|||
**/
|
||||
int linphone_core_get_audio_port(const LinphoneCore *lc)
|
||||
{
|
||||
return lc->rtp_conf.audio_rtp_port;
|
||||
return lc->rtp_conf.audio_rtp_min_port;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the audio port range from which is randomly chosen the UDP port used for audio streaming.
|
||||
*
|
||||
* @ingroup network_parameters
|
||||
*/
|
||||
void linphone_core_get_audio_port_range(const LinphoneCore *lc, int *min_port, int *max_port)
|
||||
{
|
||||
*min_port = lc->rtp_conf.audio_rtp_min_port;
|
||||
*max_port = lc->rtp_conf.audio_rtp_max_port;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1441,7 +1473,18 @@ int linphone_core_get_audio_port(const LinphoneCore *lc)
|
|||
* @ingroup network_parameters
|
||||
**/
|
||||
int linphone_core_get_video_port(const LinphoneCore *lc){
|
||||
return lc->rtp_conf.video_rtp_port;
|
||||
return lc->rtp_conf.video_rtp_min_port;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the video port range from which is randomly chosen the UDP port used for video streaming.
|
||||
*
|
||||
* @ingroup network_parameters
|
||||
*/
|
||||
void linphone_core_get_video_port_range(const LinphoneCore *lc, int *min_port, int *max_port)
|
||||
{
|
||||
*min_port = lc->rtp_conf.video_rtp_min_port;
|
||||
*max_port = lc->rtp_conf.video_rtp_max_port;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1493,7 +1536,16 @@ void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc,bool_t rtp_no_
|
|||
**/
|
||||
void linphone_core_set_audio_port(LinphoneCore *lc, int port)
|
||||
{
|
||||
lc->rtp_conf.audio_rtp_port=port;
|
||||
lc->rtp_conf.audio_rtp_min_port=lc->rtp_conf.audio_rtp_max_port=port;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the UDP port range from which to randomly select the port used for audio streaming.
|
||||
*/
|
||||
void linphone_core_set_audio_port_range(LinphoneCore *lc, int min_port, int max_port)
|
||||
{
|
||||
lc->rtp_conf.audio_rtp_min_port=min_port;
|
||||
lc->rtp_conf.audio_rtp_max_port=max_port;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1502,7 +1554,16 @@ void linphone_core_set_audio_port(LinphoneCore *lc, int port)
|
|||
* @ingroup network_parameters
|
||||
**/
|
||||
void linphone_core_set_video_port(LinphoneCore *lc, int port){
|
||||
lc->rtp_conf.video_rtp_port=port;
|
||||
lc->rtp_conf.video_rtp_min_port=lc->rtp_conf.video_rtp_max_port=port;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the UDP port range from which to randomly select the port used for video streaming.
|
||||
*/
|
||||
void linphone_core_set_video_port_range(LinphoneCore *lc, int min_port, int max_port)
|
||||
{
|
||||
lc->rtp_conf.video_rtp_min_port=min_port;
|
||||
lc->rtp_conf.video_rtp_max_port=max_port;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1875,6 +1936,10 @@ void linphone_core_iterate(LinphoneCore *lc){
|
|||
if (ecs==LinphoneEcCalibratorDone){
|
||||
int len=lp_config_get_int(lc->config,"sound","ec_tail_len",0);
|
||||
lp_config_set_int(lc->config, "sound", "ec_delay",MAX(lc->ecc->delay-(len/2),0));
|
||||
} else if (ecs == LinphoneEcCalibratorFailed) {
|
||||
lp_config_set_int(lc->config, "sound", "ec_delay", LP_CONFIG_DEFAULT_INT(lc->config, "ec_delay", 250));
|
||||
} else if (ecs == LinphoneEcCalibratorDoneNoEcho) {
|
||||
linphone_core_enable_echo_cancellation(lc, FALSE);
|
||||
}
|
||||
ec_calibrator_destroy(lc->ecc);
|
||||
lc->ecc=NULL;
|
||||
|
|
@ -2212,6 +2277,7 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call){
|
|||
real_url=linphone_address_as_string(call->log->to);
|
||||
from=linphone_address_as_string(call->log->from);
|
||||
err=sal_call(call->op,from,real_url);
|
||||
call->log->call_id=ms_strdup(sal_op_get_call_id(call->op)); /*must be known at that time*/
|
||||
|
||||
if (lc->sip_conf.sdp_200_ack){
|
||||
call->media_pending=TRUE;
|
||||
|
|
@ -2532,7 +2598,6 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){
|
|||
int linphone_core_start_update_call(LinphoneCore *lc, LinphoneCall *call){
|
||||
const char *subject;
|
||||
call->camera_active=call->params.has_video;
|
||||
update_local_media_description(lc,call);
|
||||
if (call->ice_session != NULL)
|
||||
linphone_core_update_local_media_description_from_ice(call->localdesc, call->ice_session);
|
||||
|
||||
|
|
@ -2564,6 +2629,7 @@ int linphone_core_start_update_call(LinphoneCore *lc, LinphoneCall *call){
|
|||
int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){
|
||||
int err=0;
|
||||
if (params!=NULL){
|
||||
linphone_call_set_state(call,LinphoneCallUpdating,"Updating call");
|
||||
#ifdef VIDEO_ENABLED
|
||||
bool_t has_video = call->params.has_video;
|
||||
if ((call->ice_session != NULL) && (call->videostream != NULL) && !params->has_video) {
|
||||
|
|
@ -2571,10 +2637,10 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho
|
|||
call->videostream->ice_check_list = NULL;
|
||||
}
|
||||
call->params = *params;
|
||||
if ((call->ice_session != NULL) && (ice_session_state(call->ice_session) != IS_Completed) && !has_video && params->has_video) {
|
||||
update_local_media_description(lc, call);
|
||||
if ((call->ice_session != NULL) && !has_video && call->params.has_video) {
|
||||
/* Defer call update until the ICE candidates gathering process has finished. */
|
||||
ms_message("Defer call update to gather ICE candidates");
|
||||
update_local_media_description(lc, call);
|
||||
linphone_call_init_video_stream(call);
|
||||
video_stream_prepare_video(call->videostream);
|
||||
if (linphone_core_gather_ice_candidates(lc,call)<0) {
|
||||
|
|
@ -2852,6 +2918,7 @@ static void terminate_call(LinphoneCore *lc, LinphoneCall *call){
|
|||
linphone_call_stop_media_streams(call);
|
||||
if (lc->vtable.display_status!=NULL)
|
||||
lc->vtable.display_status(lc,_("Call ended") );
|
||||
linphone_call_set_state(call,LinphoneCallEnd,"Call terminated");
|
||||
}
|
||||
|
||||
int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri){
|
||||
|
|
@ -2859,7 +2926,6 @@ int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char
|
|||
sal_call_decline(call->op,SalReasonRedirect,redirect_uri);
|
||||
call->reason=LinphoneReasonDeclined;
|
||||
terminate_call(lc,call);
|
||||
linphone_call_set_state(call,LinphoneCallEnd,"Call terminated");
|
||||
}else{
|
||||
ms_error("Bad state for call redirection.");
|
||||
return -1;
|
||||
|
|
@ -2893,8 +2959,35 @@ int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *the_call)
|
|||
}
|
||||
sal_call_terminate(call->op);
|
||||
terminate_call(lc,call);
|
||||
return 0;
|
||||
}
|
||||
|
||||
linphone_call_set_state(call,LinphoneCallEnd,"Call terminated");
|
||||
/**
|
||||
* Decline a pending incoming call, with a reason.
|
||||
* @param lc the linphone core
|
||||
* @param call the LinphoneCall, must be in the IncomingReceived state.
|
||||
* @param reason the reason for rejecting the call: LinphoneReasonDeclined or LinphoneReasonBusy
|
||||
**/
|
||||
int linphone_core_decline_call(LinphoneCore *lc, LinphoneCall * call, LinphoneReason reason){
|
||||
SalReason sal_reason=SalReasonUnknown;
|
||||
if (call->state!=LinphoneCallIncomingReceived && call->state!=LinphoneCallIncomingEarlyMedia){
|
||||
ms_error("linphone_core_decline_call(): Cannot decline a call that is in state %s",linphone_call_state_to_string(call->state));
|
||||
return -1;
|
||||
}
|
||||
switch(reason){
|
||||
case LinphoneReasonDeclined:
|
||||
sal_reason=SalReasonDeclined;
|
||||
break;
|
||||
case LinphoneReasonBusy:
|
||||
sal_reason=SalReasonBusy;
|
||||
break;
|
||||
default:
|
||||
ms_error("linphone_core_decline_call(): unsupported reason %s",linphone_reason_to_string(reason));
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
sal_call_decline(call->op,sal_reason,NULL);
|
||||
terminate_call(lc,call);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -3832,7 +3925,10 @@ void linphone_core_enable_video(LinphoneCore *lc, bool_t vcap_enabled, bool_t di
|
|||
#endif
|
||||
lc->video_conf.capture=vcap_enabled;
|
||||
lc->video_conf.display=display_enabled;
|
||||
|
||||
if (linphone_core_ready(lc)){
|
||||
lp_config_set_int(lc->config,"video","display",lc->video_conf.display);
|
||||
lp_config_set_int(lc->config,"video","capture",lc->video_conf.capture);
|
||||
}
|
||||
/* need to re-apply network bandwidth settings*/
|
||||
linphone_core_set_download_bandwidth(lc,
|
||||
linphone_core_get_download_bandwidth(lc));
|
||||
|
|
@ -4544,8 +4640,16 @@ void sip_config_uninit(LinphoneCore *lc)
|
|||
void rtp_config_uninit(LinphoneCore *lc)
|
||||
{
|
||||
rtp_config_t *config=&lc->rtp_conf;
|
||||
lp_config_set_int(lc->config,"rtp","audio_rtp_port",config->audio_rtp_port);
|
||||
lp_config_set_int(lc->config,"rtp","video_rtp_port",config->video_rtp_port);
|
||||
if (config->audio_rtp_min_port == config->audio_rtp_max_port) {
|
||||
lp_config_set_int(lc->config, "rtp", "audio_rtp_port", config->audio_rtp_min_port);
|
||||
} else {
|
||||
lp_config_set_range(lc->config, "rtp", "audio_rtp_port", config->audio_rtp_min_port, config->audio_rtp_max_port);
|
||||
}
|
||||
if (config->video_rtp_min_port == config->video_rtp_max_port) {
|
||||
lp_config_set_int(lc->config, "rtp", "video_rtp_port", config->video_rtp_min_port);
|
||||
} else {
|
||||
lp_config_set_range(lc->config, "rtp", "video_rtp_port", config->video_rtp_min_port, config->video_rtp_max_port);
|
||||
}
|
||||
lp_config_set_int(lc->config,"rtp","audio_jitt_comp",config->audio_jitt_comp);
|
||||
lp_config_set_int(lc->config,"rtp","video_jitt_comp",config->video_jitt_comp);
|
||||
lp_config_set_int(lc->config,"rtp","nortp_timeout",config->nortp_timeout);
|
||||
|
|
@ -4899,6 +5003,8 @@ const char *linphone_reason_to_string(LinphoneReason err){
|
|||
return "User not found";
|
||||
case LinphoneReasonNotAnswered:
|
||||
return "Not answered";
|
||||
case LinphoneReasonBusy:
|
||||
return "Busy";
|
||||
}
|
||||
return "unknown error";
|
||||
}
|
||||
|
|
@ -5030,7 +5136,7 @@ bool_t linphone_core_sound_resources_locked(LinphoneCore *lc){
|
|||
case LinphoneCallConnected:
|
||||
case LinphoneCallRefered:
|
||||
case LinphoneCallIncomingEarlyMedia:
|
||||
case LinphoneCallUpdated:
|
||||
case LinphoneCallUpdating:
|
||||
return TRUE;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -5105,30 +5211,7 @@ void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *para
|
|||
params->in_conference=FALSE;
|
||||
}
|
||||
|
||||
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy) {
|
||||
VideoStream* vstream = call->videostream;
|
||||
if (vstream) {
|
||||
float zoom[3];
|
||||
|
||||
if (zoom_factor < 1)
|
||||
zoom_factor = 1;
|
||||
float halfsize = 0.5 * 1.0 / zoom_factor;
|
||||
|
||||
if ((*cx - halfsize) < 0)
|
||||
*cx = 0 + halfsize;
|
||||
if ((*cx + halfsize) > 1)
|
||||
*cx = 1 - halfsize;
|
||||
if ((*cy - halfsize) < 0)
|
||||
*cy = 0 + halfsize;
|
||||
if ((*cy + halfsize) > 1)
|
||||
*cy = 1 - halfsize;
|
||||
|
||||
zoom[0] = zoom_factor;
|
||||
zoom[1] = *cx;
|
||||
zoom[2] = *cy;
|
||||
ms_filter_call_method(vstream->output, MS_VIDEO_DISPLAY_ZOOM, &zoom);
|
||||
}else ms_warning("Could not apply zoom: video output wasn't activated.");
|
||||
}
|
||||
|
||||
void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id) {
|
||||
if (lc->device_id) ms_free(lc->device_id);
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ typedef struct _LinphoneCallLog{
|
|||
LinphoneCallStatus status; /**< The status of the call*/
|
||||
LinphoneAddress *from; /**<Originator of the call as a LinphoneAddress object*/
|
||||
LinphoneAddress *to; /**<Destination of the call as a LinphoneAddress object*/
|
||||
char start_date[128]; /**<Human readable string containg the start date*/
|
||||
char start_date[128]; /**<Human readable string containing the start date*/
|
||||
int duration; /**<Duration of the call in seconds*/
|
||||
char *refkey;
|
||||
void *user_pointer;
|
||||
|
|
@ -156,6 +156,7 @@ typedef struct _LinphoneCallLog{
|
|||
int video_enabled;
|
||||
struct _LinphoneCore *lc;
|
||||
time_t start_date_time; /**Start date of the call in seconds as expressed in a time_t */
|
||||
const char* call_id; /**unique id of a call*/
|
||||
} LinphoneCallLog;
|
||||
|
||||
|
||||
|
|
@ -203,7 +204,14 @@ bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams
|
|||
bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp);
|
||||
void linphone_call_params_set_audio_bandwidth_limit(LinphoneCallParams *cp, int bw);
|
||||
void linphone_call_params_destroy(LinphoneCallParams *cp);
|
||||
|
||||
/**
|
||||
* @ingroup call_control
|
||||
* Use to know if this call has been configured in low bandwidth mode.
|
||||
* This mode can be automatically discovered thanks to a stun server when activate_edge_workarounds=1 in section [net] of configuration file
|
||||
* <br> When enabled, this param may transform a call request with video in audio only mode.
|
||||
* @return TRUE if low bandwidth has been configured/detected
|
||||
*/
|
||||
bool_t linphone_call_params_low_bandwidth_enabled(const LinphoneCallParams *cp);
|
||||
/**
|
||||
* Enum describing failure reasons.
|
||||
* @ingroup initializing
|
||||
|
|
@ -214,7 +222,8 @@ enum _LinphoneReason{
|
|||
LinphoneReasonBadCredentials, /**<Authentication failed due to bad or missing credentials*/
|
||||
LinphoneReasonDeclined, /**<The call has been declined*/
|
||||
LinphoneReasonNotFound, /**<Destination of the calls was not found.*/
|
||||
LinphoneReasonNotAnswered
|
||||
LinphoneReasonNotAnswered, /**<The call was not answered in time*/
|
||||
LinphoneReasonBusy /**<Phone line was busy */
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -343,7 +352,7 @@ typedef enum _LinphoneCallState{
|
|||
LinphoneCallPausedByRemote, /**<The call is paused by remote end*/
|
||||
LinphoneCallUpdatedByRemote, /**<The call's parameters change is requested by remote end, used for example when video is added by remote */
|
||||
LinphoneCallIncomingEarlyMedia, /**<We are proposing early media to an incoming call */
|
||||
LinphoneCallUpdated, /**<The remote accepted the call update initiated by us */
|
||||
LinphoneCallUpdating, /**<A call update has been initiated by us */
|
||||
LinphoneCallReleased /**< The call object is no more retained by the core */
|
||||
} LinphoneCallState;
|
||||
|
||||
|
|
@ -382,6 +391,7 @@ void *linphone_call_get_user_pointer(LinphoneCall *call);
|
|||
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
|
||||
void linphone_call_set_next_video_frame_decoded_callback(LinphoneCall *call, LinphoneCallCbFunc cb, void* user_data);
|
||||
LinphoneCallState linphone_call_get_transfer_state(LinphoneCall *call);
|
||||
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy);
|
||||
/**
|
||||
* Return TRUE if this call is currently part of a conference
|
||||
*@param call #LinphoneCall
|
||||
|
|
@ -955,6 +965,8 @@ int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *call);
|
|||
|
||||
int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri);
|
||||
|
||||
int linphone_core_decline_call(LinphoneCore *lc, LinphoneCall * call, LinphoneReason reason);
|
||||
|
||||
int linphone_core_terminate_all_calls(LinphoneCore *lc);
|
||||
|
||||
int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call);
|
||||
|
|
@ -1107,14 +1119,22 @@ void linphone_core_set_video_jittcomp(LinphoneCore *lc, int value);
|
|||
|
||||
int linphone_core_get_audio_port(const LinphoneCore *lc);
|
||||
|
||||
void linphone_core_get_audio_port_range(const LinphoneCore *lc, int *min_port, int *max_port);
|
||||
|
||||
int linphone_core_get_video_port(const LinphoneCore *lc);
|
||||
|
||||
void linphone_core_get_video_port_range(const LinphoneCore *lc, int *min_port, int *max_port);
|
||||
|
||||
int linphone_core_get_nortp_timeout(const LinphoneCore *lc);
|
||||
|
||||
void linphone_core_set_audio_port(LinphoneCore *lc, int port);
|
||||
|
||||
void linphone_core_set_audio_port_range(LinphoneCore *lc, int min_port, int max_port);
|
||||
|
||||
void linphone_core_set_video_port(LinphoneCore *lc, int port);
|
||||
|
||||
void linphone_core_set_video_port_range(LinphoneCore *lc, int min_port, int max_port);
|
||||
|
||||
void linphone_core_set_nortp_timeout(LinphoneCore *lc, int port);
|
||||
|
||||
void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc, bool_t use_info);
|
||||
|
|
@ -1412,8 +1432,6 @@ typedef struct LinphoneTunnel LinphoneTunnel;
|
|||
*/
|
||||
LinphoneTunnel *linphone_core_get_tunnel(LinphoneCore *lc);
|
||||
|
||||
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy);
|
||||
|
||||
void linphone_core_set_sip_dscp(LinphoneCore *lc, int dscp);
|
||||
int linphone_core_get_sip_dscp(const LinphoneCore *lc);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#include <jni.h>
|
||||
#include "linphonecore_jni.h"
|
||||
#include "linphonecore_utils.h"
|
||||
#include <ortp/zrtp.h>
|
||||
|
||||
|
|
@ -53,6 +54,9 @@ static JavaVM *jvm=0;
|
|||
#ifdef ANDROID
|
||||
static void linphone_android_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){
|
||||
int prio;
|
||||
char str[4096];
|
||||
char *current;
|
||||
char *next;
|
||||
switch(lev){
|
||||
case ORTP_DEBUG: prio = ANDROID_LOG_DEBUG; break;
|
||||
case ORTP_MESSAGE: prio = ANDROID_LOG_INFO; break;
|
||||
|
|
@ -61,7 +65,19 @@ static void linphone_android_log_handler(OrtpLogLevel lev, const char *fmt, va_l
|
|||
case ORTP_FATAL: prio = ANDROID_LOG_FATAL; break;
|
||||
default: prio = ANDROID_LOG_DEFAULT; break;
|
||||
}
|
||||
__android_log_vprint(prio, LOG_DOMAIN, fmt, args);
|
||||
vsnprintf(str, sizeof(str) - 1, fmt, args);
|
||||
str[sizeof(str) - 1] = '\0';
|
||||
if (strlen(str) < 512) {
|
||||
__android_log_write(prio, LOG_DOMAIN, str);
|
||||
} else {
|
||||
current = str;
|
||||
while ((next = strchr(current, '\n')) != NULL) {
|
||||
*next = '\0';
|
||||
__android_log_write(prio, LOG_DOMAIN, current);
|
||||
current = next + 1;
|
||||
}
|
||||
__android_log_write(prio, LOG_DOMAIN, current);
|
||||
}
|
||||
}
|
||||
|
||||
int dumbMethodForAllowingUsageOfCpuFeaturesFromStaticLibMediastream() {
|
||||
|
|
@ -110,6 +126,7 @@ public:
|
|||
vTable.call_encryption_changed = callEncryptionChange;
|
||||
vTable.text_received = text_received;
|
||||
vTable.message_received = message_received;
|
||||
vTable.dtmf_received = dtmf_received;
|
||||
vTable.new_subscription_request = new_subscription_request;
|
||||
vTable.notify_presence_recv = notify_presence_recv;
|
||||
vTable.call_stats_updated = callStatsUpdated;
|
||||
|
|
@ -157,6 +174,7 @@ public:
|
|||
/*void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from,String message);*/
|
||||
textReceivedId = env->GetMethodID(listenerClass,"textReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneAddress;Ljava/lang/String;)V");
|
||||
messageReceivedId = env->GetMethodID(listenerClass,"messageReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneChatMessage;)V");
|
||||
dtmfReceivedId = env->GetMethodID(listenerClass,"dtmfReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;I)V");
|
||||
|
||||
proxyClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneProxyConfigImpl"));
|
||||
proxyCtrId = env->GetMethodID(proxyClass,"<init>", "(J)V");
|
||||
|
|
@ -211,6 +229,7 @@ public:
|
|||
jmethodID notifyPresenceReceivedId;
|
||||
jmethodID textReceivedId;
|
||||
jmethodID messageReceivedId;
|
||||
jmethodID dtmfReceivedId;
|
||||
jmethodID callStatsUpdatedId;
|
||||
|
||||
jclass globalStateClass;
|
||||
|
|
@ -390,6 +409,20 @@ public:
|
|||
,env->NewObject(lcData->friendClass,lcData->friendCtrId,(jlong)my_friend)
|
||||
,url ? env->NewStringUTF(url) : NULL);
|
||||
}
|
||||
static void dtmf_received(LinphoneCore *lc, LinphoneCall *call, int dtmf) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
ms_error("cannot attach VM\n");
|
||||
return;
|
||||
}
|
||||
LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
|
||||
env->CallVoidMethod(lcData->listener
|
||||
,lcData->dtmfReceivedId
|
||||
,lcData->core
|
||||
,lcData->getCall(env,call)
|
||||
,dtmf);
|
||||
}
|
||||
static void text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
|
|
@ -499,7 +532,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv*
|
|||
if (factoryConfig) env->ReleaseStringUTFChars(jfactoryConfig, factoryConfig);
|
||||
return nativePtr;
|
||||
}
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_delete(JNIEnv* env
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_delete(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)lc);
|
||||
|
|
@ -507,7 +540,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_delete(JNIEnv* env
|
|||
delete lcData;
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_clearProxyConfigs(JNIEnv* env, jobject thiz,jlong lc) {
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearProxyConfigs(JNIEnv* env, jobject thiz,jlong lc) {
|
||||
linphone_core_clear_proxy_config((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
|
|
@ -541,7 +574,7 @@ extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_getProxyConfigList
|
|||
return jProxies;
|
||||
}
|
||||
|
||||
extern "C" int Java_org_linphone_core_LinphoneCoreImpl_addProxyConfig( JNIEnv* env
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_addProxyConfig( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jobject jproxyCfg
|
||||
,jlong lc
|
||||
|
|
@ -549,10 +582,10 @@ extern "C" int Java_org_linphone_core_LinphoneCoreImpl_addProxyConfig( JNIEnv*
|
|||
LinphoneProxyConfig* proxy = (LinphoneProxyConfig*)pc;
|
||||
linphone_proxy_config_set_user_data(proxy, env->NewGlobalRef(jproxyCfg));
|
||||
|
||||
return linphone_core_add_proxy_config((LinphoneCore*)lc,(LinphoneProxyConfig*)pc);
|
||||
return (jint)linphone_core_add_proxy_config((LinphoneCore*)lc,(LinphoneProxyConfig*)pc);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_clearAuthInfos(JNIEnv* env, jobject thiz,jlong lc) {
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearAuthInfos(JNIEnv* env, jobject thiz,jlong lc) {
|
||||
linphone_core_clear_all_auth_info((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
|
|
@ -605,13 +638,13 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInCall( JNIEnv* e
|
|||
,jobject thiz
|
||||
,jlong lc) {
|
||||
|
||||
return linphone_core_in_call((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_in_call((LinphoneCore*)lc);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInComingInvitePending( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
|
||||
return linphone_core_inc_invite_pending((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_inc_invite_pending((LinphoneCore*)lc);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_acceptCall( JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -653,7 +686,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCallLog( JNIEnv* en
|
|||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getNumberOfCallLogs( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
return ms_list_size(linphone_core_get_call_logs((LinphoneCore*)lc));
|
||||
return (jint)ms_list_size(linphone_core_get_call_logs((LinphoneCore*)lc));
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setNetworkStateReachable( JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -665,7 +698,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setNetworkStateReachable
|
|||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isNetworkStateReachable( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
return linphone_core_is_network_reachable((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_is_network_reachable((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPlaybackGain( JNIEnv* env
|
||||
|
|
@ -675,10 +708,10 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPlaybackGain( JNIEnv*
|
|||
linphone_core_set_playback_gain_db((LinphoneCore*)lc,gain);
|
||||
}
|
||||
|
||||
extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getPlaybackGain( JNIEnv* env
|
||||
extern "C" jfloat Java_org_linphone_core_LinphoneCoreImpl_getPlaybackGain( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
return linphone_core_get_playback_gain_db((LinphoneCore*)lc);
|
||||
return (jfloat)linphone_core_get_playback_gain_db((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_muteMic( JNIEnv* env
|
||||
|
|
@ -716,10 +749,10 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_stopDtmf( JNIEnv* env
|
|||
linphone_core_stop_dtmf((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_getMissedCallsCount(JNIEnv* env
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMissedCallsCount(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
linphone_core_get_missed_calls_count((LinphoneCore*)lc);
|
||||
return (jint)linphone_core_get_missed_calls_count((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_resetMissedCallsCount(JNIEnv* env
|
||||
|
|
@ -742,7 +775,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearCallLogs(JNIEnv* e
|
|||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isMicMuted( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
return linphone_core_is_mic_muted((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_is_mic_muted((LinphoneCore*)lc);
|
||||
}
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findPayloadType(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -791,12 +824,12 @@ extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_listAudioPayloadTy
|
|||
return jCodecs;
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType(JNIEnv* env
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,jlong pt
|
||||
,jboolean enable) {
|
||||
return linphone_core_enable_payload_type((LinphoneCore*)lc,(PayloadType*)pt,enable);
|
||||
return (jint)linphone_core_enable_payload_type((LinphoneCore*)lc,(PayloadType*)pt,enable);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -814,14 +847,14 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isEchoCancellationEn
|
|||
,jobject thiz
|
||||
,jlong lc
|
||||
) {
|
||||
return linphone_core_echo_cancellation_enabled((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_echo_cancellation_enabled((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isEchoLimiterEnabled(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
) {
|
||||
return linphone_core_echo_limiter_enabled((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_echo_limiter_enabled((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getCurrentCall(JNIEnv* env
|
||||
|
|
@ -850,7 +883,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPresenceInfo(JNIEnv*
|
|||
if (alternative_contact) env->ReleaseStringUTFChars(jalternative_contact, alternative_contact);
|
||||
}
|
||||
|
||||
extern "C" long Java_org_linphone_core_LinphoneCoreImpl_createChatRoom(JNIEnv* env
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_createChatRoom(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,jstring jto) {
|
||||
|
|
@ -858,7 +891,7 @@ extern "C" long Java_org_linphone_core_LinphoneCoreImpl_createChatRoom(JNIEnv*
|
|||
const char* to = env->GetStringUTFChars(jto, NULL);
|
||||
LinphoneChatRoom* lResult = linphone_core_create_chat_room((LinphoneCore*)lc,to);
|
||||
env->ReleaseStringUTFChars(jto, to);
|
||||
return (long)lResult;
|
||||
return (jlong)lResult;
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableVideo(JNIEnv* env
|
||||
|
|
@ -872,7 +905,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableVideo(JNIEnv* env
|
|||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isVideoEnabled(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
return linphone_core_video_enabled((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_video_enabled((LinphoneCore*)lc);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPlayFile(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -919,67 +952,45 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableKeepAlive(JNIEnv*
|
|||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isKeepAliveEnabled(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
return linphone_core_keep_alive_enabled((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_keep_alive_enabled((LinphoneCore*)lc);
|
||||
|
||||
}
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startEchoCalibration(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,jobject data) {
|
||||
return linphone_core_start_echo_calibration((LinphoneCore*)lc
|
||||
return (jint)linphone_core_start_echo_calibration((LinphoneCore*)lc
|
||||
, LinphoneCoreData::ecCalibrationStatus
|
||||
, data?env->NewGlobalRef(data):NULL);
|
||||
|
||||
}
|
||||
|
||||
extern "C" int Java_org_linphone_core_LinphoneCoreImpl_getMediaEncryption(JNIEnv* env
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMediaEncryption(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
) {
|
||||
return (int)linphone_core_get_media_encryption((LinphoneCore*)lc);
|
||||
return (jint)linphone_core_get_media_encryption((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setMediaEncryption(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,int menc) {
|
||||
,jint menc) {
|
||||
linphone_core_set_media_encryption((LinphoneCore*)lc,(LinphoneMediaEncryption)menc);
|
||||
}
|
||||
|
||||
extern "C" long Java_org_linphone_core_LinphoneCallParamsImpl_getUsedAudioCodec(JNIEnv *env, jobject thiz, jlong cp) {
|
||||
return (long)linphone_call_params_get_used_audio_codec((LinphoneCallParams *)cp);
|
||||
}
|
||||
|
||||
extern "C" long Java_org_linphone_core_LinphoneCallParamsImpl_getUsedVideoCodec(JNIEnv *env, jobject thiz, jlong cp) {
|
||||
return (long)linphone_call_params_get_used_video_codec((LinphoneCallParams *)cp);
|
||||
}
|
||||
|
||||
extern "C" int Java_org_linphone_core_LinphoneCallParamsImpl_getMediaEncryption(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong cp
|
||||
) {
|
||||
return (int)linphone_call_params_get_media_encryption((LinphoneCallParams*)cp);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_mediaEncryptionSupported(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc, jint menc
|
||||
) {
|
||||
return linphone_core_media_encryption_supported((LinphoneCore*)lc,(LinphoneMediaEncryption)menc);
|
||||
return (jboolean)linphone_core_media_encryption_supported((LinphoneCore*)lc,(LinphoneMediaEncryption)menc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_setMediaEncryption(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong cp
|
||||
,int jmenc) {
|
||||
linphone_call_params_set_media_encryption((LinphoneCallParams*)cp,(LinphoneMediaEncryption)jmenc);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_getMediaEncryptionMandatory(JNIEnv* env
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isMediaEncryptionMandatory(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
) {
|
||||
return linphone_core_is_media_encryption_mandatory((LinphoneCore*)lc);
|
||||
return (jboolean)linphone_core_is_media_encryption_mandatory((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setMediaEncryptionMandatory(JNIEnv* env
|
||||
|
|
@ -1013,9 +1024,9 @@ extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getIdentity(JN
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_setProxy(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jproxy) {
|
||||
extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_setProxy(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jproxy) {
|
||||
const char* proxy = env->GetStringUTFChars(jproxy, NULL);
|
||||
int err=linphone_proxy_config_set_server_addr((LinphoneProxyConfig*)proxyCfg,proxy);
|
||||
jint err=linphone_proxy_config_set_server_addr((LinphoneProxyConfig*)proxyCfg,proxy);
|
||||
env->ReleaseStringUTFChars(jproxy, proxy);
|
||||
return err;
|
||||
}
|
||||
|
|
@ -1032,14 +1043,14 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setContactParamet
|
|||
linphone_proxy_config_set_contact_parameters((LinphoneProxyConfig*)proxyCfg, params);
|
||||
env->ReleaseStringUTFChars(jparams, params);
|
||||
}
|
||||
extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_setRoute(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jroute) {
|
||||
extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_setRoute(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jroute) {
|
||||
if (jroute != NULL) {
|
||||
const char* route = env->GetStringUTFChars(jroute, NULL);
|
||||
int err=linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,route);
|
||||
jint err=linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,route);
|
||||
env->ReleaseStringUTFChars(jroute, route);
|
||||
return err;
|
||||
} else {
|
||||
return linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,NULL);
|
||||
return (jint)linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,NULL);
|
||||
}
|
||||
}
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getRoute(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
|
|
@ -1055,10 +1066,10 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enableRegister(JN
|
|||
linphone_proxy_config_enable_register((LinphoneProxyConfig*)proxyCfg,enableRegister);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_isRegistered(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
return linphone_proxy_config_is_registered((LinphoneProxyConfig*)proxyCfg);
|
||||
return (jboolean)linphone_proxy_config_is_registered((LinphoneProxyConfig*)proxyCfg);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_isRegisterEnabled(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
return linphone_proxy_config_register_enabled((LinphoneProxyConfig*)proxyCfg);
|
||||
return (jboolean)linphone_proxy_config_register_enabled((LinphoneProxyConfig*)proxyCfg);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_edit(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
linphone_proxy_config_edit((LinphoneProxyConfig*)proxyCfg);
|
||||
|
|
@ -1117,7 +1128,7 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enablePublish(JNI
|
|||
linphone_proxy_config_enable_publish((LinphoneProxyConfig*)proxyCfg,val);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_publishEnabled(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
return linphone_proxy_config_publish_enabled((LinphoneProxyConfig*)proxyCfg);
|
||||
return (jboolean)linphone_proxy_config_publish_enabled((LinphoneProxyConfig*)proxyCfg);
|
||||
}
|
||||
|
||||
//Auth Info
|
||||
|
|
@ -1131,11 +1142,17 @@ extern "C" jlong Java_org_linphone_core_LinphoneAuthInfoImpl_newLinphoneAuthInfo
|
|||
, jstring jrealm) {
|
||||
|
||||
const char* username = env->GetStringUTFChars(jusername, NULL);
|
||||
const char* userid = env->GetStringUTFChars(juserid, NULL);
|
||||
const char* password = env->GetStringUTFChars(jpassword, NULL);
|
||||
jlong auth = (jlong)linphone_auth_info_new(username,NULL,password,NULL,NULL);
|
||||
const char* ha1 = env->GetStringUTFChars(jha1, NULL);
|
||||
const char* realm = env->GetStringUTFChars(jrealm, NULL);
|
||||
jlong auth = (jlong)linphone_auth_info_new(username,userid,password,ha1,realm);
|
||||
|
||||
env->ReleaseStringUTFChars(jusername, username);
|
||||
env->ReleaseStringUTFChars(juserid, userid);
|
||||
env->ReleaseStringUTFChars(jpassword, password);
|
||||
env->ReleaseStringUTFChars(jha1, ha1);
|
||||
env->ReleaseStringUTFChars(jrealm, realm);
|
||||
return auth;
|
||||
|
||||
}
|
||||
|
|
@ -1175,7 +1192,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_getDisplayName(JNI
|
|||
if (displayName) {
|
||||
return env->NewStringUTF(displayName);
|
||||
} else {
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_getUserName(JNIEnv* env
|
||||
|
|
@ -1185,7 +1202,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_getUserName(JNIEnv
|
|||
if (userName) {
|
||||
return env->NewStringUTF(userName);
|
||||
} else {
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_getDomain(JNIEnv* env
|
||||
|
|
@ -1195,7 +1212,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_getDomain(JNIEnv*
|
|||
if (domain) {
|
||||
return env->NewStringUTF(domain);
|
||||
} else {
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1231,10 +1248,10 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallLogImpl_getFrom(JNIEnv* env
|
|||
,jlong ptr) {
|
||||
return (jlong)((LinphoneCallLog*)ptr)->from;
|
||||
}
|
||||
extern "C" int Java_org_linphone_core_LinphoneCallLogImpl_getStatus(JNIEnv* env
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCallLogImpl_getStatus(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return (jlong)((LinphoneCallLog*)ptr)->status;
|
||||
return (jint)((LinphoneCallLog*)ptr)->status;
|
||||
}
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCallLogImpl_getTo(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -1255,15 +1272,15 @@ extern "C" jstring Java_org_linphone_core_LinphoneCallLogImpl_getStartDate(JNIEn
|
|||
extern "C" jint Java_org_linphone_core_LinphoneCallLogImpl_getCallDuration(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return ((LinphoneCallLog*)ptr)->duration;
|
||||
return (jint)((LinphoneCallLog*)ptr)->duration;
|
||||
}
|
||||
|
||||
/* CallStats */
|
||||
extern "C" int Java_org_linphone_core_LinphoneCallStatsImpl_getMediaType(JNIEnv *env, jobject thiz, jlong stats_ptr) {
|
||||
return (int)((LinphoneCallStats *)stats_ptr)->type;
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCallStatsImpl_getMediaType(JNIEnv *env, jobject thiz, jlong stats_ptr) {
|
||||
return (jint)((LinphoneCallStats *)stats_ptr)->type;
|
||||
}
|
||||
extern "C" int Java_org_linphone_core_LinphoneCallStatsImpl_getIceState(JNIEnv *env, jobject thiz, jlong stats_ptr) {
|
||||
return (int)((LinphoneCallStats *)stats_ptr)->ice_state;
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCallStatsImpl_getIceState(JNIEnv *env, jobject thiz, jlong stats_ptr) {
|
||||
return (jint)((LinphoneCallStats *)stats_ptr)->ice_state;
|
||||
}
|
||||
extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getDownloadBandwidth(JNIEnv *env, jobject thiz, jlong stats_ptr) {
|
||||
return (jfloat)((LinphoneCallStats *)stats_ptr)->download_bandwidth;
|
||||
|
|
@ -1275,7 +1292,7 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getSenderLossRate
|
|||
const LinphoneCallStats *stats = (LinphoneCallStats *)stats_ptr;
|
||||
const report_block_t *srb = NULL;
|
||||
|
||||
if (!stats->sent_rtcp)
|
||||
if (!stats || !stats->sent_rtcp)
|
||||
return (jfloat)0.0;
|
||||
/* Perform msgpullup() to prevent crashes in rtcp_is_SR() or rtcp_is_RR() if the RTCP packet is composed of several mblk_t structure */
|
||||
if (stats->sent_rtcp->b_cont != NULL)
|
||||
|
|
@ -1292,7 +1309,7 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getReceiverLossRa
|
|||
const LinphoneCallStats *stats = (LinphoneCallStats *)stats_ptr;
|
||||
const report_block_t *rrb = NULL;
|
||||
|
||||
if (!stats->received_rtcp)
|
||||
if (!stats || !stats->received_rtcp)
|
||||
return (jfloat)0.0;
|
||||
/* Perform msgpullup() to prevent crashes in rtcp_is_SR() or rtcp_is_RR() if the RTCP packet is composed of several mblk_t structure */
|
||||
if (stats->received_rtcp->b_cont != NULL)
|
||||
|
|
@ -1308,11 +1325,14 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getReceiverLossRa
|
|||
extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getSenderInterarrivalJitter(JNIEnv *env, jobject thiz, jlong stats_ptr, jlong call_ptr) {
|
||||
LinphoneCallStats *stats = (LinphoneCallStats *)stats_ptr;
|
||||
const LinphoneCall *call = (LinphoneCall *)call_ptr;
|
||||
const LinphoneCallParams *params = linphone_call_get_current_params(call);
|
||||
const LinphoneCallParams *params;
|
||||
const PayloadType *pt;
|
||||
const report_block_t *srb = NULL;
|
||||
|
||||
if (!stats->sent_rtcp)
|
||||
if (!stats || !call || !stats->sent_rtcp)
|
||||
return (jfloat)0.0;
|
||||
params = linphone_call_get_current_params(call);
|
||||
if (!params)
|
||||
return (jfloat)0.0;
|
||||
/* Perform msgpullup() to prevent crashes in rtcp_is_SR() or rtcp_is_RR() if the RTCP packet is composed of several mblk_t structure */
|
||||
if (stats->sent_rtcp->b_cont != NULL)
|
||||
|
|
@ -1332,11 +1352,14 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getSenderInterarr
|
|||
extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getReceiverInterarrivalJitter(JNIEnv *env, jobject thiz, jlong stats_ptr, jlong call_ptr) {
|
||||
LinphoneCallStats *stats = (LinphoneCallStats *)stats_ptr;
|
||||
const LinphoneCall *call = (LinphoneCall *)call_ptr;
|
||||
const LinphoneCallParams *params = linphone_call_get_current_params(call);
|
||||
const LinphoneCallParams *params;
|
||||
const PayloadType *pt;
|
||||
const report_block_t *rrb = NULL;
|
||||
|
||||
if (!stats->received_rtcp)
|
||||
if (!stats || !call || !stats->received_rtcp)
|
||||
return (jfloat)0.0;
|
||||
params = linphone_call_get_current_params(call);
|
||||
if (!params)
|
||||
return (jfloat)0.0;
|
||||
/* Perform msgpullup() to prevent crashes in rtcp_is_SR() or rtcp_is_RR() if the RTCP packet is composed of several mblk_t structure */
|
||||
if (stats->received_rtcp->b_cont != NULL)
|
||||
|
|
@ -1361,6 +1384,8 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallStatsImpl_getLatePacketsCumu
|
|||
LinphoneCall *call = (LinphoneCall *)call_ptr;
|
||||
rtp_stats_t rtp_stats;
|
||||
|
||||
if (!stats || !call)
|
||||
return (jlong)0;
|
||||
memset(&rtp_stats, 0, sizeof(rtp_stats));
|
||||
if (stats->type == LINPHONE_CALL_STATS_AUDIO)
|
||||
audio_stream_get_local_rtp_stats(call->audiostream, &rtp_stats);
|
||||
|
|
@ -1392,7 +1417,7 @@ extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_getMime(JNIEnv* env,j
|
|||
}
|
||||
extern "C" jint Java_org_linphone_core_PayloadTypeImpl_getRate(JNIEnv* env,jobject thiz, jlong ptr) {
|
||||
PayloadType* pt = (PayloadType*)ptr;
|
||||
return payload_type_get_rate(pt);
|
||||
return (jint)payload_type_get_rate(pt);
|
||||
}
|
||||
|
||||
//LinphoneCall
|
||||
|
|
@ -1448,7 +1473,7 @@ extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableEchoCancellation(
|
|||
extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isEchoCancellationEnabled( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return linphone_call_echo_cancellation_enabled((LinphoneCall*)ptr);
|
||||
return (jboolean)linphone_call_echo_cancellation_enabled((LinphoneCall*)ptr);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableEchoLimiter( JNIEnv* env
|
||||
|
|
@ -1460,7 +1485,7 @@ extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableEchoLimiter( JNIEn
|
|||
extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isEchoLimiterEnabled( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return linphone_call_echo_limiter_enabled((LinphoneCall*)ptr);
|
||||
return (jboolean)linphone_call_echo_limiter_enabled((LinphoneCall*)ptr);
|
||||
}
|
||||
|
||||
extern "C" jobject Java_org_linphone_core_LinphoneCallImpl_getReplacedCall( JNIEnv* env
|
||||
|
|
@ -1484,7 +1509,7 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallImpl_getAverageQuality( JNI
|
|||
|
||||
|
||||
//LinphoneFriend
|
||||
extern "C" long Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIEnv* env
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jstring jFriendUri) {
|
||||
LinphoneFriend* lResult;
|
||||
|
|
@ -1496,7 +1521,7 @@ extern "C" long Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIE
|
|||
} else {
|
||||
lResult = linphone_friend_new();
|
||||
}
|
||||
return (long)lResult;
|
||||
return (jlong)lResult;
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setAddress(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -1504,10 +1529,10 @@ extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setAddress(JNIEnv* en
|
|||
,jlong linphoneAddress) {
|
||||
linphone_friend_set_addr((LinphoneFriend*)ptr,(LinphoneAddress*)linphoneAddress);
|
||||
}
|
||||
extern "C" long Java_org_linphone_core_LinphoneFriendImpl_getAddress(JNIEnv* env
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneFriendImpl_getAddress(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return (long)linphone_friend_get_address((LinphoneFriend*)ptr);
|
||||
return (jlong)linphone_friend_get_address((LinphoneFriend*)ptr);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setIncSubscribePolicy(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -1518,7 +1543,7 @@ extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setIncSubscribePolicy(
|
|||
extern "C" jint Java_org_linphone_core_LinphoneFriendImpl_getIncSubscribePolicy(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return linphone_friend_get_inc_subscribe_policy((LinphoneFriend*)ptr);
|
||||
return (jint)linphone_friend_get_inc_subscribe_policy((LinphoneFriend*)ptr);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneFriendImpl_enableSubscribes(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -1529,12 +1554,12 @@ extern "C" void Java_org_linphone_core_LinphoneFriendImpl_enableSubscribes(JNIEn
|
|||
extern "C" jboolean Java_org_linphone_core_LinphoneFriendImpl_isSubscribesEnabled(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return linphone_friend_subscribes_enabled((LinphoneFriend*)ptr);
|
||||
return (jboolean)linphone_friend_subscribes_enabled((LinphoneFriend*)ptr);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneFriendImpl_getStatus(JNIEnv* env
|
||||
extern "C" jint Java_org_linphone_core_LinphoneFriendImpl_getStatus(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return linphone_friend_get_status((LinphoneFriend*)ptr);
|
||||
return (jint)linphone_friend_get_status((LinphoneFriend*)ptr);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneFriendImpl_edit(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -1546,11 +1571,26 @@ extern "C" void Java_org_linphone_core_LinphoneFriendImpl_done(JNIEnv* env
|
|||
,jlong ptr) {
|
||||
linphone_friend_done((LinphoneFriend*)ptr);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeFriend(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr
|
||||
,jlong lf) {
|
||||
linphone_core_remove_friend((LinphoneCore*)ptr, (LinphoneFriend*)lf);
|
||||
}
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getFriendByAddress(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr
|
||||
,jstring jaddress) {
|
||||
const char* address = env->GetStringUTFChars(jaddress, NULL);
|
||||
LinphoneFriend *lf = linphone_core_get_friend_by_address((LinphoneCore*)ptr, address);
|
||||
env->ReleaseStringUTFChars(jaddress, address);
|
||||
return (jlong) lf;
|
||||
}
|
||||
//LinphoneChatRoom
|
||||
extern "C" long Java_org_linphone_core_LinphoneChatRoomImpl_getPeerAddress(JNIEnv* env
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_getPeerAddress(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return (long) linphone_chat_room_get_peer_address((LinphoneChatRoom*)ptr);
|
||||
return (jlong) linphone_chat_room_get_peer_address((LinphoneChatRoom*)ptr);
|
||||
}
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatMessage(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -1675,12 +1715,12 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDeviceRotation(JNIEnv
|
|||
}
|
||||
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc, int enum_value){
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc, jint enum_value){
|
||||
linphone_core_set_firewall_policy((LinphoneCore*)lc,(LinphoneFirewallPolicy)enum_value);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc){
|
||||
return linphone_core_get_firewall_policy((LinphoneCore*)lc);
|
||||
return (jint)linphone_core_get_firewall_policy((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setStunServer(JNIEnv *env, jobject thiz, jlong lc, jstring jserver){
|
||||
|
|
@ -1697,6 +1737,30 @@ extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getStunServer(JNIEnv
|
|||
return jvalue;
|
||||
}
|
||||
|
||||
//CallParams
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCallParamsImpl_getUsedAudioCodec(JNIEnv *env, jobject thiz, jlong cp) {
|
||||
return (jlong)linphone_call_params_get_used_audio_codec((LinphoneCallParams *)cp);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCallParamsImpl_getUsedVideoCodec(JNIEnv *env, jobject thiz, jlong cp) {
|
||||
return (jlong)linphone_call_params_get_used_video_codec((LinphoneCallParams *)cp);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCallParamsImpl_getMediaEncryption(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong cp
|
||||
) {
|
||||
return (jint)linphone_call_params_get_media_encryption((LinphoneCallParams*)cp);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_setMediaEncryption(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong cp
|
||||
,jint jmenc) {
|
||||
linphone_call_params_set_media_encryption((LinphoneCallParams*)cp,(LinphoneMediaEncryption)jmenc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_audioBandwidth(JNIEnv *env, jobject thiz, jlong lcp, jint bw){
|
||||
linphone_call_params_set_audio_bandwidth_limit((LinphoneCallParams*)lcp, bw);
|
||||
}
|
||||
|
|
@ -1706,11 +1770,11 @@ extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_enableVideo(JNIEnv
|
|||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_getVideoEnabled(JNIEnv *env, jobject thiz, jlong lcp){
|
||||
return linphone_call_params_video_enabled((LinphoneCallParams*)lcp);
|
||||
return (jboolean)linphone_call_params_video_enabled((LinphoneCallParams*)lcp);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_localConferenceMode(JNIEnv *env, jobject thiz, jlong lcp){
|
||||
return linphone_call_params_local_conference_mode((LinphoneCallParams*)lcp);
|
||||
return (jboolean)linphone_call_params_local_conference_mode((LinphoneCallParams*)lcp);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_destroy(JNIEnv *env, jobject thiz, jlong lc){
|
||||
|
|
@ -1731,12 +1795,12 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCurrentParamsCopy(JN
|
|||
return (jlong) linphone_call_params_copy(linphone_call_get_current_params((LinphoneCall*)lc));
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_enableCamera(JNIEnv *env, jobject thiz, jlong lc, jboolean b){
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableCamera(JNIEnv *env, jobject thiz, jlong lc, jboolean b){
|
||||
linphone_call_enable_camera((LinphoneCall *)lc, (bool_t) b);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_cameraEnabled(JNIEnv *env, jobject thiz, jlong lc){
|
||||
linphone_call_camera_enabled((LinphoneCall *)lc);
|
||||
return (jboolean)linphone_call_camera_enabled((LinphoneCall *)lc);
|
||||
}
|
||||
|
||||
extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_inviteAddressWithParams(JNIEnv *env, jobject thiz, jlong lc, jlong addr, jlong params){
|
||||
|
|
@ -1784,15 +1848,15 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setUploadPtime(JNIEnv *e
|
|||
linphone_core_set_upload_ptime((LinphoneCore *)lc, (int) ptime);
|
||||
}
|
||||
|
||||
extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_getState(JNIEnv* env,jobject thiz,jlong ptr) {
|
||||
return (int) linphone_proxy_config_get_state((const LinphoneProxyConfig *) ptr);
|
||||
extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_getState(JNIEnv* env,jobject thiz,jlong ptr) {
|
||||
return (jint) linphone_proxy_config_get_state((const LinphoneProxyConfig *) ptr);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setExpires(JNIEnv* env,jobject thiz,jlong ptr,jint delay) {
|
||||
linphone_proxy_config_expires((LinphoneProxyConfig *) ptr, (int) delay);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getDuration(JNIEnv* env,jobject thiz,jlong ptr) {
|
||||
linphone_call_get_duration((LinphoneCall *) ptr);
|
||||
return (jint)linphone_call_get_duration((LinphoneCall *) ptr);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSignalingTransportPort(JNIEnv* env,jobject thiz,jlong ptr, jint code) {
|
||||
|
|
@ -1831,19 +1895,19 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_adjustSoftwareVolume(JNI
|
|||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_pauseCall(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) {
|
||||
return linphone_core_pause_call((LinphoneCore *) pCore, (LinphoneCall *) pCall);
|
||||
return (jint)linphone_core_pause_call((LinphoneCore *) pCore, (LinphoneCall *) pCall);
|
||||
}
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_pauseAllCalls(JNIEnv *env,jobject thiz,jlong pCore) {
|
||||
return linphone_core_pause_all_calls((LinphoneCore *) pCore);
|
||||
return (jint)linphone_core_pause_all_calls((LinphoneCore *) pCore);
|
||||
}
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_resumeCall(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) {
|
||||
return linphone_core_resume_call((LinphoneCore *) pCore, (LinphoneCall *) pCall);
|
||||
return (jint)linphone_core_resume_call((LinphoneCore *) pCore, (LinphoneCall *) pCall);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInConference(JNIEnv *env,jobject thiz,jlong pCore) {
|
||||
return linphone_core_is_in_conference((LinphoneCore *) pCore);
|
||||
return (jboolean)linphone_core_is_in_conference((LinphoneCore *) pCore);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_enterConference(JNIEnv *env,jobject thiz,jlong pCore) {
|
||||
return 0 == linphone_core_enter_conference((LinphoneCore *) pCore);
|
||||
return (jboolean)(0 == linphone_core_enter_conference((LinphoneCore *) pCore));
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_leaveConference(JNIEnv *env,jobject thiz,jlong pCore) {
|
||||
linphone_core_leave_conference((LinphoneCore *) pCore);
|
||||
|
|
@ -1862,7 +1926,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateConference(JNIE
|
|||
linphone_core_terminate_conference((LinphoneCore *) pCore);
|
||||
}
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv *env,jobject thiz,jlong pCore) {
|
||||
return linphone_core_get_conference_size((LinphoneCore *) pCore);
|
||||
return (jint)linphone_core_get_conference_size((LinphoneCore *) pCore);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateAllCalls(JNIEnv *env,jobject thiz,jlong pCore) {
|
||||
linphone_core_terminate_all_calls((LinphoneCore *) pCore);
|
||||
|
|
@ -1873,16 +1937,17 @@ extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getCall(JNIEnv *env,j
|
|||
return lcd->getCall(env,lCall);
|
||||
}
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getCallsNb(JNIEnv *env,jobject thiz,jlong pCore) {
|
||||
return ms_list_size(linphone_core_get_calls((LinphoneCore *) pCore));
|
||||
return (jint)ms_list_size(linphone_core_get_calls((LinphoneCore *) pCore));
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_transferCall(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall, jstring jReferTo) {
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_transferCall(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall, jstring jReferTo) {
|
||||
const char* cReferTo=env->GetStringUTFChars(jReferTo, NULL);
|
||||
linphone_core_transfer_call((LinphoneCore *) pCore, (LinphoneCall *) pCall, cReferTo);
|
||||
jint err = linphone_core_transfer_call((LinphoneCore *) pCore, (LinphoneCall *) pCall, cReferTo);
|
||||
env->ReleaseStringUTFChars(jReferTo, cReferTo);
|
||||
return err;
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_transferCallToAnother(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall, jlong pDestCall) {
|
||||
linphone_core_transfer_call_to_another((LinphoneCore *) pCore, (LinphoneCall *) pCall, (LinphoneCall *) pDestCall);
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_transferCallToAnother(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall, jlong pDestCall) {
|
||||
return (jint)linphone_core_transfer_call_to_another((LinphoneCore *) pCore, (LinphoneCall *) pCall, (LinphoneCall *) pDestCall);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setZrtpSecretsCache(JNIEnv *env,jobject thiz,jlong pCore, jstring jFile) {
|
||||
|
|
@ -1917,7 +1982,7 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_setVideoDevice(JNIEnv *e
|
|||
break;
|
||||
ms_message("Existing device %d : %s\n", i, devices[i]);
|
||||
if (i==id) {
|
||||
return linphone_core_set_video_device(lc, devices[i]);
|
||||
return (jint)linphone_core_set_video_device(lc, devices[i]);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
|
@ -1953,7 +2018,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneCallImpl_getAuthenticationToke
|
|||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isAuthenticationTokenVerified(JNIEnv* env,jobject thiz,jlong ptr) {
|
||||
LinphoneCall *call = (LinphoneCall *) ptr;
|
||||
return linphone_call_get_authentication_token_verified(call);
|
||||
return (jboolean)linphone_call_get_authentication_token_verified(call);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_setAuthenticationTokenVerified(JNIEnv* env,jobject thiz,jlong ptr,jboolean verified) {
|
||||
LinphoneCall *call = (LinphoneCall *) ptr;
|
||||
|
|
@ -1962,11 +2027,11 @@ extern "C" void Java_org_linphone_core_LinphoneCallImpl_setAuthenticationTokenVe
|
|||
|
||||
extern "C" jfloat Java_org_linphone_core_LinphoneCallImpl_getPlayVolume(JNIEnv* env, jobject thiz, jlong ptr) {
|
||||
LinphoneCall *call = (LinphoneCall *) ptr;
|
||||
return linphone_call_get_play_volume(call);
|
||||
return (jfloat)linphone_call_get_play_volume(call);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_soundResourcesLocked(JNIEnv* env,jobject thiz,jlong ptr){
|
||||
return linphone_core_sound_resources_locked((LinphoneCore *) ptr);
|
||||
return (jboolean)linphone_core_sound_resources_locked((LinphoneCore *) ptr);
|
||||
}
|
||||
|
||||
// Needed by Galaxy S (can't switch to/from speaker while playing and still keep mic working)
|
||||
|
|
@ -2036,7 +2101,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setUserAgent(JNIEnv *env
|
|||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isTunnelAvailable(JNIEnv *env,jobject thiz){
|
||||
return linphone_core_tunnel_available();
|
||||
return (jboolean)linphone_core_tunnel_available();
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPolicy(JNIEnv *env, jobject thiz, jlong lc, jboolean autoInitiate, jboolean autoAccept){
|
||||
|
|
@ -2050,6 +2115,26 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setCpuCountNative(JNIEnv
|
|||
ms_set_cpu_count(count);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioPort(JNIEnv *env, jobject thiz, jlong lc, jint port) {
|
||||
linphone_core_set_audio_port((LinphoneCore *)lc, port);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPort(JNIEnv *env, jobject thiz, jlong lc, jint port) {
|
||||
linphone_core_set_video_port((LinphoneCore *)lc, port);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioPortRange(JNIEnv *env, jobject thiz, jlong lc, jint min_port, jint max_port) {
|
||||
linphone_core_set_audio_port_range((LinphoneCore *)lc, min_port, max_port);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPortRange(JNIEnv *env, jobject thiz, jlong lc, jint min_port, jint max_port) {
|
||||
linphone_core_set_video_port_range((LinphoneCore *)lc, min_port, max_port);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setIncomingTimeout(JNIEnv *env, jobject thiz, jlong lc, jint timeout) {
|
||||
linphone_core_set_inc_timeout((LinphoneCore *)lc, timeout);
|
||||
}
|
||||
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getVersion(JNIEnv* env,jobject thiz,jlong ptr) {
|
||||
jstring jvalue =env->NewStringUTF(linphone_core_get_version());
|
||||
return jvalue;
|
||||
|
|
|
|||
|
|
@ -56,9 +56,10 @@ void linphone_sound_daemon_destroy(LinphoneSoundDaemon *obj);
|
|||
* Enum describing the result of the echo canceller calibration process.
|
||||
**/
|
||||
typedef enum {
|
||||
LinphoneEcCalibratorInProgress,
|
||||
LinphoneEcCalibratorDone,
|
||||
LinphoneEcCalibratorFailed
|
||||
LinphoneEcCalibratorInProgress, /**< The echo canceller calibration process is on going. */
|
||||
LinphoneEcCalibratorDone, /**< The echo canceller calibration has been performed and produced an echo delay measure. */
|
||||
LinphoneEcCalibratorFailed, /**< The echo canceller calibration process has failed. */
|
||||
LinphoneEcCalibratorDoneNoEcho /**< The echo canceller calibration has been performed and no echo has been detected. */
|
||||
}LinphoneEcCalibratorStatus;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -184,10 +184,10 @@ void lp_config_parse(LpConfig *lpconfig, FILE *file){
|
|||
if (pos2==NULL) pos2=pos1+strlen(pos1);
|
||||
else {
|
||||
*pos2='\0'; /*replace the '\n' */
|
||||
pos2--;
|
||||
}
|
||||
/* remove ending white spaces */
|
||||
for (; pos2>pos1 && *pos2==' ';pos2--) *pos2='\0';
|
||||
for (; pos2>pos1 && pos2[-1]==' ';pos2--) pos2[-1]='\0';
|
||||
|
||||
if (pos2-pos1>=0){
|
||||
/* found a pair key,value */
|
||||
if (cur!=NULL){
|
||||
|
|
@ -198,7 +198,7 @@ void lp_config_parse(LpConfig *lpconfig, FILE *file){
|
|||
ms_free(item->value);
|
||||
item->value=strdup(pos1);
|
||||
}
|
||||
/*printf("Found %s %s=%s\n",cur->name,key,pos1);*/
|
||||
/*printf("Found %s %s={%s}\n",cur->name,key,pos1);*/
|
||||
}else{
|
||||
ms_warning("found key,item but no sections");
|
||||
}
|
||||
|
|
@ -271,6 +271,25 @@ const char *lp_config_get_string(LpConfig *lpconfig, const char *section, const
|
|||
return default_string;
|
||||
}
|
||||
|
||||
bool_t lp_config_get_range(LpConfig *lpconfig, const char *section, const char *key, int *min, int *max, int default_min, int default_max) {
|
||||
const char *str = lp_config_get_string(lpconfig, section, key, NULL);
|
||||
if (str != NULL) {
|
||||
char *minusptr = strchr(str, '-');
|
||||
if ((minusptr == NULL) || (minusptr == str)) {
|
||||
*min = default_min;
|
||||
*max = default_max;
|
||||
return FALSE;
|
||||
}
|
||||
*min = atoi(str);
|
||||
*max = atoi(minusptr + 1);
|
||||
return TRUE;
|
||||
} else {
|
||||
*min = default_min;
|
||||
*max = default_max;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
int lp_config_get_int(LpConfig *lpconfig,const char *section, const char *key, int default_value){
|
||||
const char *str=lp_config_get_string(lpconfig,section,key,NULL);
|
||||
if (str!=NULL) {
|
||||
|
|
@ -324,6 +343,12 @@ void lp_config_set_string(LpConfig *lpconfig,const char *section, const char *ke
|
|||
lpconfig->modified++;
|
||||
}
|
||||
|
||||
void lp_config_set_range(LpConfig *lpconfig, const char *section, const char *key, int min_value, int max_value) {
|
||||
char tmp[30];
|
||||
snprintf(tmp, sizeof(tmp), "%i-%i", min_value, max_value);
|
||||
lp_config_set_string(lpconfig, section, key, tmp);
|
||||
}
|
||||
|
||||
void lp_config_set_int(LpConfig *lpconfig,const char *section, const char *key, int value){
|
||||
char tmp[30];
|
||||
snprintf(tmp,sizeof(tmp),"%i",value);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,20 @@ typedef struct _LpConfig LpConfig;
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define LP_CONFIG_DEFAULT_STRING(config, name, default) \
|
||||
(config) ? (lp_config_get_string(config, "default_values", name, default)) : (default)
|
||||
|
||||
#define LP_CONFIG_DEFAULT_INT(config, name, default) \
|
||||
(config) ? (lp_config_get_int(config, "default_values", name, default)) : (default)
|
||||
|
||||
#define LP_CONFIG_DEFAULT_INT64(config, name, default) \
|
||||
(config) ? (lp_config_get_int64(config, "default_values", name, default)) : (default)
|
||||
|
||||
#define LP_CONFIG_DEFAULT_FLOAT(config, name, default) \
|
||||
(config) ? (lp_config_get_float(config, "default_values", name, default)) : (default)
|
||||
|
||||
|
||||
LpConfig * lp_config_new(const char *filename);
|
||||
int lp_config_read_file(LpConfig *lpconfig, const char *filename);
|
||||
/**
|
||||
|
|
@ -59,6 +73,14 @@ int lp_config_read_file(LpConfig *lpconfig, const char *filename);
|
|||
**/
|
||||
const char *lp_config_get_string(LpConfig *lpconfig, const char *section, const char *key, const char *default_string);
|
||||
int lp_config_read_file(LpConfig *lpconfig, const char *filename);
|
||||
/**
|
||||
* Retrieves a configuration item as a range, given its section, key, and default min and max values.
|
||||
*
|
||||
* @ingroup misc
|
||||
* @return TRUE if the value is successfully parsed as a range, FALSE otherwise.
|
||||
* If FALSE is returned, min and max are filled respectively with default_min and default_max values.
|
||||
*/
|
||||
bool_t lp_config_get_range(LpConfig *lpconfig, const char *section, const char *key, int *min, int *max, int default_min, int default_max);
|
||||
/**
|
||||
* Retrieves a configuration item as an integer, given its section, key, and default value.
|
||||
*
|
||||
|
|
@ -90,6 +112,12 @@ float lp_config_get_float(LpConfig *lpconfig,const char *section, const char *ke
|
|||
* @ingroup misc
|
||||
**/
|
||||
void lp_config_set_string(LpConfig *lpconfig,const char *section, const char *key, const char *value);
|
||||
/**
|
||||
* Sets a range config item
|
||||
*
|
||||
* @ingroup misc
|
||||
*/
|
||||
void lp_config_set_range(LpConfig *lpconfig, const char *section, const char *key, int min_value, int max_value);
|
||||
/**
|
||||
* Sets an integer config item
|
||||
*
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ void linphone_core_adapt_to_network(LinphoneCore *lc, int ping_time_ms, Linphone
|
|||
params->up_bw=params->down_bw=edge_bw;
|
||||
params->up_ptime=params->down_ptime=edge_ptime;
|
||||
params->has_video=FALSE;
|
||||
|
||||
params->low_bandwidth=TRUE;
|
||||
}/*else use default settings */
|
||||
}
|
||||
}
|
||||
|
|
@ -689,6 +689,11 @@ void linphone_core_update_ice_state_in_call_stats(LinphoneCall *call)
|
|||
call->stats[LINPHONE_CALL_STATS_VIDEO].ice_state = LinphoneIceStateFailed;
|
||||
}
|
||||
}
|
||||
} else if (session_state == IS_Running) {
|
||||
call->stats[LINPHONE_CALL_STATS_AUDIO].ice_state = LinphoneIceStateInProgress;
|
||||
if (call->params.has_video && (video_check_list != NULL)) {
|
||||
call->stats[LINPHONE_CALL_STATS_VIDEO].ice_state = LinphoneIceStateInProgress;
|
||||
}
|
||||
} else {
|
||||
call->stats[LINPHONE_CALL_STATS_AUDIO].ice_state = LinphoneIceStateFailed;
|
||||
if (call->params.has_video && (video_check_list != NULL)) {
|
||||
|
|
@ -782,8 +787,7 @@ void linphone_core_update_local_media_description_from_ice(SalMediaDescription *
|
|||
if ((ice_check_list_state(cl) == ICL_Completed) && (ice_session_role(session) == IR_Controlling)) {
|
||||
int rtp_port, rtcp_port;
|
||||
memset(stream->ice_remote_candidates, 0, sizeof(stream->ice_remote_candidates));
|
||||
ice_check_list_selected_valid_remote_candidate(cl, &rtp_addr, &rtp_port, &rtcp_addr, &rtcp_port);
|
||||
if ((rtp_addr != NULL) && (rtcp_addr != NULL)) {
|
||||
if (ice_check_list_selected_valid_remote_candidate(cl, &rtp_addr, &rtp_port, &rtcp_addr, &rtcp_port) == TRUE) {
|
||||
strncpy(stream->ice_remote_candidates[0].addr, rtp_addr, sizeof(stream->ice_remote_candidates[0].addr));
|
||||
stream->ice_remote_candidates[0].port = rtp_port;
|
||||
strncpy(stream->ice_remote_candidates[1].addr, rtcp_addr, sizeof(stream->ice_remote_candidates[1].addr));
|
||||
|
|
@ -791,6 +795,11 @@ void linphone_core_update_local_media_description_from_ice(SalMediaDescription *
|
|||
} else {
|
||||
ms_error("ice: Selected valid remote candidates should be present if the check list is in the Completed state");
|
||||
}
|
||||
} else {
|
||||
for (j = 0; j < SAL_MEDIA_DESCRIPTION_MAX_ICE_REMOTE_CANDIDATES; j++) {
|
||||
stream->ice_remote_candidates[j].addr[0] = '\0';
|
||||
stream->ice_remote_candidates[j].port = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -871,8 +880,10 @@ void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call,
|
|||
break;
|
||||
}
|
||||
}
|
||||
if ((stream->ice_mismatch == TRUE) || (stream->rtp_port == 0)) {
|
||||
if (stream->ice_mismatch == TRUE) {
|
||||
ice_check_list_set_state(cl, ICL_Failed);
|
||||
} else if (stream->rtp_port == 0) {
|
||||
ice_session_remove_check_list(call->ice_session, cl);
|
||||
} else {
|
||||
if ((stream->ice_pwd[0] != '\0') && (stream->ice_ufrag[0] != '\0'))
|
||||
ice_check_list_set_remote_credentials(cl, stream->ice_ufrag, stream->ice_pwd);
|
||||
|
|
@ -898,6 +909,10 @@ void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call,
|
|||
int componentID = j + 1;
|
||||
if (candidate->addr[0] == '\0') break;
|
||||
get_default_addr_and_port(componentID, md, stream, &addr, &port);
|
||||
if (j == 0) {
|
||||
/* If we receive a re-invite and we finished ICE processing on our side, use the candidates given by the remote. */
|
||||
ice_check_list_unselect_valid_pairs(cl);
|
||||
}
|
||||
ice_add_losing_pair(cl, j + 1, candidate->addr, candidate->port, addr, port);
|
||||
losing_pairs_added = TRUE;
|
||||
}
|
||||
|
|
@ -930,17 +945,6 @@ bool_t linphone_core_media_description_contains_video_stream(const SalMediaDescr
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void linphone_core_deactivate_ice_for_deactivated_media_streams(LinphoneCall *call, const SalMediaDescription *md)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < md->nstreams; i++) {
|
||||
IceCheckList *cl = ice_session_check_list(call->ice_session, i);
|
||||
if (cl && (md->streams[i].rtp_port == 0)) {
|
||||
if (ice_check_list_state(cl) != ICL_Completed) ice_check_list_set_state(cl, ICL_Failed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LinphoneCall * is_a_linphone_call(void *user_pointer){
|
||||
LinphoneCall *call=(LinphoneCall*)user_pointer;
|
||||
if (call==NULL) return NULL;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ struct _LinphoneCallParams{
|
|||
bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/
|
||||
bool_t in_conference; /*in conference mode */
|
||||
bool_t pad;
|
||||
|
||||
bool_t low_bandwidth;
|
||||
};
|
||||
|
||||
typedef struct _CallCallbackObj
|
||||
|
|
@ -252,7 +252,6 @@ void linphone_core_update_ice_state_in_call_stats(LinphoneCall *call);
|
|||
void linphone_core_update_local_media_description_from_ice(SalMediaDescription *desc, IceSession *session);
|
||||
void linphone_core_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md);
|
||||
bool_t linphone_core_media_description_contains_video_stream(const SalMediaDescription *md);
|
||||
void linphone_core_deactivate_ice_for_deactivated_media_streams(LinphoneCall *call, const SalMediaDescription *md);
|
||||
|
||||
void linphone_core_send_initial_subscribes(LinphoneCore *lc);
|
||||
void linphone_core_write_friends_config(LinphoneCore* lc);
|
||||
|
|
@ -355,7 +354,6 @@ struct _LinphoneChatRoom{
|
|||
struct _LinphoneCore *lc;
|
||||
char *peer;
|
||||
LinphoneAddress *peer_url;
|
||||
SalOp *op;
|
||||
void * user_data;
|
||||
};
|
||||
|
||||
|
|
@ -399,8 +397,10 @@ typedef struct sip_config
|
|||
|
||||
typedef struct rtp_config
|
||||
{
|
||||
int audio_rtp_port;
|
||||
int video_rtp_port;
|
||||
int audio_rtp_min_port;
|
||||
int audio_rtp_max_port;
|
||||
int video_rtp_min_port;
|
||||
int video_rtp_max_port;
|
||||
int audio_jitt_comp; /*jitter compensation*/
|
||||
int video_jitt_comp; /*jitter compensation*/
|
||||
int nortp_timeout;
|
||||
|
|
@ -591,7 +591,8 @@ struct _EcCalibrator{
|
|||
ms_thread_t thread;
|
||||
MSSndCard *play_card,*capt_card;
|
||||
MSFilter *sndread,*det,*rec;
|
||||
MSFilter *play, *gen, *sndwrite,*resampler;
|
||||
MSFilter *play, *gen, *sndwrite;
|
||||
MSFilter *read_resampler,*write_resampler;
|
||||
MSTicker *ticker;
|
||||
LinphoneEcCalibrationCallback cb;
|
||||
void *cb_data;
|
||||
|
|
|
|||
|
|
@ -41,17 +41,12 @@ void linphone_proxy_config_write_all_to_config_file(LinphoneCore *lc){
|
|||
lp_config_set_int(lc->config,"sip","default_proxy",linphone_core_get_default_proxy(lc,NULL));
|
||||
}
|
||||
|
||||
#define DEFAULT_INT(config,name,default) \
|
||||
config?lp_config_get_int(config,"default_values",#name,default):default
|
||||
#define DEFAULT_STRING(config,name,default) \
|
||||
config?lp_config_get_string(config,"default_values",#name,default):default
|
||||
|
||||
static void linphone_proxy_config_init(LinphoneCore* lc,LinphoneProxyConfig *obj){
|
||||
memset(obj,0,sizeof(LinphoneProxyConfig));
|
||||
obj->magic=linphone_proxy_config_magic;
|
||||
obj->expires=DEFAULT_INT((lc?lc->config:NULL),reg_expires,3600);
|
||||
obj->dial_prefix=ms_strdup(DEFAULT_STRING((lc?lc->config:NULL),dial_prefix,'\0'));
|
||||
obj->dial_escape_plus=DEFAULT_INT((lc?lc->config:NULL),dial_escape_plus,0);
|
||||
obj->expires=LP_CONFIG_DEFAULT_INT((lc?lc->config:NULL),"reg_expires",3600);
|
||||
obj->dial_prefix=ms_strdup(LP_CONFIG_DEFAULT_STRING((lc?lc->config:NULL),"dial_prefix",'\0'));
|
||||
obj->dial_escape_plus=LP_CONFIG_DEFAULT_INT((lc?lc->config:NULL),"dial_escape_plus",0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -779,13 +774,13 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LpConfig *config
|
|||
|
||||
linphone_proxy_config_set_contact_parameters(cfg,lp_config_get_string(config,key,"contact_parameters",NULL));
|
||||
|
||||
linphone_proxy_config_expires(cfg,lp_config_get_int(config,key,"reg_expires",DEFAULT_INT(config,reg_expires,600)));
|
||||
linphone_proxy_config_expires(cfg,lp_config_get_int(config,key,"reg_expires",LP_CONFIG_DEFAULT_INT(config,"reg_expires",600)));
|
||||
linphone_proxy_config_enableregister(cfg,lp_config_get_int(config,key,"reg_sendregister",0));
|
||||
|
||||
linphone_proxy_config_enable_publish(cfg,lp_config_get_int(config,key,"publish",0));
|
||||
|
||||
linphone_proxy_config_set_dial_escape_plus(cfg,lp_config_get_int(config,key,"dial_escape_plus",DEFAULT_INT(config,dial_escape_plus,0)));
|
||||
linphone_proxy_config_set_dial_prefix(cfg,lp_config_get_string(config,key,"dial_prefix",DEFAULT_STRING(config,dial_prefix,NULL)));
|
||||
linphone_proxy_config_set_dial_escape_plus(cfg,lp_config_get_int(config,key,"dial_escape_plus",LP_CONFIG_DEFAULT_INT(config,"dial_escape_plus",0)));
|
||||
linphone_proxy_config_set_dial_prefix(cfg,lp_config_get_string(config,key,"dial_prefix",LP_CONFIG_DEFAULT_STRING(config,"dial_prefix",NULL)));
|
||||
|
||||
tmp=lp_config_get_string(config,key,"type",NULL);
|
||||
if (tmp!=NULL && strlen(tmp)>0)
|
||||
|
|
|
|||
|
|
@ -177,32 +177,40 @@ static bool_t payload_list_equals(const MSList *l1, const MSList *l2){
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t sal_stream_description_equals(const SalStreamDescription *sd1, const SalStreamDescription *sd2){
|
||||
if (sd1->proto!=sd2->proto) return FALSE;
|
||||
if (sd1->type!=sd2->type) return FALSE;
|
||||
if (strcmp(sd1->rtp_addr,sd2->rtp_addr)!=0) return FALSE;
|
||||
if (sd1->rtp_port!=sd2->rtp_port) return FALSE;
|
||||
if (strcmp(sd1->rtcp_addr,sd2->rtcp_addr)!=0) return FALSE;
|
||||
if (sd1->rtcp_port!=sd2->rtcp_port) return FALSE;
|
||||
if (!payload_list_equals(sd1->payloads,sd2->payloads)) return FALSE;
|
||||
if (sd1->bandwidth!=sd2->bandwidth) return FALSE;
|
||||
if (sd1->ptime!=sd2->ptime) return FALSE;
|
||||
/* compare candidates: TODO */
|
||||
if (sd1->dir!=sd2->dir) return FALSE;
|
||||
return TRUE;
|
||||
int sal_stream_description_equals(const SalStreamDescription *sd1, const SalStreamDescription *sd2) {
|
||||
int result = SAL_MEDIA_DESCRIPTION_UNCHANGED;
|
||||
|
||||
/* A different proto should result in SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED but the encryption change
|
||||
needs a stream restart for now, so use SAL_MEDIA_DESCRIPTION_CODEC_CHANGED */
|
||||
if (sd1->proto != sd2->proto) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
|
||||
if (sd1->type != sd2->type) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
if (strcmp(sd1->rtp_addr, sd2->rtp_addr) != 0) result |= SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED;
|
||||
if (sd1->rtp_port != sd2->rtp_port) {
|
||||
if ((sd1->rtp_port == 0) || (sd2->rtp_port == 0)) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
else result |= SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED;
|
||||
}
|
||||
if (strcmp(sd1->rtcp_addr, sd2->rtcp_addr) != 0) result |= SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED;
|
||||
if (sd1->rtcp_port != sd2->rtcp_port) result |= SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED;
|
||||
if (!payload_list_equals(sd1->payloads, sd2->payloads)) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
if (sd1->bandwidth != sd2->bandwidth) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
if (sd1->ptime != sd2->ptime) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
if (sd1->dir != sd2->dir) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool_t sal_media_description_equals(const SalMediaDescription *md1, const SalMediaDescription *md2){
|
||||
int sal_media_description_equals(const SalMediaDescription *md1, const SalMediaDescription *md2) {
|
||||
int result = SAL_MEDIA_DESCRIPTION_UNCHANGED;
|
||||
int i;
|
||||
|
||||
if (strcmp(md1->addr,md2->addr)!=0) return FALSE;
|
||||
if (md1->nstreams!=md2->nstreams) return FALSE;
|
||||
if (md1->bandwidth!=md2->bandwidth) return FALSE;
|
||||
for(i=0;i<md1->nstreams;++i){
|
||||
if (!sal_stream_description_equals(&md1->streams[i],&md2->streams[i]))
|
||||
return FALSE;
|
||||
|
||||
if (strcmp(md1->addr, md2->addr) != 0) result |= SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED;
|
||||
if (md1->nstreams != md2->nstreams) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
if (md1->bandwidth != md2->bandwidth) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED;
|
||||
for(i = 0; i < md1->nstreams; ++i){
|
||||
result |= sal_stream_description_equals(&md1->streams[i], &md2->streams[i]);
|
||||
}
|
||||
return TRUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void assign_string(char **str, const char *arg){
|
||||
|
|
@ -269,7 +277,9 @@ const char *sal_op_get_proxy(const SalOp *op){
|
|||
const char *sal_op_get_network_origin(const SalOp *op){
|
||||
return ((SalOpBase*)op)->origin;
|
||||
}
|
||||
|
||||
const char* sal_op_get_call_id(const SalOp *op) {
|
||||
return ((SalOpBase*)op)->call_id;
|
||||
}
|
||||
void __sal_op_init(SalOp *b, Sal *sal){
|
||||
memset(b,0,sizeof(SalOpBase));
|
||||
((SalOpBase*)b)->root=sal;
|
||||
|
|
@ -310,6 +320,8 @@ void __sal_op_free(SalOp *op){
|
|||
sal_media_description_unref(b->local_media);
|
||||
if (b->remote_media)
|
||||
sal_media_description_unref(b->remote_media);
|
||||
if (b->call_id)
|
||||
ms_free((void*)b->call_id);
|
||||
ms_free(op);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@ typedef enum {
|
|||
SalTransportDTLS /*DTLS*/
|
||||
}SalTransport;
|
||||
|
||||
#define SAL_MEDIA_DESCRIPTION_UNCHANGED 0x00
|
||||
#define SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED 0x01
|
||||
#define SAL_MEDIA_DESCRIPTION_CODEC_CHANGED 0x02
|
||||
#define SAL_MEDIA_DESCRIPTION_CHANGED (SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED | SAL_MEDIA_DESCRIPTION_CODEC_CHANGED)
|
||||
|
||||
const char* sal_transport_to_string(SalTransport transport);
|
||||
SalTransport sal_transport_parse(const char*);
|
||||
/* Address manipulation API*/
|
||||
|
|
@ -189,7 +194,7 @@ SalMediaDescription *sal_media_description_new();
|
|||
void sal_media_description_ref(SalMediaDescription *md);
|
||||
void sal_media_description_unref(SalMediaDescription *md);
|
||||
bool_t sal_media_description_empty(const SalMediaDescription *md);
|
||||
bool_t sal_media_description_equals(const SalMediaDescription *md1, const SalMediaDescription *md2);
|
||||
int sal_media_description_equals(const SalMediaDescription *md1, const SalMediaDescription *md2);
|
||||
bool_t sal_media_description_has_dir(const SalMediaDescription *md, SalStreamDir dir);
|
||||
SalStreamDescription *sal_media_description_find_stream(SalMediaDescription *md,
|
||||
SalMediaProto proto, SalStreamType type);
|
||||
|
|
@ -207,6 +212,7 @@ typedef struct SalOpBase{
|
|||
SalMediaDescription *local_media;
|
||||
SalMediaDescription *remote_media;
|
||||
void *user_pointer;
|
||||
const char* call_id;
|
||||
} SalOpBase;
|
||||
|
||||
|
||||
|
|
@ -339,6 +345,7 @@ unsigned int sal_get_keepalive_period(Sal *ctx);
|
|||
void sal_use_session_timers(Sal *ctx, int expires);
|
||||
void sal_use_double_registrations(Sal *ctx, bool_t enabled);
|
||||
void sal_expire_old_registration_contacts(Sal *ctx, bool_t enabled);
|
||||
void sal_use_dates(Sal *ctx, bool_t enabled);
|
||||
void sal_reuse_authorization(Sal *ctx, bool_t enabled);
|
||||
void sal_use_one_matching_codec_policy(Sal *ctx, bool_t one_matching_codec);
|
||||
void sal_use_rport(Sal *ctx, bool_t use_rports);
|
||||
|
|
@ -373,6 +380,7 @@ const char *sal_op_get_network_origin(const SalOp *op);
|
|||
/*returns far-end "User-Agent" string */
|
||||
const char *sal_op_get_remote_ua(const SalOp *op);
|
||||
void *sal_op_get_user_pointer(const SalOp *op);
|
||||
const char* sal_op_get_call_id(const SalOp *op);
|
||||
|
||||
/*Call API*/
|
||||
int sal_call_set_local_media_description(SalOp *h, SalMediaDescription *desc);
|
||||
|
|
|
|||
|
|
@ -283,6 +283,7 @@ Sal * sal_init(){
|
|||
sal->rootCa = 0;
|
||||
sal->verify_server_certs=TRUE;
|
||||
sal->expire_old_contact=FALSE;
|
||||
sal->add_dates=FALSE;
|
||||
sal->dscp=-1;
|
||||
return sal;
|
||||
}
|
||||
|
|
@ -414,6 +415,7 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
|
|||
int dont_use_101 = !ctx->use_101; // Copy char to int to avoid bad alignment
|
||||
eXosip_set_option(EXOSIP_OPT_DONT_SEND_101,&dont_use_101);
|
||||
sal_set_dscp(ctx,ctx->dscp);
|
||||
sal_use_dates(ctx,ctx->add_dates);
|
||||
|
||||
ipv6=strchr(addr,':')!=NULL;
|
||||
eXosip_enable_ipv6(ipv6);
|
||||
|
|
@ -460,6 +462,18 @@ void sal_expire_old_registration_contacts(Sal *ctx, bool_t enabled){
|
|||
ctx->expire_old_contact=enabled;
|
||||
}
|
||||
|
||||
void sal_use_dates(Sal *ctx, bool_t enabled){
|
||||
ctx->add_dates=enabled;
|
||||
#ifdef EXOSIP_OPT_REGISTER_WITH_DATE
|
||||
{
|
||||
int tmp=enabled;
|
||||
eXosip_set_option(EXOSIP_OPT_REGISTER_WITH_DATE,&tmp);
|
||||
}
|
||||
#else
|
||||
if (enabled) ms_warning("Exosip does not support EXOSIP_OPT_REGISTER_WITH_DATE option.");
|
||||
#endif
|
||||
}
|
||||
|
||||
void sal_use_rport(Sal *ctx, bool_t use_rports){
|
||||
ctx->use_rports=use_rports;
|
||||
}
|
||||
|
|
@ -603,6 +617,7 @@ int sal_call(SalOp *h, const char *from, const char *to){
|
|||
int err;
|
||||
const char *route;
|
||||
osip_message_t *invite=NULL;
|
||||
osip_call_id_t *callid;
|
||||
sal_op_set_from(h,from);
|
||||
sal_op_set_to(h,to);
|
||||
sal_exosip_fix_route(h);
|
||||
|
|
@ -643,6 +658,8 @@ int sal_call(SalOp *h, const char *from, const char *to){
|
|||
ms_error("Fail to send invite ! Error code %d", err);
|
||||
return -1;
|
||||
}else{
|
||||
callid=osip_message_get_call_id(invite);
|
||||
osip_call_id_to_str(callid,(char **)(&h->base.call_id));
|
||||
sal_add_call(h->base.root,h);
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -1018,6 +1035,8 @@ static void inc_new_call(Sal *sal, eXosip_event_t *ev){
|
|||
osip_call_info_t *call_info;
|
||||
char *tmp;
|
||||
sdp_message_t *sdp=eXosip_get_sdp_info(ev->request);
|
||||
osip_call_id_t *callid=osip_message_get_call_id(ev->request);
|
||||
osip_call_id_to_str(callid,(char**)(&op->base.call_id));
|
||||
|
||||
set_network_origin(op,ev->request);
|
||||
set_remote_ua(op,ev->request);
|
||||
|
|
@ -1054,7 +1073,6 @@ static void inc_new_call(Sal *sal, eXosip_event_t *ev){
|
|||
op->tid=ev->tid;
|
||||
op->cid=ev->cid;
|
||||
op->did=ev->did;
|
||||
|
||||
sal_add_call(op->base.root,op);
|
||||
sal->callbacks.call_received(op);
|
||||
}
|
||||
|
|
@ -2211,6 +2229,7 @@ static void sal_register_add_route(osip_message_t *msg, const char *proxy){
|
|||
osip_message_set_route(msg,tmp);
|
||||
}
|
||||
|
||||
|
||||
int sal_register(SalOp *h, const char *proxy, const char *from, int expires){
|
||||
osip_message_t *msg;
|
||||
const char *contact=sal_op_get_contact(h);
|
||||
|
|
@ -2251,8 +2270,9 @@ int sal_register(SalOp *h, const char *proxy, const char *from, int expires){
|
|||
eXosip_register_build_register(h->rid,expires,&msg);
|
||||
sal_register_add_route(msg,proxy);
|
||||
}
|
||||
if (msg)
|
||||
if (msg){
|
||||
eXosip_register_send_register(h->rid,msg);
|
||||
}
|
||||
eXosip_unlock();
|
||||
h->expires=expires;
|
||||
return (msg != NULL) ? 0 : -1;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ struct Sal{
|
|||
bool_t reuse_authorization;
|
||||
bool_t verify_server_certs;
|
||||
bool_t expire_old_contact;
|
||||
bool_t add_dates;
|
||||
};
|
||||
|
||||
struct SalOp{
|
||||
|
|
|
|||
12
gtk/main.c
12
gtk/main.c
|
|
@ -279,8 +279,10 @@ static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name)
|
|||
linphone_gtk_visibility_set(shown,window_name,w,TRUE);
|
||||
if (icon_path) {
|
||||
GdkPixbuf *pbuf=create_pixbuf(icon_path);
|
||||
gtk_window_set_icon(GTK_WINDOW(w),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
if(pbuf != NULL) {
|
||||
gtk_window_set_icon(GTK_WINDOW(w),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1526,8 +1528,10 @@ static void linphone_gtk_configure_main_window(){
|
|||
}
|
||||
if (search_icon){
|
||||
GdkPixbuf *pbuf=create_pixbuf(search_icon);
|
||||
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"directory_search_button_icon")),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
if(pbuf != NULL) {
|
||||
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"directory_search_button_icon")),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}
|
||||
}
|
||||
if (home){
|
||||
gchar *tmp;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,22 @@
|
|||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">9.9999999995529656</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment_audio_port">
|
||||
<object class="GtkAdjustment" id="adjustment_max_audio_port">
|
||||
<property name="upper">65535</property>
|
||||
<property name="step_increment">2</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment_max_video_port">
|
||||
<property name="upper">65535</property>
|
||||
<property name="step_increment">2</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment_min_audio_port">
|
||||
<property name="upper">65535</property>
|
||||
<property name="step_increment">2</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment_min_video_port">
|
||||
<property name="upper">65535</property>
|
||||
<property name="step_increment">2</property>
|
||||
<property name="page_increment">10</property>
|
||||
|
|
@ -59,11 +74,6 @@
|
|||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment_video_port">
|
||||
<property name="upper">65535</property>
|
||||
<property name="step_increment">2</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkListStore" id="liststore1"/>
|
||||
<object class="GtkListStore" id="model1">
|
||||
<columns>
|
||||
|
|
@ -207,10 +217,10 @@
|
|||
<child>
|
||||
<object class="GtkCheckButton" id="mtu_set">
|
||||
<property name="label" translatable="yes">Set Maximum Transmission Unit:</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_mtu_set" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -247,10 +257,10 @@
|
|||
<child>
|
||||
<object class="GtkCheckButton" id="dtmf_sipinfo">
|
||||
<property name="label" translatable="yes">Send DTMFs as SIP info</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_use_sip_info_dtmf_toggled" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -263,11 +273,11 @@
|
|||
<child>
|
||||
<object class="GtkCheckButton" id="ipv6_enabled">
|
||||
<property name="label" translatable="yes">Use IPv6 instead of IPv4</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_ipv6_toggled" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -384,9 +394,9 @@
|
|||
<child>
|
||||
<object class="GtkButton" id="tunnel_edit_button">
|
||||
<property name="label">gtk-edit</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_edit_tunnel" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -423,46 +433,6 @@
|
|||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="audio_rtp_port">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment_audio_port</property>
|
||||
<property name="numeric">True</property>
|
||||
<signal name="value-changed" handler="linphone_gtk_audio_port_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="video_rtp_port">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment_video_port</property>
|
||||
<property name="numeric">True</property>
|
||||
<signal name="value-changed" handler="linphone_gtk_video_port_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label13">
|
||||
<property name="visible">True</property>
|
||||
|
|
@ -477,10 +447,10 @@
|
|||
<child>
|
||||
<object class="GtkButton" id="dscp_edit_button">
|
||||
<property name="label">gtk-edit</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_dscp_edit" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -491,6 +461,140 @@
|
|||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="audio_min_rtp_port">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment_min_audio_port</property>
|
||||
<property name="numeric">True</property>
|
||||
<signal name="value-changed" handler="linphone_gtk_min_audio_port_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="audio_max_rtp_port">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment_max_audio_port</property>
|
||||
<property name="numeric">True</property>
|
||||
<signal name="value-changed" handler="linphone_gtk_max_audio_port_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="fixed_audio_port">
|
||||
<property name="label" translatable="yes">Fixed</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_fixed_audio_port_toggle" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox17">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="video_min_rtp_port">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment_min_video_port</property>
|
||||
<property name="numeric">True</property>
|
||||
<signal name="value-changed" handler="linphone_gtk_min_video_port_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="video_max_rtp_port">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment_max_video_port</property>
|
||||
<property name="numeric">True</property>
|
||||
<signal name="value-changed" handler="linphone_gtk_max_video_port_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="fixed_video_port">
|
||||
<property name="label" translatable="yes">Fixed</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_fixed_video_port_toggle" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
@ -525,10 +629,10 @@
|
|||
<child>
|
||||
<object class="GtkRadioButton" id="no_nat">
|
||||
<property name="label" translatable="yes">Direct connection to the Internet</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_no_firewall_toggled" swapped="no"/>
|
||||
|
|
@ -546,10 +650,10 @@
|
|||
<child>
|
||||
<object class="GtkRadioButton" id="use_nat_address">
|
||||
<property name="label" translatable="yes">Behind NAT / Firewall (specify gateway IP below)</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">no_nat</property>
|
||||
|
|
@ -614,10 +718,10 @@
|
|||
<child>
|
||||
<object class="GtkRadioButton" id="use_stun">
|
||||
<property name="label" translatable="yes">Behind NAT / Firewall (use STUN to resolve)</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">no_nat</property>
|
||||
<signal name="toggled" handler="linphone_gtk_use_stun_toggled" swapped="no"/>
|
||||
|
|
@ -631,10 +735,10 @@
|
|||
<child>
|
||||
<object class="GtkRadioButton" id="use_ice">
|
||||
<property name="label" translatable="yes">Behind NAT / Firewall (use ICE)</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">no_nat</property>
|
||||
<signal name="toggled" handler="linphone_gtk_use_ice_toggled" swapped="no"/>
|
||||
|
|
@ -772,6 +876,9 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="ring_sound_box">
|
||||
<property name="visible">True</property>
|
||||
|
|
@ -793,11 +900,11 @@
|
|||
<child>
|
||||
<object class="GtkButton" id="play_ring">
|
||||
<property name="label">gtk-media-play</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_play_ring_file" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -970,10 +1077,10 @@
|
|||
<child>
|
||||
<object class="GtkCheckButton" id="echo_cancelation">
|
||||
<property name="label" translatable="yes">Enable echo cancellation</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_echo_cancelation_toggled" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -984,9 +1091,6 @@
|
|||
<property name="bottom_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
@ -1322,10 +1426,10 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="wizard">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_display_wizard" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox5">
|
||||
|
|
@ -1369,11 +1473,11 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="add_proxy">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_add_proxy" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox14">
|
||||
|
|
@ -1417,11 +1521,11 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="edit_proxy">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_edit_proxy" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox16">
|
||||
|
|
@ -1465,11 +1569,11 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="remove_proxy">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_remove_proxy" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox7">
|
||||
|
|
@ -1513,9 +1617,9 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="create_phonics">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_create_fonics_account" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
|
|
@ -1602,11 +1706,11 @@ virtual network !</property>
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="erase_passwords">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_clear_passwords" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox18">
|
||||
|
|
@ -1788,11 +1892,11 @@ virtual network !</property>
|
|||
<child>
|
||||
<object class="GtkButton" id="button4">
|
||||
<property name="label">gtk-go-up</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_codec_up" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -1805,11 +1909,11 @@ virtual network !</property>
|
|||
<child>
|
||||
<object class="GtkButton" id="up_codec">
|
||||
<property name="label">gtk-go-down</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_codec_down" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -1821,11 +1925,11 @@ virtual network !</property>
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="enable_codec">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_codec_enable" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox8">
|
||||
|
|
@ -1869,11 +1973,11 @@ virtual network !</property>
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="disable_codec">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_codec_disable" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox9">
|
||||
|
|
@ -1988,7 +2092,7 @@ virtual network !</property>
|
|||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
<property name="y_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -2036,10 +2140,10 @@ virtual network !</property>
|
|||
<child>
|
||||
<object class="GtkCheckButton" id="adaptive_rate_control">
|
||||
<property name="label" translatable="yes">Enable adaptive rate control</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_adaptive_rate_control_toggled" swapped="no"/>
|
||||
|
|
@ -2050,7 +2154,7 @@ virtual network !</property>
|
|||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
<property name="y_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
|
@ -2065,7 +2169,7 @@ virtual network !</property>
|
|||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
<property name="y_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
|
@ -2191,10 +2295,10 @@ virtual network !</property>
|
|||
<child>
|
||||
<object class="GtkCheckButton" id="ui_level">
|
||||
<property name="label" translatable="yes">Show advanced settings</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_ui_level_toggled" swapped="no"/>
|
||||
</object>
|
||||
|
|
@ -2271,11 +2375,11 @@ virtual network !</property>
|
|||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button5">
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="linphone_gtk_parameters_closed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox3">
|
||||
|
|
|
|||
|
|
@ -146,14 +146,74 @@ void linphone_gtk_ipv6_toggled(GtkWidget *w){
|
|||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
|
||||
}
|
||||
|
||||
void linphone_gtk_audio_port_changed(GtkWidget *w){
|
||||
linphone_core_set_audio_port(linphone_gtk_get_core(),
|
||||
(gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w)));
|
||||
void linphone_gtk_min_audio_port_changed(GtkWidget *w){
|
||||
GtkWidget *mw = linphone_gtk_get_main_window();
|
||||
GtkWidget *pb = (GtkWidget *) g_object_get_data(G_OBJECT(mw), "parameters");
|
||||
GtkSpinButton *min_button = GTK_SPIN_BUTTON(w);
|
||||
GtkSpinButton *max_button = GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "audio_max_rtp_port"));
|
||||
gboolean fixed = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb, "fixed_audio_port")));
|
||||
|
||||
if (fixed) {
|
||||
linphone_core_set_audio_port(linphone_gtk_get_core(), (gint) gtk_spin_button_get_value(min_button));
|
||||
gtk_spin_button_set_value(max_button, gtk_spin_button_get_value(min_button));
|
||||
} else {
|
||||
gint min_port = gtk_spin_button_get_value(min_button);
|
||||
gint max_port = gtk_spin_button_get_value(max_button);
|
||||
if (min_port > max_port) {
|
||||
gtk_spin_button_set_value(max_button, min_port);
|
||||
max_port = min_port;
|
||||
}
|
||||
linphone_core_set_audio_port_range(linphone_gtk_get_core(), min_port, max_port);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_video_port_changed(GtkWidget *w){
|
||||
linphone_core_set_video_port(linphone_gtk_get_core(),
|
||||
(gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w)));
|
||||
void linphone_gtk_max_audio_port_changed(GtkWidget *w){
|
||||
GtkWidget *mw = linphone_gtk_get_main_window();
|
||||
GtkWidget *pb = (GtkWidget *) g_object_get_data(G_OBJECT(mw), "parameters");
|
||||
GtkSpinButton *min_button = GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "audio_min_rtp_port"));
|
||||
GtkSpinButton *max_button = GTK_SPIN_BUTTON(w);
|
||||
gint min_port = gtk_spin_button_get_value(min_button);
|
||||
gint max_port = gtk_spin_button_get_value(max_button);
|
||||
if (max_port < min_port) {
|
||||
gtk_spin_button_set_value(min_button, max_port);
|
||||
min_port = max_port;
|
||||
}
|
||||
linphone_core_set_audio_port_range(linphone_gtk_get_core(), min_port, max_port);
|
||||
}
|
||||
|
||||
void linphone_gtk_min_video_port_changed(GtkWidget *w){
|
||||
GtkWidget *mw = linphone_gtk_get_main_window();
|
||||
GtkWidget *pb = (GtkWidget *) g_object_get_data(G_OBJECT(mw), "parameters");
|
||||
GtkSpinButton *min_button = GTK_SPIN_BUTTON(w);
|
||||
GtkSpinButton *max_button = GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "video_max_rtp_port"));
|
||||
gboolean fixed = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb, "fixed_video_port")));
|
||||
|
||||
if (fixed) {
|
||||
linphone_core_set_video_port(linphone_gtk_get_core(), (gint) gtk_spin_button_get_value(min_button));
|
||||
gtk_spin_button_set_value(max_button, gtk_spin_button_get_value(min_button));
|
||||
} else {
|
||||
gint min_port = gtk_spin_button_get_value(min_button);
|
||||
gint max_port = gtk_spin_button_get_value(max_button);
|
||||
if (min_port > max_port) {
|
||||
gtk_spin_button_set_value(max_button, min_port);
|
||||
max_port = min_port;
|
||||
}
|
||||
linphone_core_set_video_port_range(linphone_gtk_get_core(), min_port, max_port);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_max_video_port_changed(GtkWidget *w){
|
||||
GtkWidget *mw = linphone_gtk_get_main_window();
|
||||
GtkWidget *pb = (GtkWidget *) g_object_get_data(G_OBJECT(mw), "parameters");
|
||||
GtkSpinButton *min_button = GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "video_min_rtp_port"));
|
||||
GtkSpinButton *max_button = GTK_SPIN_BUTTON(w);
|
||||
gint min_port = gtk_spin_button_get_value(min_button);
|
||||
gint max_port = gtk_spin_button_get_value(max_button);
|
||||
if (max_port < min_port) {
|
||||
gtk_spin_button_set_value(min_button, max_port);
|
||||
min_port = max_port;
|
||||
}
|
||||
linphone_core_set_video_port_range(linphone_gtk_get_core(), min_port, max_port);
|
||||
}
|
||||
|
||||
void linphone_gtk_no_firewall_toggled(GtkWidget *w){
|
||||
|
|
@ -877,6 +937,7 @@ static void linphone_gtk_show_media_encryption(GtkWidget *pb){
|
|||
|
||||
void linphone_gtk_parameters_destroyed(GtkWidget *pb){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
ms_error("linphone_gtk_paramters_destroyed");
|
||||
g_object_set_data(G_OBJECT(mw),"parameters",NULL);
|
||||
}
|
||||
|
||||
|
|
@ -908,12 +969,15 @@ void linphone_gtk_show_parameters(void){
|
|||
int mtu;
|
||||
int ui_advanced;
|
||||
LCSipTransports tr;
|
||||
int min_port = 0, max_port = 0;
|
||||
|
||||
if (pb==NULL) {
|
||||
pb=linphone_gtk_create_window("parameters");
|
||||
g_object_set_data(G_OBJECT(mw),"parameters",pb);
|
||||
ms_error("linphone_gtk_show_paramters: create");
|
||||
}else {
|
||||
gtk_widget_show(pb);
|
||||
ms_error("linphone_gtk_show_parameters: show");
|
||||
return;
|
||||
}
|
||||
codec_list=linphone_gtk_get_widget(pb,"codec_list");
|
||||
|
|
@ -939,10 +1003,20 @@ void linphone_gtk_show_parameters(void){
|
|||
tr.udp_port);
|
||||
}
|
||||
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"audio_rtp_port")),
|
||||
linphone_core_get_audio_port(lc));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"video_rtp_port")),
|
||||
linphone_core_get_video_port(lc));
|
||||
linphone_core_get_audio_port_range(lc, &min_port, &max_port);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "audio_min_rtp_port")), min_port);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "audio_max_rtp_port")), max_port);
|
||||
if (min_port == max_port) {
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(linphone_gtk_get_widget(pb, "audio_max_rtp_port")), FALSE);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb, "fixed_audio_port")), TRUE);
|
||||
}
|
||||
linphone_core_get_video_port_range(lc, &min_port, &max_port);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "video_min_rtp_port")), min_port);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "video_max_rtp_port")), max_port);
|
||||
if (min_port == max_port) {
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(linphone_gtk_get_widget(pb, "video_max_rtp_port")), FALSE);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb, "fixed_video_port")), TRUE);
|
||||
}
|
||||
|
||||
linphone_gtk_show_media_encryption(pb);
|
||||
|
||||
|
|
@ -1032,6 +1106,36 @@ void linphone_gtk_show_parameters(void){
|
|||
}
|
||||
|
||||
|
||||
void linphone_gtk_fixed_audio_port_toggle(void) {
|
||||
GtkWidget *mw = linphone_gtk_get_main_window();
|
||||
GtkWidget *pb = (GtkWidget *) g_object_get_data(G_OBJECT(mw), "parameters");
|
||||
gboolean fixed = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb, "fixed_audio_port")));
|
||||
gint min_port = gtk_spin_button_get_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "audio_min_rtp_port")));
|
||||
gint max_port = gtk_spin_button_get_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "audio_max_rtp_port")));
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(linphone_gtk_get_widget(pb, "audio_max_rtp_port")), !fixed);
|
||||
if (fixed) {
|
||||
linphone_core_set_audio_port(linphone_gtk_get_core(), min_port);
|
||||
} else {
|
||||
linphone_core_set_audio_port_range(linphone_gtk_get_core(), min_port, max_port);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void linphone_gtk_fixed_video_port_toggle(void) {
|
||||
GtkWidget *mw = linphone_gtk_get_main_window();
|
||||
GtkWidget *pb = (GtkWidget *) g_object_get_data(G_OBJECT(mw), "parameters");
|
||||
gboolean fixed = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb, "fixed_video_port")));
|
||||
gint min_port = gtk_spin_button_get_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "video_min_rtp_port")));
|
||||
gint max_port = gtk_spin_button_get_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "video_max_rtp_port")));
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(linphone_gtk_get_widget(pb, "video_max_rtp_port")), !fixed);
|
||||
if (fixed) {
|
||||
linphone_core_set_video_port(linphone_gtk_get_core(), min_port);
|
||||
} else {
|
||||
linphone_core_set_video_port_range(linphone_gtk_get_core(), min_port, max_port);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void linphone_gtk_edit_tunnel_closed(GtkWidget *button){
|
||||
GtkWidget *pb=gtk_widget_get_toplevel(button);
|
||||
gtk_widget_destroy(pb);
|
||||
|
|
|
|||
|
|
@ -104,4 +104,8 @@ public interface LinphoneCallLog {
|
|||
* @return the call duration, in seconds
|
||||
*/
|
||||
public int getCallDuration();
|
||||
/**
|
||||
* @return the call id from signaling
|
||||
*/
|
||||
public int getCallId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,6 @@ package org.linphone.core;
|
|||
|
||||
import java.util.Vector;
|
||||
|
||||
import org.linphone.core.LinphoneCallLog;
|
||||
import org.linphone.core.LinphoneCallParams;
|
||||
|
||||
/**
|
||||
* Linphone core main object created by method {@link LinphoneCoreFactory#createLinphoneCore(LinphoneCoreListener, String, String, Object)}.
|
||||
*
|
||||
|
|
@ -234,21 +231,28 @@ public interface LinphoneCore {
|
|||
static public class EcCalibratorStatus {
|
||||
|
||||
static private Vector values = new Vector();
|
||||
/* Do not change the values of these constants or the strings associated with them to prevent breaking
|
||||
the collection of echo canceller calibration results during the wizard! */
|
||||
public static final int IN_PROGRESS_STATUS=0;
|
||||
public static final int DONE_STATUS=1;
|
||||
public static final int FAILED_STATUS=2;
|
||||
public static final int DONE_NO_ECHO_STATUS=3;
|
||||
/**
|
||||
* Calibration in progress
|
||||
*/
|
||||
static public EcCalibratorStatus InProgress = new EcCalibratorStatus(IN_PROGRESS_STATUS,"InProgress");
|
||||
static public EcCalibratorStatus InProgress = new EcCalibratorStatus(IN_PROGRESS_STATUS,"InProgress");
|
||||
/**
|
||||
* Calibration done
|
||||
* Calibration done that produced an echo delay measure
|
||||
*/
|
||||
static public EcCalibratorStatus Done = new EcCalibratorStatus(DONE_STATUS,"Done");
|
||||
static public EcCalibratorStatus Done = new EcCalibratorStatus(DONE_STATUS,"Done");
|
||||
/**
|
||||
* Calibration in progress
|
||||
* Calibration failed
|
||||
*/
|
||||
static public EcCalibratorStatus Failed = new EcCalibratorStatus(FAILED_STATUS,"Failed");
|
||||
/**
|
||||
* Calibration done with no echo detected
|
||||
*/
|
||||
static public EcCalibratorStatus DoneNoEcho = new EcCalibratorStatus(DONE_NO_ECHO_STATUS, "DoneNoEcho");
|
||||
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
|
|
@ -802,4 +806,41 @@ public interface LinphoneCore {
|
|||
* return the version code of linphone core
|
||||
*/
|
||||
public String getVersion();
|
||||
|
||||
/**
|
||||
* remove a linphone friend from linphone core and linphonerc
|
||||
*/
|
||||
void removeFriend(LinphoneFriend lf);
|
||||
|
||||
/**
|
||||
* return a linphone friend (if exists) that matches the sip address
|
||||
*/
|
||||
LinphoneFriend findFriendByAddress(String sipUri);
|
||||
|
||||
/**
|
||||
* Sets the UDP port used for audio streaming.
|
||||
**/
|
||||
void setAudioPort(int port);
|
||||
|
||||
/**
|
||||
* Sets the UDP port range from which to randomly select the port used for audio streaming.
|
||||
*/
|
||||
void setAudioPortRange(int minPort, int maxPort);
|
||||
|
||||
/**
|
||||
* Sets the UDP port used for video streaming.
|
||||
**/
|
||||
void setVideoPort(int port);
|
||||
|
||||
/**
|
||||
* Sets the UDP port range from which to randomly select the port used for video streaming.
|
||||
*/
|
||||
void setVideoPortRange(int minPort, int maxPort);
|
||||
|
||||
/**
|
||||
* Set the incoming call timeout in seconds.
|
||||
* If an incoming call isn't answered for this timeout period, it is
|
||||
* automatically declined.
|
||||
**/
|
||||
void setIncomingTimeout(int timeout);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,6 +91,14 @@ public interface LinphoneCoreListener {
|
|||
*/
|
||||
void messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message);
|
||||
|
||||
/**
|
||||
* invoked when a new dtmf is received
|
||||
* @param lc LinphoneCore
|
||||
* @param call LinphoneCall involved in the dtmf sending
|
||||
* @param dtmf value of the dtmf sent
|
||||
*/
|
||||
void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf);
|
||||
|
||||
/**
|
||||
* Invoked when echo cancalation calibration is completed
|
||||
* @param lc LinphoneCore
|
||||
|
|
|
|||
|
|
@ -123,5 +123,8 @@ public interface LinphoneFriend {
|
|||
*/
|
||||
String toString();
|
||||
|
||||
|
||||
/**
|
||||
* Return the native pointer for this object
|
||||
*/
|
||||
long getNativePtr();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,6 @@ package org.linphone.core;
|
|||
public interface PayloadType {
|
||||
|
||||
String getMime();
|
||||
|
||||
int getRate();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,12 +159,7 @@ Any subsequente modifications to {@link org.linphone.core.LinphoneFriend} must b
|
|||
my_friend.enableSubscribes(true); /*disable subscription for this friend*/
|
||||
my_friend.done(); /*commit changes triggering an UNSUBSCRIBE message*/
|
||||
</code>
|
||||
</pre> Do not display status messages
|
||||
-J<flag> Pass <flag> directly to the runtime system
|
||||
|
||||
Provided by Standard doclet:
|
||||
-d <directory> Destination directory for output files
|
||||
-use
|
||||
</pre>
|
||||
|
||||
<b> Publishing presence status </b>
|
||||
<br>Local presence status can be changed using function {@link org.linphone.core.LinphoneCore#setPresenceInfo }.New status is propagated to all friends {@link org.linphone.core.LinphoneCore#addFriend(LinphoneFriend lf) previously added } to LinphoneCore.
|
||||
|
|
@ -220,36 +215,65 @@ mic_gain=0.1
|
|||
|
||||
<b>Echo cancellation</b>
|
||||
<br>
|
||||
On Android devices, echo is a problem, especially with low-end devices. The root cause is the unpredictable latency of Android's sound system. The liblinphone software {@link org.linphone.core.LinphoneCore#enableEchoCancellation echo canceller} that is operating well on desktop platforms (Mac, Linux, Windows) is unable to operate under Android platform. The situation is very heterogenous:<br>
|
||||
On Android devices, there are two kind of situations regarding echo cancellation:<br>
|
||||
<ul>
|
||||
<li>On new (after 2011) high end devices, manufacturers often include a hardware echo cancellation. If available, liblinphone will make use of it and no software correction is required.
|
||||
Source file linphone-android/submodules/linphone/mediastreamer2/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java contains a method hasBuiltInEchoCanceller() that returns true if an hardware echo canceller is available, based on device model identifier. The current list is incomplete.
|
||||
</li>
|
||||
<li>On former models with decent CPU power (armv7), sound system behaves in a nearly predictive way so that it is possible to use {@link org.linphone.core.LinphoneCore#enableEchoLimiter echo limiter}. Echo limiter is a simple echo attenuation technique which consists in strongly attenuating the microphone input when speaker is playing voice, in order to cut the echo. The main drawback of echo limiter is that the conversation is perceived as half duplex by users, because they won't hear background noise from the remote side while they are speaking.
|
||||
</li>
|
||||
<li>On low class android devices or very old models (armv5 processor), no solution works.
|
||||
</li>
|
||||
<li>The new (after 2011) high end devices, on which manufacturers often include a hardware echo cancellation. If available, liblinphone will make use of it and no software correction is required. Source file linphone-android/submodules/linphone/mediastreamer2/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java contains a method hasBuiltInEchoCanceller() that returns true if an hardware echo canceller is available, based on device model identifier. The current list is incomplete.</li>
|
||||
<li>The other devices, for which it is recommended to enable the software echo canceller of liblinphone.</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
In order to benefit from the best echo cancellation solution, we recommend applications to run the following algorithm, when it is run for the first time:<br>
|
||||
First of {@link org.linphone.core.LinphoneCore#enableEchoCancellation echo canceller} should not be used, in any case.
|
||||
<ul>
|
||||
<li>Use the Hacks.hasBuiltInEchoCanceller() method to first check if the device has hardware echo canceller. If yes, then echo limiter must be turned off.</li>
|
||||
<li>If no the hasBuiltInEchoCanceller() returned false, then it is possible to use the echo calibration procedure. If the calibration procedure fails, it means that
|
||||
probably the phone performs hardware echo cancellation, so in this case echo limiter must be turned off.</li>
|
||||
<li>If the echo calibration succeeded, then echo is present, so it is recommended to enable echo limiter.
|
||||
</ul>
|
||||
|
||||
<b>Echo calibration tool</b>
|
||||
<br>
|
||||
<b>Echo calibration procedure</b>
|
||||
<br>
|
||||
The echo calibration procedure is a five second test which consists in playing small beeps to the speaker while the microphone input is recorded.
|
||||
The echo calibration procedure is a five second audio test which consists in playing small beeps to the receiver while the microphone input is recorded.
|
||||
If the device is subject to echo (or doesn't have hardware echo cancellation), then beeps recorded by the microphone will be detected and a measurement of echo delay can be computed.
|
||||
Echo calibration procedure can be started by calling {@link org.linphone.core.LinphoneCore#startEchoCalibration LinphoneCore.startEchoCalibration}.
|
||||
The measurement of the echo delay is important to save CPU computations by restricting the temporal area where the software echo canceller has to perform.
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<b>Echo limiter</b>
|
||||
<br>
|
||||
The echo limiter is a liblinphone algorithm to clear out echo with a brute force method. It consists in cutting down the microphone signal when active signal is played by the speaker/receiver, to prevent voice to feed back into the microphone. This algorithm has disadvantages compared to the hardware or software echo cancellers because the remote user will be not hear any background noise when speaking, which is confusing. As a result the echo limiter method shall be used only under situation where echo canceller can't perform, that is loud signals with heavy saturations, which usually happens when using the device in speaker mode. Echo limiter can be enabled or disabled during a call with {@link org.linphone.core.LinphoneCall#enableEchoLimiter LinphoneCall.enableEchoLimiter()}.
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<b>Recommandations to applications for optimal audio performance</b>
|
||||
<br>
|
||||
|
||||
<br>
|
||||
In order to benefit from the best echo cancellation solution, we recommend applications to run the following procedure, when they are run for the first time:<br>
|
||||
<ul>
|
||||
<li>Use the Hacks.hasBuiltInEchoCanceller() method to first check if the device has hardware echo cancellation. If yes, then echo canceller must be turned off.</li>
|
||||
<li>If hasBuiltInEchoCanceller() returned false, then it is recommended to run the echo calibration procedure. This procedure can produce the following results:
|
||||
<ul>
|
||||
<li>success with no echo detected: it means that the device has an hardware echo canceller but is not (yet) referenced in our list of devices having hardware echo cancellation. Echo cancellation should be disabled with {@link org.linphone.core.LinphoneCore#enableEchoCancellation LinphoneCore.enableEchoCancellation(false)}</li>
|
||||
<li>success with an estimated echo delay: the echo canceller should be enabled.</li>
|
||||
<li>failure: it means that some echo has been detected but the delay could not be estimated. In this case it is recommended to activate the echo canceller. A typical for android minimum delay of 250 ms will be used as default.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
During calls, the echo limiter should be disabled while using the receiver, but enabled while using the hands-free speaker. It is also recommended to disable echo canceller while using the echo limiter, because the first one would be useless. Therefore you should have the following situations:
|
||||
<ul>
|
||||
<li>While using the receiver</li>
|
||||
<ul>
|
||||
<li>Echo canceller enabled, unless the device has hardware echo cancellation</li>
|
||||
<li>Echo limiter disabled</li>
|
||||
</ul>
|
||||
<li>While using the hands-free speaker</li>
|
||||
<ul>
|
||||
<li>Echo canceller disabled</li>
|
||||
<li>Echo limiter enabled, unless the device has hardware echo cancellation.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
Controlling echo limiter during a call has to be done with {@link org.linphone.core.LinphoneCall#enableEchoLimiter LinphoneCall.enableEchoLimiter()}.
|
||||
Controlling echo canceller during a call has to be done with {@link org.linphone.core.LinphoneCall#enableEchoCancellation LinphoneCall.enableEchoCancellation()}.
|
||||
|
||||
|
||||
<br><br>
|
||||
<b>Echo limiter settings</b><br>
|
||||
<b>Echo limiter settings</b>
|
||||
<br>
|
||||
Echo limiter requires settings to be defined in linphonerc factory config file for correction operation.
|
||||
Typical settings are:
|
||||
<pre>
|
||||
|
|
|
|||
100
java/impl/org/linphone/core/LinphoneAddressImpl.java
Normal file
100
java/impl/org/linphone/core/LinphoneAddressImpl.java
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
LinphoneAddressImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
|
||||
|
||||
public class LinphoneAddressImpl implements LinphoneAddress {
|
||||
protected final long nativePtr;
|
||||
boolean ownPtr = false;
|
||||
private native long newLinphoneAddressImpl(String uri,String displayName);
|
||||
private native void delete(long ptr);
|
||||
private native String getDisplayName(long ptr);
|
||||
private native String getUserName(long ptr);
|
||||
private native String getDomain(long ptr);
|
||||
private native String toUri(long ptr);
|
||||
private native void setDisplayName(long ptr,String name);
|
||||
private native String toString(long ptr);
|
||||
|
||||
protected LinphoneAddressImpl(String identity) {
|
||||
nativePtr = newLinphoneAddressImpl(identity, null);
|
||||
}
|
||||
|
||||
protected LinphoneAddressImpl(String username,String domain,String displayName) {
|
||||
nativePtr = newLinphoneAddressImpl("sip:"+username+"@"+domain, displayName);
|
||||
}
|
||||
protected LinphoneAddressImpl(long aNativePtr,boolean javaOwnPtr) {
|
||||
nativePtr = aNativePtr;
|
||||
ownPtr=javaOwnPtr;
|
||||
}
|
||||
protected LinphoneAddressImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
ownPtr=false;
|
||||
}
|
||||
protected void finalize() throws Throwable {
|
||||
if (ownPtr) delete(nativePtr);
|
||||
}
|
||||
public String getDisplayName() {
|
||||
return getDisplayName(nativePtr);
|
||||
}
|
||||
public String getDomain() {
|
||||
return getDomain(nativePtr);
|
||||
}
|
||||
public String getUserName() {
|
||||
return getUserName(nativePtr);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return toString(nativePtr);
|
||||
}
|
||||
public String toUri() {
|
||||
return toUri(nativePtr);
|
||||
}
|
||||
public void setDisplayName(String name) {
|
||||
setDisplayName(nativePtr,name);
|
||||
}
|
||||
public String asString() {
|
||||
return toString();
|
||||
}
|
||||
public String asStringUriOnly() {
|
||||
return toUri(nativePtr);
|
||||
}
|
||||
public void clean() {
|
||||
throw new RuntimeException("Not implemented");
|
||||
}
|
||||
public String getPort() {
|
||||
return String.valueOf(getPortInt());
|
||||
}
|
||||
public int getPortInt() {
|
||||
return getPortInt();
|
||||
}
|
||||
public void setDomain(String domain) {
|
||||
throw new RuntimeException("Not implemented");
|
||||
}
|
||||
public void setPort(String port) {
|
||||
throw new RuntimeException("Not implemented");
|
||||
}
|
||||
public void setPortInt(int port) {
|
||||
throw new RuntimeException("Not implemented");
|
||||
}
|
||||
public void setUserName(String username) {
|
||||
throw new RuntimeException("Not implemented");
|
||||
}
|
||||
|
||||
}
|
||||
55
java/impl/org/linphone/core/LinphoneAuthInfoImpl.java
Normal file
55
java/impl/org/linphone/core/LinphoneAuthInfoImpl.java
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
LinphoneAuthInfoImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
class LinphoneAuthInfoImpl implements LinphoneAuthInfo {
|
||||
protected final long nativePtr;
|
||||
private native long newLinphoneAuthInfo(String username, String userid, String passwd, String ha1,String realm);
|
||||
private native void delete(long ptr);
|
||||
protected LinphoneAuthInfoImpl(String username,String password, String realm) {
|
||||
nativePtr = newLinphoneAuthInfo(username,"",password,"","");
|
||||
}
|
||||
protected void finalize() throws Throwable {
|
||||
delete(nativePtr);
|
||||
}
|
||||
public String getPassword() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new RuntimeException("not implemeneted yet");
|
||||
}
|
||||
public String getRealm() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new RuntimeException("not implemeneted yet");
|
||||
}
|
||||
public String getUsername() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new RuntimeException("not implemeneted yet");
|
||||
}
|
||||
public void setPassword(String password) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new RuntimeException("not implemeneted yet");
|
||||
}
|
||||
public void setRealm(String realm) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new RuntimeException("not implemeneted yet");
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new RuntimeException("not implemeneted yet");
|
||||
}
|
||||
}
|
||||
187
java/impl/org/linphone/core/LinphoneCallImpl.java
Normal file
187
java/impl/org/linphone/core/LinphoneCallImpl.java
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
LinphoneCallImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
|
||||
class LinphoneCallImpl implements LinphoneCall {
|
||||
|
||||
protected final long nativePtr;
|
||||
boolean ownPtr = false;
|
||||
private LinphoneCallStats audioStats;
|
||||
private LinphoneCallStats videoStats;
|
||||
|
||||
native private void finalize(long nativePtr);
|
||||
native private long getCallLog(long nativePtr);
|
||||
private native boolean isIncoming(long nativePtr);
|
||||
native private long getRemoteAddress(long nativePtr);
|
||||
native private int getState(long nativePtr);
|
||||
private native long getCurrentParamsCopy(long nativePtr);
|
||||
private native long getRemoteParams(long nativePtr);
|
||||
private native void enableCamera(long nativePtr, boolean enabled);
|
||||
private native boolean cameraEnabled(long nativePtr);
|
||||
private native void enableEchoCancellation(long nativePtr,boolean enable);
|
||||
private native boolean isEchoCancellationEnabled(long nativePtr) ;
|
||||
private native void enableEchoLimiter(long nativePtr,boolean enable);
|
||||
private native boolean isEchoLimiterEnabled(long nativePtr);
|
||||
private native Object getReplacedCall(long nativePtr);
|
||||
private native int getDuration(long nativePtr);
|
||||
private native float getCurrentQuality(long nativePtr);
|
||||
private native float getAverageQuality(long nativePtr);
|
||||
|
||||
/*
|
||||
* This method must always be called from JNI, nothing else.
|
||||
*/
|
||||
private LinphoneCallImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
}
|
||||
protected void finalize() throws Throwable {
|
||||
finalize(nativePtr);
|
||||
}
|
||||
public LinphoneCallLog getCallLog() {
|
||||
long lNativePtr = getCallLog(nativePtr);
|
||||
if (lNativePtr!=0) {
|
||||
return new LinphoneCallLogImpl(lNativePtr);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public void setAudioStats(LinphoneCallStats stats) {
|
||||
audioStats = stats;
|
||||
}
|
||||
public void setVideoStats(LinphoneCallStats stats) {
|
||||
videoStats = stats;
|
||||
}
|
||||
public LinphoneCallStats getAudioStats() {
|
||||
return audioStats;
|
||||
}
|
||||
public LinphoneCallStats getVideoStats() {
|
||||
return videoStats;
|
||||
}
|
||||
public CallDirection getDirection() {
|
||||
return isIncoming(nativePtr)?CallDirection.Incoming:CallDirection.Outgoing;
|
||||
}
|
||||
public LinphoneAddress getRemoteAddress() {
|
||||
long lNativePtr = getRemoteAddress(nativePtr);
|
||||
if (lNativePtr!=0) {
|
||||
return new LinphoneAddressImpl(lNativePtr);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public State getState() {
|
||||
return LinphoneCall.State.fromInt(getState(nativePtr));
|
||||
}
|
||||
public LinphoneCallParams getCurrentParamsCopy() {
|
||||
return new LinphoneCallParamsImpl(getCurrentParamsCopy(nativePtr));
|
||||
}
|
||||
public LinphoneCallParams getRemoteParams() {
|
||||
long remoteParamsPtr = getRemoteParams(nativePtr);
|
||||
if (remoteParamsPtr == 0) {
|
||||
return null;
|
||||
}
|
||||
return new LinphoneCallParamsImpl(remoteParamsPtr);
|
||||
}
|
||||
public void enableCamera(boolean enabled) {
|
||||
enableCamera(nativePtr, enabled);
|
||||
}
|
||||
public boolean cameraEnabled() {
|
||||
return cameraEnabled(nativePtr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object call) {
|
||||
if (this == call) return true;
|
||||
if (call == null) return false;
|
||||
if (!(call instanceof LinphoneCallImpl)) return false;
|
||||
return nativePtr == ((LinphoneCallImpl)call).nativePtr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + (int) (nativePtr ^ (nativePtr >>> 32));
|
||||
return result;
|
||||
}
|
||||
public void enableEchoCancellation(boolean enable) {
|
||||
enableEchoCancellation(nativePtr,enable);
|
||||
|
||||
}
|
||||
public boolean isEchoCancellationEnabled() {
|
||||
return isEchoCancellationEnabled(nativePtr);
|
||||
}
|
||||
public void enableEchoLimiter(boolean enable) {
|
||||
enableEchoLimiter(nativePtr,enable);
|
||||
}
|
||||
public boolean isEchoLimiterEnabled() {
|
||||
return isEchoLimiterEnabled(nativePtr);
|
||||
}
|
||||
public LinphoneCall getReplacedCall(){
|
||||
return (LinphoneCall)getReplacedCall(nativePtr);
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return getDuration(nativePtr);
|
||||
}
|
||||
public float getAverageQuality() {
|
||||
return getAverageQuality(nativePtr);
|
||||
}
|
||||
public float getCurrentQuality() {
|
||||
return getCurrentQuality(nativePtr);
|
||||
}
|
||||
|
||||
private native String getAuthenticationToken(long nativePtr);
|
||||
public String getAuthenticationToken(){
|
||||
return getAuthenticationToken(nativePtr);
|
||||
}
|
||||
|
||||
private native boolean isAuthenticationTokenVerified(long nativePtr);
|
||||
public boolean isAuthenticationTokenVerified(){
|
||||
return isAuthenticationTokenVerified(nativePtr);
|
||||
}
|
||||
|
||||
private native void setAuthenticationTokenVerified(long nativePtr, boolean verified);
|
||||
public void setAuthenticationTokenVerified(boolean verified){
|
||||
setAuthenticationTokenVerified(nativePtr, verified);
|
||||
}
|
||||
|
||||
public boolean isInConference() {
|
||||
LinphoneCallParamsImpl params = new LinphoneCallParamsImpl(getCurrentParamsCopy(nativePtr));
|
||||
return params.localConferenceMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Call " + nativePtr;
|
||||
}
|
||||
|
||||
private native float getPlayVolume(long nativePtr);
|
||||
public float getPlayVolume() {
|
||||
return getPlayVolume(nativePtr);
|
||||
}
|
||||
|
||||
private native void takeSnapshot(long nativePtr, String path);
|
||||
public void takeSnapshot(String path) {
|
||||
takeSnapshot(nativePtr, path);
|
||||
}
|
||||
|
||||
private native void zoomVideo(long nativePtr, float factor, float cx, float cy);
|
||||
public void zoomVideo(float factor, float cx, float cy) {
|
||||
zoomVideo(nativePtr, factor, cx, cy);
|
||||
}
|
||||
}
|
||||
67
java/impl/org/linphone/core/LinphoneCallLogImpl.java
Normal file
67
java/impl/org/linphone/core/LinphoneCallLogImpl.java
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
LinPhoneCallLogImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
|
||||
class LinphoneCallLogImpl implements LinphoneCallLog {
|
||||
|
||||
protected final long nativePtr;
|
||||
|
||||
private native long getFrom(long nativePtr);
|
||||
private native long getTo(long nativePtr);
|
||||
private native boolean isIncoming(long nativePtr);
|
||||
private native int getStatus(long nativePtr);
|
||||
private native String getStartDate(long nativePtr);
|
||||
private native int getCallDuration(long nativePtr);
|
||||
private native int getCallId(long nativePtr);
|
||||
|
||||
LinphoneCallLogImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
}
|
||||
|
||||
public CallDirection getDirection() {
|
||||
return isIncoming(nativePtr)?CallDirection.Incoming:CallDirection.Outgoing;
|
||||
}
|
||||
|
||||
public LinphoneAddress getFrom() {
|
||||
return new LinphoneAddressImpl(getFrom(nativePtr));
|
||||
}
|
||||
|
||||
public LinphoneAddress getTo() {
|
||||
return new LinphoneAddressImpl(getTo(nativePtr));
|
||||
}
|
||||
public CallStatus getStatus() {
|
||||
return LinphoneCallLog.CallStatus.fromInt(getStatus(nativePtr));
|
||||
}
|
||||
|
||||
public long getNativePtr() {
|
||||
return nativePtr;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return getStartDate(nativePtr);
|
||||
}
|
||||
|
||||
public int getCallDuration() {
|
||||
return getCallDuration(nativePtr);
|
||||
}
|
||||
public int getCallId() {
|
||||
return getCallId(nativePtr);
|
||||
}
|
||||
}
|
||||
82
java/impl/org/linphone/core/LinphoneCallParamsImpl.java
Normal file
82
java/impl/org/linphone/core/LinphoneCallParamsImpl.java
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
LinphoneCallParamsImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import org.linphone.core.LinphoneCore.MediaEncryption;
|
||||
|
||||
public class LinphoneCallParamsImpl implements LinphoneCallParams {
|
||||
protected final long nativePtr;
|
||||
|
||||
public LinphoneCallParamsImpl(long nativePtr) {
|
||||
this.nativePtr = nativePtr;
|
||||
}
|
||||
|
||||
private native void enableVideo(long nativePtr, boolean b);
|
||||
private native boolean getVideoEnabled(long nativePtr);
|
||||
private native void audioBandwidth(long nativePtr, int bw);
|
||||
private native void setMediaEncryption(long nativePtr, int menc);
|
||||
private native int getMediaEncryption(long nativePtr);
|
||||
private native long getUsedAudioCodec(long nativePtr);
|
||||
private native long getUsedVideoCodec(long nativePtr);
|
||||
private native void destroy(long nativePtr);
|
||||
|
||||
|
||||
public boolean getVideoEnabled() {
|
||||
return getVideoEnabled(nativePtr);
|
||||
}
|
||||
|
||||
public void setVideoEnabled(boolean b) {
|
||||
enableVideo(nativePtr, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
destroy(nativePtr);
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
public void setAudioBandwidth(int value) {
|
||||
audioBandwidth(nativePtr, value);
|
||||
}
|
||||
|
||||
public MediaEncryption getMediaEncryption() {
|
||||
return MediaEncryption.fromInt(getMediaEncryption(nativePtr));
|
||||
}
|
||||
|
||||
public void setMediaEnctyption(MediaEncryption menc) {
|
||||
setMediaEncryption(nativePtr, menc.mValue);
|
||||
}
|
||||
|
||||
public PayloadType getUsedAudioCodec() {
|
||||
long ptr = getUsedAudioCodec(nativePtr);
|
||||
if (ptr == 0) return null;
|
||||
return new PayloadTypeImpl(ptr);
|
||||
}
|
||||
|
||||
public PayloadType getUsedVideoCodec() {
|
||||
long ptr = getUsedVideoCodec(nativePtr);
|
||||
if (ptr == 0) return null;
|
||||
return new PayloadTypeImpl(ptr);
|
||||
}
|
||||
|
||||
private native boolean localConferenceMode(long nativePtr);
|
||||
public boolean localConferenceMode() {
|
||||
return localConferenceMode(nativePtr);
|
||||
}
|
||||
}
|
||||
104
java/impl/org/linphone/core/LinphoneCallStatsImpl.java
Normal file
104
java/impl/org/linphone/core/LinphoneCallStatsImpl.java
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
LinPhoneCallStatsImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
|
||||
class LinphoneCallStatsImpl implements LinphoneCallStats {
|
||||
private int mediaType;
|
||||
private int iceState;
|
||||
private float downloadBandwidth;
|
||||
private float uploadBandwidth;
|
||||
private float senderLossRate;
|
||||
private float receiverLossRate;
|
||||
private float senderInterarrivalJitter;
|
||||
private float receiverInterarrivalJitter;
|
||||
private float roundTripDelay;
|
||||
private long latePacketsCumulativeNumber;
|
||||
private float jitterBufferSize;
|
||||
|
||||
private native int getMediaType(long nativeStatsPtr);
|
||||
private native int getIceState(long nativeStatsPtr);
|
||||
private native float getDownloadBandwidth(long nativeStatsPtr);
|
||||
private native float getUploadBandwidth(long nativeStatsPtr);
|
||||
private native float getSenderLossRate(long nativeStatsPtr);
|
||||
private native float getReceiverLossRate(long nativeStatsPtr);
|
||||
private native float getSenderInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr);
|
||||
private native float getReceiverInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr);
|
||||
private native float getRoundTripDelay(long nativeStatsPtr);
|
||||
private native long getLatePacketsCumulativeNumber(long nativeStatsPtr, long nativeCallPtr);
|
||||
private native float getJitterBufferSize(long nativeStatsPtr);
|
||||
|
||||
protected LinphoneCallStatsImpl(long nativeCallPtr, long nativeStatsPtr) {
|
||||
mediaType = getMediaType(nativeStatsPtr);
|
||||
iceState = getIceState(nativeStatsPtr);
|
||||
downloadBandwidth = getDownloadBandwidth(nativeStatsPtr);
|
||||
uploadBandwidth = getUploadBandwidth(nativeStatsPtr);
|
||||
senderLossRate = getSenderLossRate(nativeStatsPtr);
|
||||
receiverLossRate = getReceiverLossRate(nativeStatsPtr);
|
||||
senderInterarrivalJitter = getSenderInterarrivalJitter(nativeStatsPtr, nativeCallPtr);
|
||||
receiverInterarrivalJitter = getReceiverInterarrivalJitter(nativeStatsPtr, nativeCallPtr);
|
||||
roundTripDelay = getRoundTripDelay(nativeStatsPtr);
|
||||
latePacketsCumulativeNumber = getLatePacketsCumulativeNumber(nativeStatsPtr, nativeCallPtr);
|
||||
jitterBufferSize = getJitterBufferSize(nativeStatsPtr);
|
||||
}
|
||||
|
||||
public MediaType getMediaType() {
|
||||
return MediaType.fromInt(mediaType);
|
||||
}
|
||||
|
||||
public IceState getIceState() {
|
||||
return IceState.fromInt(iceState);
|
||||
}
|
||||
|
||||
public float getDownloadBandwidth() {
|
||||
return downloadBandwidth;
|
||||
}
|
||||
|
||||
public float getUploadBandwidth() {
|
||||
return uploadBandwidth;
|
||||
}
|
||||
|
||||
public float getSenderLossRate() {
|
||||
return senderLossRate;
|
||||
}
|
||||
|
||||
public float getReceiverLossRate() {
|
||||
return receiverLossRate;
|
||||
}
|
||||
|
||||
public float getSenderInterarrivalJitter() {
|
||||
return senderInterarrivalJitter;
|
||||
}
|
||||
|
||||
public float getReceiverInterarrivalJitter() {
|
||||
return receiverInterarrivalJitter;
|
||||
}
|
||||
|
||||
public float getRoundTripDelay() {
|
||||
return roundTripDelay;
|
||||
}
|
||||
|
||||
public long getLatePacketsCumulativeNumber() {
|
||||
return latePacketsCumulativeNumber;
|
||||
}
|
||||
|
||||
public float getJitterBufferSize() {
|
||||
return jitterBufferSize;
|
||||
}
|
||||
}
|
||||
56
java/impl/org/linphone/core/LinphoneChatMessageImpl.java
Normal file
56
java/impl/org/linphone/core/LinphoneChatMessageImpl.java
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package org.linphone.core;
|
||||
|
||||
public class LinphoneChatMessageImpl implements LinphoneChatMessage {
|
||||
protected final long nativePtr;
|
||||
private native void setUserData(long ptr);
|
||||
private native String getMessage(long ptr);
|
||||
private native long getPeerAddress(long ptr);
|
||||
private native String getExternalBodyUrl(long ptr);
|
||||
private native void setExternalBodyUrl(long ptr, String url);
|
||||
private native long getFrom(long ptr);
|
||||
|
||||
protected LinphoneChatMessageImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
setUserData();
|
||||
}
|
||||
|
||||
public long getNativePtr() {
|
||||
return nativePtr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getUserData() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserData() {
|
||||
setUserData(nativePtr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return getMessage(nativePtr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneAddress getPeerAddress() {
|
||||
return new LinphoneAddressImpl(getPeerAddress(nativePtr));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExternalBodyUrl() {
|
||||
return getExternalBodyUrl(nativePtr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExternalBodyUrl(String url) {
|
||||
setExternalBodyUrl(nativePtr, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneAddress getFrom() {
|
||||
return new LinphoneAddressImpl(getFrom(nativePtr));
|
||||
}
|
||||
}
|
||||
52
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
Normal file
52
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
LinphoneChatRoomImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import org.linphone.core.LinphoneChatMessage.StateListener;
|
||||
|
||||
class LinphoneChatRoomImpl implements LinphoneChatRoom {
|
||||
protected final long nativePtr;
|
||||
private native long createLinphoneChatMessage(long ptr, String message);
|
||||
private native long getPeerAddress(long ptr);
|
||||
private native void sendMessage(long ptr, String message);
|
||||
private native void sendMessage2(long ptr, long message, StateListener listener);
|
||||
|
||||
protected LinphoneChatRoomImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
}
|
||||
|
||||
public LinphoneAddress getPeerAddress() {
|
||||
return new LinphoneAddressImpl(getPeerAddress(nativePtr));
|
||||
}
|
||||
|
||||
public void sendMessage(String message) {
|
||||
sendMessage(nativePtr,message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(LinphoneChatMessage message, StateListener listener) {
|
||||
sendMessage2(nativePtr, message.getNativePtr(), listener);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneChatMessage createLinphoneChatMessage(String message) {
|
||||
return new LinphoneChatMessageImpl(createLinphoneChatMessage(nativePtr, message));
|
||||
}
|
||||
}
|
||||
182
java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java
Normal file
182
java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
LinphoneCoreFactoryImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.linphone.mediastream.Version;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
||||
|
||||
private static boolean loadOptionalLibrary(String s) {
|
||||
try {
|
||||
System.loadLibrary(s);
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
Log.w("Unable to load optional library lib", s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static {
|
||||
// FFMPEG (audio/video)
|
||||
loadOptionalLibrary("avutil");
|
||||
loadOptionalLibrary("swscale");
|
||||
loadOptionalLibrary("avcore");
|
||||
|
||||
if (!hasNeonInCpuFeatures()) {
|
||||
boolean noNeonLibrariesLoaded = loadOptionalLibrary("avcodecnoneon");
|
||||
if (!noNeonLibrariesLoaded) {
|
||||
loadOptionalLibrary("avcodec");
|
||||
}
|
||||
} else {
|
||||
loadOptionalLibrary("avcodec");
|
||||
}
|
||||
|
||||
// OPENSSL (cryptography)
|
||||
// lin prefix avoids collision with libs in /system/lib
|
||||
loadOptionalLibrary("lincrypto");
|
||||
loadOptionalLibrary("linssl");
|
||||
|
||||
// Secure RTP and key negotiation
|
||||
loadOptionalLibrary("srtp");
|
||||
loadOptionalLibrary("zrtpcpp"); // GPLv3+
|
||||
|
||||
// Tunnel
|
||||
loadOptionalLibrary("tunnelclient");
|
||||
|
||||
// g729 A implementation
|
||||
loadOptionalLibrary("bcg729");
|
||||
|
||||
//Main library
|
||||
if (!hasNeonInCpuFeatures()) {
|
||||
try {
|
||||
if (!isArmv7() && !Version.isX86()) {
|
||||
System.loadLibrary("linphonearmv5");
|
||||
} else {
|
||||
System.loadLibrary("linphonenoneon");
|
||||
}
|
||||
Log.w("linphone", "No-neon liblinphone loaded");
|
||||
} catch (UnsatisfiedLinkError ule) {
|
||||
Log.w("linphone", "Failed to load no-neon liblinphone, loading neon liblinphone");
|
||||
System.loadLibrary("linphone");
|
||||
}
|
||||
} else {
|
||||
System.loadLibrary("linphone");
|
||||
}
|
||||
|
||||
Version.dumpCapabilities();
|
||||
}
|
||||
@Override
|
||||
public LinphoneAuthInfo createAuthInfo(String username, String password,
|
||||
String realm) {
|
||||
return new LinphoneAuthInfoImpl(username,password,realm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneAddress createLinphoneAddress(String username,
|
||||
String domain, String displayName) {
|
||||
return new LinphoneAddressImpl(username,domain,displayName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneAddress createLinphoneAddress(String identity) {
|
||||
return new LinphoneAddressImpl(identity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneCore createLinphoneCore(LinphoneCoreListener listener,
|
||||
String userConfig, String factoryConfig, Object userdata)
|
||||
throws LinphoneCoreException {
|
||||
try {
|
||||
return new LinphoneCoreImpl(listener,new File(userConfig),new File(factoryConfig),userdata);
|
||||
} catch (IOException e) {
|
||||
throw new LinphoneCoreException("Cannot create LinphoneCore",e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneCore createLinphoneCore(LinphoneCoreListener listener) throws LinphoneCoreException {
|
||||
try {
|
||||
return new LinphoneCoreImpl(listener);
|
||||
} catch (IOException e) {
|
||||
throw new LinphoneCoreException("Cannot create LinphoneCore",e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneProxyConfig createProxyConfig(String identity, String proxy,
|
||||
String route, boolean enableRegister) throws LinphoneCoreException {
|
||||
return new LinphoneProxyConfigImpl(identity,proxy,route,enableRegister);
|
||||
}
|
||||
|
||||
@Override
|
||||
public native void setDebugMode(boolean enable);
|
||||
|
||||
@Override
|
||||
public void setLogHandler(LinphoneLogHandler handler) {
|
||||
//not implemented on Android
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneFriend createLinphoneFriend(String friendUri) {
|
||||
return new LinphoneFriendImpl(friendUri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneFriend createLinphoneFriend() {
|
||||
return createLinphoneFriend(null);
|
||||
}
|
||||
|
||||
public static boolean hasNeonInCpuFeatures()
|
||||
{
|
||||
ProcessBuilder cmd;
|
||||
boolean result = false;
|
||||
|
||||
try {
|
||||
String[] args = {"/system/bin/cat", "/proc/cpuinfo"};
|
||||
cmd = new ProcessBuilder(args);
|
||||
|
||||
Process process = cmd.start();
|
||||
InputStream in = process.getInputStream();
|
||||
byte[] re = new byte[1024];
|
||||
while(in.read(re) != -1){
|
||||
String line = new String(re);
|
||||
if (line.contains("Features")) {
|
||||
result = line.contains("neon");
|
||||
break;
|
||||
}
|
||||
}
|
||||
in.close();
|
||||
} catch(IOException ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static boolean isArmv7()
|
||||
{
|
||||
return System.getProperty("os.arch").contains("armv7");
|
||||
}
|
||||
}
|
||||
785
java/impl/org/linphone/core/LinphoneCoreImpl.java
Normal file
785
java/impl/org/linphone/core/LinphoneCoreImpl.java
Normal file
|
|
@ -0,0 +1,785 @@
|
|||
/*
|
||||
LinphoneCoreImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
class LinphoneCoreImpl implements LinphoneCore {
|
||||
|
||||
private final LinphoneCoreListener mListener; //to make sure to keep a reference on this object
|
||||
private long nativePtr = 0;
|
||||
private native long newLinphoneCore(LinphoneCoreListener listener,String userConfig,String factoryConfig,Object userdata);
|
||||
private native void iterate(long nativePtr);
|
||||
private native long getDefaultProxyConfig(long nativePtr);
|
||||
|
||||
private native void setDefaultProxyConfig(long nativePtr,long proxyCfgNativePtr);
|
||||
private native int addProxyConfig(LinphoneProxyConfig jprtoxyCfg,long nativePtr,long proxyCfgNativePtr);
|
||||
private native void clearAuthInfos(long nativePtr);
|
||||
|
||||
private native void clearProxyConfigs(long nativePtr);
|
||||
private native void addAuthInfo(long nativePtr,long authInfoNativePtr);
|
||||
private native Object invite(long nativePtr,String uri);
|
||||
private native void terminateCall(long nativePtr, long call);
|
||||
private native long getRemoteAddress(long nativePtr);
|
||||
private native boolean isInCall(long nativePtr);
|
||||
private native boolean isInComingInvitePending(long nativePtr);
|
||||
private native void acceptCall(long nativePtr, long call);
|
||||
private native long getCallLog(long nativePtr,int position);
|
||||
private native int getNumberOfCallLogs(long nativePtr);
|
||||
private native void delete(long nativePtr);
|
||||
private native void setNetworkStateReachable(long nativePtr,boolean isReachable);
|
||||
private native boolean isNetworkStateReachable(long nativePtr);
|
||||
private native void setPlaybackGain(long nativeptr, float gain);
|
||||
private native float getPlaybackGain(long nativeptr);
|
||||
private native void muteMic(long nativePtr,boolean isMuted);
|
||||
private native long interpretUrl(long nativePtr,String destination);
|
||||
private native Object inviteAddress(long nativePtr,long to);
|
||||
private native Object inviteAddressWithParams(long nativePtrLc,long to, long nativePtrParam);
|
||||
private native void sendDtmf(long nativePtr,char dtmf);
|
||||
private native void clearCallLogs(long nativePtr);
|
||||
private native boolean isMicMuted(long nativePtr);
|
||||
private native long findPayloadType(long nativePtr, String mime, int clockRate, int channels);
|
||||
private native int enablePayloadType(long nativePtr, long payloadType, boolean enable);
|
||||
private native void enableEchoCancellation(long nativePtr,boolean enable);
|
||||
private native boolean isEchoCancellationEnabled(long nativePtr);
|
||||
private native Object getCurrentCall(long nativePtr) ;
|
||||
private native void playDtmf(long nativePtr,char dtmf,int duration);
|
||||
private native void stopDtmf(long nativePtr);
|
||||
private native void setVideoWindowId(long nativePtr, Object wid);
|
||||
private native void setPreviewWindowId(long nativePtr, Object wid);
|
||||
private native void setDeviceRotation(long nativePtr, int rotation);
|
||||
private native void addFriend(long nativePtr,long friend);
|
||||
private native void setPresenceInfo(long nativePtr,int minute_away, String alternative_contact,int status);
|
||||
private native long createChatRoom(long nativePtr,String to);
|
||||
private native void enableVideo(long nativePtr,boolean vcap_enabled,boolean display_enabled);
|
||||
private native boolean isVideoEnabled(long nativePtr);
|
||||
private native void setFirewallPolicy(long nativePtr, int enum_value);
|
||||
private native int getFirewallPolicy(long nativePtr);
|
||||
private native void setStunServer(long nativePtr, String stun_server);
|
||||
private native String getStunServer(long nativePtr);
|
||||
private native long createDefaultCallParams(long nativePtr);
|
||||
private native int updateCall(long ptrLc, long ptrCall, long ptrParams);
|
||||
private native void setUploadBandwidth(long nativePtr, int bw);
|
||||
private native void setDownloadBandwidth(long nativePtr, int bw);
|
||||
private native void setPreferredVideoSize(long nativePtr, int width, int heigth);
|
||||
private native int[] getPreferredVideoSize(long nativePtr);
|
||||
private native void setRing(long nativePtr, String path);
|
||||
private native String getRing(long nativePtr);
|
||||
private native void setRootCA(long nativePtr, String path);
|
||||
private native long[] listVideoPayloadTypes(long nativePtr);
|
||||
private native long[] getProxyConfigList(long nativePtr);
|
||||
private native long[] listAudioPayloadTypes(long nativePtr);
|
||||
private native void enableKeepAlive(long nativePtr,boolean enable);
|
||||
private native boolean isKeepAliveEnabled(long nativePtr);
|
||||
private native int startEchoCalibration(long nativePtr,Object data);
|
||||
private native int getSignalingTransportPort(long nativePtr, int code);
|
||||
private native void setSignalingTransportPorts(long nativePtr, int udp, int tcp, int tls);
|
||||
private native void enableIpv6(long nativePtr,boolean enable);
|
||||
private native int pauseCall(long nativePtr, long callPtr);
|
||||
private native int pauseAllCalls(long nativePtr);
|
||||
private native int resumeCall(long nativePtr, long callPtr);
|
||||
private native void setUploadPtime(long nativePtr, int ptime);
|
||||
private native void setDownloadPtime(long nativePtr, int ptime);
|
||||
private native void setZrtpSecretsCache(long nativePtr, String file);
|
||||
private native void enableEchoLimiter(long nativePtr2, boolean val);
|
||||
private native int setVideoDevice(long nativePtr2, int id);
|
||||
private native int getVideoDevice(long nativePtr2);
|
||||
private native int getMediaEncryption(long nativePtr);
|
||||
private native void setMediaEncryption(long nativePtr, int menc);
|
||||
private native boolean isMediaEncryptionMandatory(long nativePtr);
|
||||
private native void setMediaEncryptionMandatory(long nativePtr, boolean yesno);
|
||||
private native void removeCallLog(long nativePtr, long callLogPtr);
|
||||
private native int getMissedCallsCount(long nativePtr);
|
||||
private native void resetMissedCallsCount(long nativePtr);
|
||||
private native String getVersion(long nativePtr);
|
||||
private native void setAudioPort(long nativePtr, int port);
|
||||
private native void setVideoPort(long nativePtr, int port);
|
||||
private native void setAudioPortRange(long nativePtr, int minPort, int maxPort);
|
||||
private native void setVideoPortRange(long nativePtr, int minPort, int maxPort);
|
||||
private native void setIncomingTimeout(long nativePtr, int timeout);
|
||||
|
||||
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
|
||||
mListener=listener;
|
||||
nativePtr = newLinphoneCore(listener,userConfig.getCanonicalPath(),factoryConfig.getCanonicalPath(),userdata);
|
||||
}
|
||||
LinphoneCoreImpl(LinphoneCoreListener listener) throws IOException {
|
||||
mListener=listener;
|
||||
nativePtr = newLinphoneCore(listener,null,null,null);
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
|
||||
}
|
||||
|
||||
public synchronized void addAuthInfo(LinphoneAuthInfo info) {
|
||||
isValid();
|
||||
addAuthInfo(nativePtr,((LinphoneAuthInfoImpl)info).nativePtr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public synchronized LinphoneProxyConfig getDefaultProxyConfig() {
|
||||
isValid();
|
||||
long lNativePtr = getDefaultProxyConfig(nativePtr);
|
||||
if (lNativePtr!=0) {
|
||||
return new LinphoneProxyConfigImpl(lNativePtr);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized LinphoneCall invite(String uri) {
|
||||
isValid();
|
||||
return (LinphoneCall)invite(nativePtr,uri);
|
||||
}
|
||||
|
||||
public synchronized void iterate() {
|
||||
isValid();
|
||||
iterate(nativePtr);
|
||||
}
|
||||
|
||||
public synchronized void setDefaultProxyConfig(LinphoneProxyConfig proxyCfg) {
|
||||
isValid();
|
||||
setDefaultProxyConfig(nativePtr,((LinphoneProxyConfigImpl)proxyCfg).nativePtr);
|
||||
}
|
||||
public synchronized void addProxyConfig(LinphoneProxyConfig proxyCfg) throws LinphoneCoreException{
|
||||
isValid();
|
||||
if (addProxyConfig(proxyCfg,nativePtr,((LinphoneProxyConfigImpl)proxyCfg).nativePtr) !=0) {
|
||||
throw new LinphoneCoreException("bad proxy config");
|
||||
}
|
||||
}
|
||||
public synchronized void clearAuthInfos() {
|
||||
isValid();
|
||||
clearAuthInfos(nativePtr);
|
||||
|
||||
}
|
||||
public synchronized void clearProxyConfigs() {
|
||||
isValid();
|
||||
clearProxyConfigs(nativePtr);
|
||||
}
|
||||
public synchronized void terminateCall(LinphoneCall aCall) {
|
||||
isValid();
|
||||
if (aCall!=null)terminateCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr);
|
||||
}
|
||||
public synchronized LinphoneAddress getRemoteAddress() {
|
||||
isValid();
|
||||
long ptr = getRemoteAddress(nativePtr);
|
||||
if (ptr==0) {
|
||||
return null;
|
||||
} else {
|
||||
return new LinphoneAddressImpl(ptr);
|
||||
}
|
||||
}
|
||||
public synchronized boolean isIncall() {
|
||||
isValid();
|
||||
return isInCall(nativePtr);
|
||||
}
|
||||
public synchronized boolean isInComingInvitePending() {
|
||||
isValid();
|
||||
return isInComingInvitePending(nativePtr);
|
||||
}
|
||||
public synchronized void acceptCall(LinphoneCall aCall) {
|
||||
isValid();
|
||||
acceptCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr);
|
||||
|
||||
}
|
||||
public synchronized LinphoneCallLog[] getCallLogs() {
|
||||
isValid();
|
||||
LinphoneCallLog[] logs = new LinphoneCallLog[getNumberOfCallLogs(nativePtr)];
|
||||
for (int i=0;i < getNumberOfCallLogs(nativePtr);i++) {
|
||||
logs[i] = new LinphoneCallLogImpl(getCallLog(nativePtr, i));
|
||||
}
|
||||
return logs;
|
||||
}
|
||||
public synchronized void destroy() {
|
||||
isValid();
|
||||
delete(nativePtr);
|
||||
nativePtr = 0;
|
||||
}
|
||||
|
||||
private void isValid() {
|
||||
if (nativePtr == 0) {
|
||||
throw new RuntimeException("object already destroyed");
|
||||
}
|
||||
}
|
||||
public synchronized void setNetworkReachable(boolean isReachable) {
|
||||
setNetworkStateReachable(nativePtr,isReachable);
|
||||
}
|
||||
public synchronized void setPlaybackGain(float gain) {
|
||||
setPlaybackGain(nativePtr,gain);
|
||||
|
||||
}
|
||||
public synchronized float getPlaybackGain() {
|
||||
return getPlaybackGain(nativePtr);
|
||||
}
|
||||
public synchronized void muteMic(boolean isMuted) {
|
||||
muteMic(nativePtr,isMuted);
|
||||
}
|
||||
public synchronized LinphoneAddress interpretUrl(String destination) throws LinphoneCoreException {
|
||||
long lAddress = interpretUrl(nativePtr,destination);
|
||||
if (lAddress != 0) {
|
||||
return new LinphoneAddressImpl(lAddress,true);
|
||||
} else {
|
||||
throw new LinphoneCoreException("Cannot interpret ["+destination+"]");
|
||||
}
|
||||
}
|
||||
public synchronized LinphoneCall invite(LinphoneAddress to) throws LinphoneCoreException {
|
||||
LinphoneCall call = (LinphoneCall)inviteAddress(nativePtr,((LinphoneAddressImpl)to).nativePtr);
|
||||
if (call!=null) {
|
||||
return call;
|
||||
} else {
|
||||
throw new LinphoneCoreException("Unable to invite address " + to.asString());
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void sendDtmf(char number) {
|
||||
sendDtmf(nativePtr,number);
|
||||
}
|
||||
public synchronized void clearCallLogs() {
|
||||
clearCallLogs(nativePtr);
|
||||
}
|
||||
public synchronized boolean isMicMuted() {
|
||||
return isMicMuted(nativePtr);
|
||||
}
|
||||
public synchronized PayloadType findPayloadType(String mime, int clockRate, int channels) {
|
||||
isValid();
|
||||
long playLoadType = findPayloadType(nativePtr, mime, clockRate, channels);
|
||||
if (playLoadType == 0) {
|
||||
return null;
|
||||
} else {
|
||||
return new PayloadTypeImpl(playLoadType);
|
||||
}
|
||||
}
|
||||
public synchronized void enablePayloadType(PayloadType pt, boolean enable)
|
||||
throws LinphoneCoreException {
|
||||
isValid();
|
||||
if (enablePayloadType(nativePtr,((PayloadTypeImpl)pt).nativePtr,enable) != 0) {
|
||||
throw new LinphoneCoreException("cannot enable payload type ["+pt+"]");
|
||||
}
|
||||
|
||||
}
|
||||
public synchronized void enableEchoCancellation(boolean enable) {
|
||||
isValid();
|
||||
enableEchoCancellation(nativePtr, enable);
|
||||
}
|
||||
public synchronized boolean isEchoCancellationEnabled() {
|
||||
isValid();
|
||||
return isEchoCancellationEnabled(nativePtr);
|
||||
|
||||
}
|
||||
|
||||
public synchronized LinphoneCall getCurrentCall() {
|
||||
isValid();
|
||||
return (LinphoneCall)getCurrentCall(nativePtr);
|
||||
}
|
||||
|
||||
public int getPlayLevel() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
public void setPlayLevel(int level) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
public void enableSpeaker(boolean value) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
public boolean isSpeakerEnabled() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
public synchronized void playDtmf(char number, int duration) {
|
||||
playDtmf(nativePtr,number, duration);
|
||||
|
||||
}
|
||||
public synchronized void stopDtmf() {
|
||||
stopDtmf(nativePtr);
|
||||
}
|
||||
|
||||
public synchronized void addFriend(LinphoneFriend lf) throws LinphoneCoreException {
|
||||
addFriend(nativePtr,((LinphoneFriendImpl)lf).nativePtr);
|
||||
|
||||
}
|
||||
public synchronized void setPresenceInfo(int minute_away, String alternative_contact,
|
||||
OnlineStatus status) {
|
||||
setPresenceInfo(nativePtr,minute_away,alternative_contact,status.mValue);
|
||||
|
||||
}
|
||||
public synchronized LinphoneChatRoom createChatRoom(String to) {
|
||||
return new LinphoneChatRoomImpl(createChatRoom(nativePtr,to));
|
||||
}
|
||||
public synchronized void setPreviewWindow(Object w) {
|
||||
setPreviewWindowId(nativePtr,w);
|
||||
}
|
||||
public synchronized void setVideoWindow(Object w) {
|
||||
setVideoWindowId(nativePtr, w);
|
||||
}
|
||||
public synchronized void setDeviceRotation(int rotation) {
|
||||
setDeviceRotation(nativePtr, rotation);
|
||||
}
|
||||
|
||||
public synchronized void enableVideo(boolean vcap_enabled, boolean display_enabled) {
|
||||
enableVideo(nativePtr,vcap_enabled, display_enabled);
|
||||
}
|
||||
public synchronized boolean isVideoEnabled() {
|
||||
return isVideoEnabled(nativePtr);
|
||||
}
|
||||
public synchronized FirewallPolicy getFirewallPolicy() {
|
||||
return FirewallPolicy.fromInt(getFirewallPolicy(nativePtr));
|
||||
}
|
||||
public synchronized String getStunServer() {
|
||||
return getStunServer(nativePtr);
|
||||
}
|
||||
public synchronized void setFirewallPolicy(FirewallPolicy pol) {
|
||||
setFirewallPolicy(nativePtr,pol.value());
|
||||
}
|
||||
public synchronized void setStunServer(String stunServer) {
|
||||
setStunServer(nativePtr,stunServer);
|
||||
}
|
||||
|
||||
public synchronized LinphoneCallParams createDefaultCallParameters() {
|
||||
return new LinphoneCallParamsImpl(createDefaultCallParams(nativePtr));
|
||||
}
|
||||
|
||||
public synchronized LinphoneCall inviteAddressWithParams(LinphoneAddress to, LinphoneCallParams params) throws LinphoneCoreException {
|
||||
long ptrDestination = ((LinphoneAddressImpl)to).nativePtr;
|
||||
long ptrParams =((LinphoneCallParamsImpl)params).nativePtr;
|
||||
|
||||
LinphoneCall call = (LinphoneCall)inviteAddressWithParams(nativePtr, ptrDestination, ptrParams);
|
||||
if (call!=null) {
|
||||
return call;
|
||||
} else {
|
||||
throw new LinphoneCoreException("Unable to invite with params " + to.asString());
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized int updateCall(LinphoneCall call, LinphoneCallParams params) {
|
||||
long ptrCall = ((LinphoneCallImpl) call).nativePtr;
|
||||
long ptrParams = params!=null ? ((LinphoneCallParamsImpl)params).nativePtr : 0;
|
||||
|
||||
return updateCall(nativePtr, ptrCall, ptrParams);
|
||||
}
|
||||
public synchronized void setUploadBandwidth(int bw) {
|
||||
setUploadBandwidth(nativePtr, bw);
|
||||
}
|
||||
|
||||
public synchronized void setDownloadBandwidth(int bw) {
|
||||
setDownloadBandwidth(nativePtr, bw);
|
||||
}
|
||||
|
||||
public synchronized void setPreferredVideoSize(VideoSize vSize) {
|
||||
setPreferredVideoSize(nativePtr, vSize.width, vSize.height);
|
||||
}
|
||||
|
||||
public synchronized VideoSize getPreferredVideoSize() {
|
||||
int[] nativeSize = getPreferredVideoSize(nativePtr);
|
||||
|
||||
VideoSize vSize = new VideoSize();
|
||||
vSize.width = nativeSize[0];
|
||||
vSize.height = nativeSize[1];
|
||||
return vSize;
|
||||
}
|
||||
public synchronized void setRing(String path) {
|
||||
setRing(nativePtr, path);
|
||||
}
|
||||
public synchronized String getRing() {
|
||||
return getRing(nativePtr);
|
||||
}
|
||||
|
||||
public synchronized void setRootCA(String path) {
|
||||
setRootCA(nativePtr, path);
|
||||
}
|
||||
|
||||
public synchronized LinphoneProxyConfig[] getProxyConfigList() {
|
||||
long[] typesPtr = getProxyConfigList(nativePtr);
|
||||
if (typesPtr == null) return null;
|
||||
|
||||
LinphoneProxyConfig[] proxies = new LinphoneProxyConfig[typesPtr.length];
|
||||
|
||||
for (int i=0; i < proxies.length; i++) {
|
||||
proxies[i] = new LinphoneProxyConfigImpl(typesPtr[i]);
|
||||
}
|
||||
|
||||
return proxies;
|
||||
}
|
||||
|
||||
public synchronized PayloadType[] getVideoCodecs() {
|
||||
long[] typesPtr = listVideoPayloadTypes(nativePtr);
|
||||
if (typesPtr == null) return null;
|
||||
|
||||
PayloadType[] codecs = new PayloadType[typesPtr.length];
|
||||
|
||||
for (int i=0; i < codecs.length; i++) {
|
||||
codecs[i] = new PayloadTypeImpl(typesPtr[i]);
|
||||
}
|
||||
|
||||
return codecs;
|
||||
}
|
||||
public synchronized PayloadType[] getAudioCodecs() {
|
||||
long[] typesPtr = listAudioPayloadTypes(nativePtr);
|
||||
if (typesPtr == null) return null;
|
||||
|
||||
PayloadType[] codecs = new PayloadType[typesPtr.length];
|
||||
|
||||
for (int i=0; i < codecs.length; i++) {
|
||||
codecs[i] = new PayloadTypeImpl(typesPtr[i]);
|
||||
}
|
||||
|
||||
return codecs;
|
||||
}
|
||||
public synchronized boolean isNetworkReachable() {
|
||||
return isNetworkStateReachable(nativePtr);
|
||||
}
|
||||
|
||||
public synchronized void enableKeepAlive(boolean enable) {
|
||||
enableKeepAlive(nativePtr,enable);
|
||||
|
||||
}
|
||||
public synchronized boolean isKeepAliveEnabled() {
|
||||
return isKeepAliveEnabled(nativePtr);
|
||||
}
|
||||
public synchronized void startEchoCalibration(Object data) throws LinphoneCoreException {
|
||||
startEchoCalibration(nativePtr, data);
|
||||
}
|
||||
|
||||
public synchronized Transports getSignalingTransportPorts() {
|
||||
Transports transports = new Transports();
|
||||
transports.udp = getSignalingTransportPort(nativePtr, 0);
|
||||
transports.tcp = getSignalingTransportPort(nativePtr, 1);
|
||||
transports.tls = getSignalingTransportPort(nativePtr, 3);
|
||||
// See C struct LCSipTransports in linphonecore.h
|
||||
// Code is the index in the structure
|
||||
return transports;
|
||||
}
|
||||
public synchronized void setSignalingTransportPorts(Transports transports) {
|
||||
setSignalingTransportPorts(nativePtr, transports.udp, transports.tcp, transports.tls);
|
||||
}
|
||||
|
||||
public synchronized void enableIpv6(boolean enable) {
|
||||
enableIpv6(nativePtr,enable);
|
||||
}
|
||||
public synchronized void adjustSoftwareVolume(int i) {
|
||||
//deprecated, does the same as setPlaybackGain().
|
||||
}
|
||||
|
||||
public synchronized boolean pauseCall(LinphoneCall call) {
|
||||
return 0 == pauseCall(nativePtr, ((LinphoneCallImpl) call).nativePtr);
|
||||
}
|
||||
public synchronized boolean resumeCall(LinphoneCall call) {
|
||||
return 0 == resumeCall(nativePtr, ((LinphoneCallImpl) call).nativePtr);
|
||||
}
|
||||
public synchronized boolean pauseAllCalls() {
|
||||
return 0 == pauseAllCalls(nativePtr);
|
||||
}
|
||||
public synchronized void setDownloadPtime(int ptime) {
|
||||
setDownloadPtime(nativePtr,ptime);
|
||||
|
||||
}
|
||||
public synchronized void setUploadPtime(int ptime) {
|
||||
setUploadPtime(nativePtr,ptime);
|
||||
}
|
||||
|
||||
public synchronized void setZrtpSecretsCache(String file) {
|
||||
setZrtpSecretsCache(nativePtr,file);
|
||||
}
|
||||
public synchronized void enableEchoLimiter(boolean val) {
|
||||
enableEchoLimiter(nativePtr,val);
|
||||
}
|
||||
public void setVideoDevice(int id) {
|
||||
Log.i("Setting camera id :", id);
|
||||
if (setVideoDevice(nativePtr, id) != 0) {
|
||||
Log.e("Failed to set video device to id:", id);
|
||||
}
|
||||
}
|
||||
public int getVideoDevice() {
|
||||
return getVideoDevice(nativePtr);
|
||||
}
|
||||
|
||||
|
||||
private native void leaveConference(long nativePtr);
|
||||
public synchronized void leaveConference() {
|
||||
leaveConference(nativePtr);
|
||||
}
|
||||
|
||||
private native boolean enterConference(long nativePtr);
|
||||
public synchronized boolean enterConference() {
|
||||
return enterConference(nativePtr);
|
||||
}
|
||||
|
||||
private native boolean isInConference(long nativePtr);
|
||||
public synchronized boolean isInConference() {
|
||||
return isInConference(nativePtr);
|
||||
}
|
||||
|
||||
private native void terminateConference(long nativePtr);
|
||||
public synchronized void terminateConference() {
|
||||
terminateConference(nativePtr);
|
||||
}
|
||||
private native int getConferenceSize(long nativePtr);
|
||||
public synchronized int getConferenceSize() {
|
||||
return getConferenceSize(nativePtr);
|
||||
}
|
||||
private native int getCallsNb(long nativePtr);
|
||||
public synchronized int getCallsNb() {
|
||||
return getCallsNb(nativePtr);
|
||||
}
|
||||
private native void terminateAllCalls(long nativePtr);
|
||||
public synchronized void terminateAllCalls() {
|
||||
terminateAllCalls(nativePtr);
|
||||
}
|
||||
private native Object getCall(long nativePtr, int position);
|
||||
public synchronized LinphoneCall[] getCalls() {
|
||||
int size = getCallsNb(nativePtr);
|
||||
LinphoneCall[] calls = new LinphoneCall[size];
|
||||
for (int i=0; i < size; i++) {
|
||||
calls[i]=((LinphoneCall)getCall(nativePtr, i));
|
||||
}
|
||||
return calls;
|
||||
}
|
||||
private native void addAllToConference(long nativePtr);
|
||||
public synchronized void addAllToConference() {
|
||||
addAllToConference(nativePtr);
|
||||
|
||||
}
|
||||
private native void addToConference(long nativePtr, long nativePtrLcall);
|
||||
public synchronized void addToConference(LinphoneCall call) {
|
||||
addToConference(nativePtr, getCallPtr(call));
|
||||
|
||||
}
|
||||
private native void removeFromConference(long nativePtr, long nativeCallPtr);
|
||||
public synchronized void removeFromConference(LinphoneCall call) {
|
||||
removeFromConference(nativePtr,getCallPtr(call));
|
||||
}
|
||||
|
||||
private long getCallPtr(LinphoneCall call) {
|
||||
return ((LinphoneCallImpl)call).nativePtr;
|
||||
}
|
||||
|
||||
private long getCallParamsPtr(LinphoneCallParams callParams) {
|
||||
return ((LinphoneCallParamsImpl)callParams).nativePtr;
|
||||
}
|
||||
|
||||
private native int transferCall(long nativePtr, long callPtr, String referTo);
|
||||
public synchronized void transferCall(LinphoneCall call, String referTo) {
|
||||
transferCall(nativePtr, getCallPtr(call), referTo);
|
||||
}
|
||||
|
||||
private native int transferCallToAnother(long nativePtr, long callPtr, long destPtr);
|
||||
public synchronized void transferCallToAnother(LinphoneCall call, LinphoneCall dest) {
|
||||
transferCallToAnother(nativePtr, getCallPtr(call), getCallPtr(dest));
|
||||
}
|
||||
|
||||
private native Object findCallFromUri(long nativePtr, String uri);
|
||||
@Override
|
||||
public synchronized LinphoneCall findCallFromUri(String uri) {
|
||||
return (LinphoneCall) findCallFromUri(nativePtr, uri);
|
||||
}
|
||||
|
||||
public synchronized MediaEncryption getMediaEncryption() {
|
||||
return MediaEncryption.fromInt(getMediaEncryption(nativePtr));
|
||||
}
|
||||
public synchronized boolean isMediaEncryptionMandatory() {
|
||||
return isMediaEncryptionMandatory(nativePtr);
|
||||
}
|
||||
public synchronized void setMediaEncryption(MediaEncryption menc) {
|
||||
setMediaEncryption(nativePtr, menc.mValue);
|
||||
}
|
||||
public synchronized void setMediaEncryptionMandatory(boolean yesno) {
|
||||
setMediaEncryptionMandatory(nativePtr, yesno);
|
||||
}
|
||||
|
||||
private native int getMaxCalls(long nativePtr);
|
||||
public synchronized int getMaxCalls() {
|
||||
return getMaxCalls(nativePtr);
|
||||
}
|
||||
@Override
|
||||
public boolean isMyself(String uri) {
|
||||
LinphoneProxyConfig lpc = getDefaultProxyConfig();
|
||||
if (lpc == null) return false;
|
||||
return uri.equals(lpc.getIdentity());
|
||||
}
|
||||
|
||||
private native boolean soundResourcesLocked(long nativePtr);
|
||||
public synchronized boolean soundResourcesLocked() {
|
||||
return soundResourcesLocked(nativePtr);
|
||||
}
|
||||
|
||||
private native void setMaxCalls(long nativePtr, int max);
|
||||
@Override
|
||||
public synchronized void setMaxCalls(int max) {
|
||||
setMaxCalls(nativePtr, max);
|
||||
}
|
||||
private native boolean isEchoLimiterEnabled(long nativePtr);
|
||||
@Override
|
||||
public synchronized boolean isEchoLimiterEnabled() {
|
||||
return isEchoLimiterEnabled(nativePtr);
|
||||
}
|
||||
private native boolean mediaEncryptionSupported(long nativePtr, int menc);
|
||||
@Override
|
||||
public synchronized boolean mediaEncryptionSupported(MediaEncryption menc) {
|
||||
return mediaEncryptionSupported(nativePtr,menc.mValue);
|
||||
}
|
||||
|
||||
private native void setPlayFile(long nativePtr, String path);
|
||||
|
||||
@Override
|
||||
public synchronized void setPlayFile(String path) {
|
||||
setPlayFile(nativePtr, path);
|
||||
}
|
||||
|
||||
|
||||
private native void tunnelAddServerAndMirror(long nativePtr, String host, int port, int mirror, int ms);
|
||||
@Override
|
||||
public synchronized void tunnelAddServerAndMirror(String host, int port, int mirror, int ms) {
|
||||
tunnelAddServerAndMirror(nativePtr, host, port, mirror, ms);
|
||||
}
|
||||
|
||||
private native void tunnelAutoDetect(long nativePtr);
|
||||
@Override
|
||||
public synchronized void tunnelAutoDetect() {
|
||||
tunnelAutoDetect(nativePtr);
|
||||
}
|
||||
|
||||
private native void tunnelCleanServers(long nativePtr);
|
||||
@Override
|
||||
public synchronized void tunnelCleanServers() {
|
||||
tunnelCleanServers(nativePtr);
|
||||
}
|
||||
|
||||
private native void tunnelEnable(long nativePtr, boolean enable);
|
||||
@Override
|
||||
public synchronized void tunnelEnable(boolean enable) {
|
||||
tunnelEnable(nativePtr, enable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public native boolean isTunnelAvailable();
|
||||
|
||||
private native void acceptCallWithParams(long nativePtr, long aCall,
|
||||
long params);
|
||||
@Override
|
||||
public synchronized void acceptCallWithParams(LinphoneCall aCall,
|
||||
LinphoneCallParams params) throws LinphoneCoreException {
|
||||
acceptCallWithParams(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
|
||||
}
|
||||
|
||||
private native void acceptCallUpdate(long nativePtr, long aCall, long params);
|
||||
@Override
|
||||
public synchronized void acceptCallUpdate(LinphoneCall aCall, LinphoneCallParams params)
|
||||
throws LinphoneCoreException {
|
||||
acceptCallUpdate(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
|
||||
}
|
||||
|
||||
private native void deferCallUpdate(long nativePtr, long aCall);
|
||||
@Override
|
||||
public synchronized void deferCallUpdate(LinphoneCall aCall)
|
||||
throws LinphoneCoreException {
|
||||
deferCallUpdate(nativePtr, getCallPtr(aCall));
|
||||
}
|
||||
|
||||
private native void setVideoPolicy(long nativePtr, boolean autoInitiate, boolean autoAccept);
|
||||
public synchronized void setVideoPolicy(boolean autoInitiate, boolean autoAccept) {
|
||||
setVideoPolicy(nativePtr, autoInitiate, autoAccept);
|
||||
}
|
||||
private native void setUserAgent(long nativePtr, String name, String version);
|
||||
@Override
|
||||
public void setUserAgent(String name, String version) {
|
||||
setUserAgent(nativePtr,name,version);
|
||||
}
|
||||
|
||||
private native void setCpuCountNative(int count);
|
||||
public void setCpuCount(int count)
|
||||
{
|
||||
setCpuCountNative(count);
|
||||
}
|
||||
|
||||
public int getMissedCallsCount() {
|
||||
return getMissedCallsCount(nativePtr);
|
||||
}
|
||||
|
||||
public void removeCallLog(LinphoneCallLog log) {
|
||||
removeCallLog(nativePtr, ((LinphoneCallLogImpl) log).getNativePtr());
|
||||
}
|
||||
|
||||
public void resetMissedCallsCount() {
|
||||
resetMissedCallsCount(nativePtr);
|
||||
}
|
||||
|
||||
private native void tunnelSetHttpProxy(long nativePtr, String proxy_host, int port,
|
||||
String username, String password);
|
||||
@Override
|
||||
public void tunnelSetHttpProxy(String proxy_host, int port,
|
||||
String username, String password) {
|
||||
tunnelSetHttpProxy(nativePtr, proxy_host, port, username, password);
|
||||
}
|
||||
|
||||
private native void refreshRegisters(long nativePtr);
|
||||
public void refreshRegisters() {
|
||||
refreshRegisters(nativePtr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return getVersion(nativePtr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayloadType findPayloadType(String mime, int clockRate) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private native void removeFriend(long ptr, long lf);
|
||||
@Override
|
||||
public void removeFriend(LinphoneFriend lf) {
|
||||
removeFriend(nativePtr, lf.getNativePtr());
|
||||
}
|
||||
|
||||
private native long getFriendByAddress(long ptr, String sipUri);
|
||||
@Override
|
||||
public LinphoneFriend findFriendByAddress(String sipUri) {
|
||||
long ptr = getFriendByAddress(nativePtr, sipUri);
|
||||
if (ptr == 0) {
|
||||
return null;
|
||||
}
|
||||
return new LinphoneFriendImpl(ptr);
|
||||
}
|
||||
|
||||
public void setAudioPort(int port) {
|
||||
setAudioPort(nativePtr, port);
|
||||
}
|
||||
|
||||
public void setVideoPort(int port) {
|
||||
setVideoPort(nativePtr, port);
|
||||
}
|
||||
|
||||
public void setAudioPortRange(int minPort, int maxPort) {
|
||||
setAudioPortRange(nativePtr, minPort, maxPort);
|
||||
}
|
||||
|
||||
public void setVideoPortRange(int minPort, int maxPort) {
|
||||
setVideoPortRange(nativePtr, minPort, maxPort);
|
||||
}
|
||||
|
||||
public void setIncomingTimeout(int timeout) {
|
||||
setIncomingTimeout(nativePtr, timeout);
|
||||
}
|
||||
}
|
||||
81
java/impl/org/linphone/core/LinphoneFriendImpl.java
Normal file
81
java/impl/org/linphone/core/LinphoneFriendImpl.java
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
LinphoneFriendImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
class LinphoneFriendImpl implements LinphoneFriend, Serializable {
|
||||
protected final long nativePtr;
|
||||
private native long newLinphoneFriend(String friendUri);
|
||||
private native void setAddress(long nativePtr,long friend);
|
||||
private native long getAddress(long nativePtr);
|
||||
private native void setIncSubscribePolicy(long nativePtr,int enumValue);
|
||||
private native int getIncSubscribePolicy(long nativePtr);
|
||||
private native void enableSubscribes(long nativePtr,boolean value);
|
||||
private native boolean isSubscribesEnabled(long nativePtr);
|
||||
private native int getStatus(long nativePtr);
|
||||
private native void edit(long nativePtr);
|
||||
private native void done(long nativePtr);
|
||||
|
||||
private native void delete(long ptr);
|
||||
boolean ownPtr = false;
|
||||
protected LinphoneFriendImpl() {
|
||||
nativePtr = newLinphoneFriend(null);
|
||||
}
|
||||
protected LinphoneFriendImpl(String friendUri) {
|
||||
nativePtr = newLinphoneFriend(friendUri);
|
||||
}
|
||||
protected LinphoneFriendImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
ownPtr=false;
|
||||
}
|
||||
protected void finalize() throws Throwable {
|
||||
if (ownPtr) delete(nativePtr);
|
||||
}
|
||||
public void setAddress(LinphoneAddress anAddress) {
|
||||
this.setAddress(nativePtr, ((LinphoneAddressImpl)anAddress).nativePtr);
|
||||
}
|
||||
public LinphoneAddress getAddress() {
|
||||
return new LinphoneAddressImpl(getAddress(nativePtr));
|
||||
}
|
||||
public void setIncSubscribePolicy(SubscribePolicy policy) {
|
||||
setIncSubscribePolicy(nativePtr,policy.mValue);
|
||||
}
|
||||
public SubscribePolicy getIncSubscribePolicy() {
|
||||
return SubscribePolicy.fromInt(getIncSubscribePolicy(nativePtr)) ;
|
||||
}
|
||||
public void enableSubscribes(boolean enable) {
|
||||
enableSubscribes(nativePtr, enable);
|
||||
}
|
||||
public boolean isSubscribesEnabled() {
|
||||
return isSubscribesEnabled(nativePtr);
|
||||
}
|
||||
public OnlineStatus getStatus() {
|
||||
return OnlineStatus.fromInt(getStatus(nativePtr));
|
||||
}
|
||||
public void edit() {
|
||||
edit(nativePtr);
|
||||
}
|
||||
public void done() {
|
||||
done(nativePtr);
|
||||
}
|
||||
public long getNativePtr() {
|
||||
return nativePtr;
|
||||
}
|
||||
}
|
||||
156
java/impl/org/linphone/core/LinphoneProxyConfigImpl.java
Normal file
156
java/impl/org/linphone/core/LinphoneProxyConfigImpl.java
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
/*
|
||||
LinphoneProxyConfigImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
||||
|
||||
protected final long nativePtr;
|
||||
|
||||
private native int getState(long nativePtr);
|
||||
private native void setExpires(long nativePtr, int delay);
|
||||
|
||||
boolean ownPtr = false;
|
||||
protected LinphoneProxyConfigImpl(String identity,String proxy,String route, boolean enableRegister) throws LinphoneCoreException {
|
||||
nativePtr = newLinphoneProxyConfig();
|
||||
setIdentity(identity);
|
||||
setProxy(proxy);
|
||||
enableRegister(enableRegister);
|
||||
ownPtr=true;
|
||||
}
|
||||
protected LinphoneProxyConfigImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
ownPtr=false;
|
||||
}
|
||||
protected void finalize() throws Throwable {
|
||||
//Log.e(LinphoneService.TAG,"fixme, should release underlying proxy config");
|
||||
if (ownPtr) delete(nativePtr);
|
||||
}
|
||||
private native long newLinphoneProxyConfig();
|
||||
private native void delete(long ptr);
|
||||
|
||||
private native void edit(long ptr);
|
||||
private native void done(long ptr);
|
||||
|
||||
private native void setIdentity(long ptr,String identity);
|
||||
private native String getIdentity(long ptr);
|
||||
private native int setProxy(long ptr,String proxy);
|
||||
private native String getProxy(long ptr);
|
||||
|
||||
|
||||
private native void enableRegister(long ptr,boolean value);
|
||||
private native boolean isRegisterEnabled(long ptr);
|
||||
|
||||
private native boolean isRegistered(long ptr);
|
||||
private native void setDialPrefix(long ptr, String prefix);
|
||||
|
||||
private native String normalizePhoneNumber(long ptr,String number);
|
||||
|
||||
private native String getDomain(long ptr);
|
||||
|
||||
private native void setDialEscapePlus(long ptr, boolean value);
|
||||
|
||||
private native String getRoute(long ptr);
|
||||
private native int setRoute(long ptr,String uri);
|
||||
private native void enablePublish(long ptr,boolean enable);
|
||||
private native boolean publishEnabled(long ptr);
|
||||
private native void setContactParameters(long ptr, String params);
|
||||
|
||||
private native int lookupCCCFromIso(long nativePtr, String iso);
|
||||
|
||||
public void enableRegister(boolean value) {
|
||||
enableRegister(nativePtr,value);
|
||||
}
|
||||
|
||||
public void done() {
|
||||
done(nativePtr);
|
||||
}
|
||||
|
||||
public void edit() {
|
||||
edit(nativePtr);
|
||||
}
|
||||
|
||||
public void setIdentity(String identity) throws LinphoneCoreException {
|
||||
setIdentity(nativePtr,identity);
|
||||
}
|
||||
|
||||
public void setProxy(String proxyUri) throws LinphoneCoreException {
|
||||
if (setProxy(nativePtr,proxyUri)!=0) {
|
||||
throw new LinphoneCoreException("Bad proxy address ["+proxyUri+"]");
|
||||
}
|
||||
}
|
||||
public String normalizePhoneNumber(String number) {
|
||||
return normalizePhoneNumber(nativePtr,number);
|
||||
}
|
||||
public void setDialPrefix(String prefix) {
|
||||
setDialPrefix(nativePtr, prefix);
|
||||
}
|
||||
public String getDomain() {
|
||||
return getDomain(nativePtr);
|
||||
}
|
||||
public void setDialEscapePlus(boolean value) {
|
||||
setDialEscapePlus(nativePtr,value);
|
||||
}
|
||||
public String getIdentity() {
|
||||
return getIdentity(nativePtr);
|
||||
}
|
||||
public String getProxy() {
|
||||
return getProxy(nativePtr);
|
||||
}
|
||||
public boolean isRegistered() {
|
||||
return isRegistered(nativePtr);
|
||||
}
|
||||
public boolean registerEnabled() {
|
||||
return isRegisterEnabled(nativePtr);
|
||||
}
|
||||
public String getRoute() {
|
||||
return getRoute(nativePtr);
|
||||
}
|
||||
public void setRoute(String routeUri) throws LinphoneCoreException {
|
||||
if (setRoute(nativePtr, routeUri) != 0) {
|
||||
throw new LinphoneCoreException("cannot set route ["+routeUri+"]");
|
||||
}
|
||||
}
|
||||
public void enablePublish(boolean enable) {
|
||||
enablePublish(nativePtr,enable);
|
||||
}
|
||||
public RegistrationState getState() {
|
||||
return RegistrationState.fromInt(getState(nativePtr));
|
||||
}
|
||||
|
||||
public void setExpires(int delay) {
|
||||
setExpires(nativePtr, delay);
|
||||
}
|
||||
public boolean publishEnabled() {
|
||||
return publishEnabled(nativePtr);
|
||||
}
|
||||
@Override
|
||||
public void setContactParameters(String params) {
|
||||
setContactParameters(nativePtr, params);
|
||||
}
|
||||
@Override
|
||||
public int lookupCCCFromIso(String iso) {
|
||||
return lookupCCCFromIso(nativePtr, iso);
|
||||
}
|
||||
}
|
||||
112
java/impl/org/linphone/core/Log.java
Normal file
112
java/impl/org/linphone/core/Log.java
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
Log.java
|
||||
Copyright (C) 2011 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import static android.util.Log.DEBUG;
|
||||
import static android.util.Log.ERROR;
|
||||
import static android.util.Log.INFO;
|
||||
import static android.util.Log.WARN;
|
||||
|
||||
/**
|
||||
* Convenient wrapper for Android logs.
|
||||
*
|
||||
* @author Guillaume Beraudo
|
||||
*/
|
||||
public final class Log {
|
||||
|
||||
public static final String TAG = "Linphone";
|
||||
private static final boolean useIsLoggable = false;
|
||||
|
||||
@SuppressWarnings(value="all")
|
||||
private static boolean isLoggable(int level) {
|
||||
return !useIsLoggable || android.util.Log.isLoggable(TAG, level);
|
||||
}
|
||||
|
||||
public static void i(Object...objects) {
|
||||
if (isLoggable(INFO)) {
|
||||
android.util.Log.i(TAG, toString(objects));
|
||||
}
|
||||
}
|
||||
public static void i(Throwable t, Object...objects) {
|
||||
if (isLoggable(INFO)) {
|
||||
android.util.Log.i(TAG, toString(objects), t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void d(Object...objects) {
|
||||
if (isLoggable(DEBUG)) {
|
||||
android.util.Log.d(TAG, toString(objects));
|
||||
}
|
||||
}
|
||||
public static void d(Throwable t, Object...objects) {
|
||||
if (isLoggable(DEBUG)) {
|
||||
android.util.Log.d(TAG, toString(objects), t);
|
||||
}
|
||||
}
|
||||
|
||||
public static void w(Object...objects) {
|
||||
if (isLoggable(WARN)) {
|
||||
android.util.Log.w(TAG, toString(objects));
|
||||
}
|
||||
}
|
||||
public static void w(Throwable t, Object...objects) {
|
||||
if (isLoggable(WARN)) {
|
||||
android.util.Log.w(TAG, toString(objects), t);
|
||||
}
|
||||
}
|
||||
|
||||
public static void e(Object...objects) {
|
||||
if (isLoggable(ERROR)) {
|
||||
android.util.Log.e(TAG, toString(objects));
|
||||
}
|
||||
}
|
||||
public static void e(Throwable t, Object...objects) {
|
||||
if (isLoggable(ERROR)) {
|
||||
android.util.Log.e(TAG, toString(objects), t);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RuntimeException always throw after logging the error message.
|
||||
*/
|
||||
public static void f(Object...objects) {
|
||||
if (isLoggable(ERROR)) {
|
||||
android.util.Log.e(TAG, toString(objects));
|
||||
throw new RuntimeException("Fatal error : " + toString(objects));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @throws RuntimeException always throw after logging the error message.
|
||||
*/
|
||||
public static void f(Throwable t, Object...objects) {
|
||||
if (isLoggable(ERROR)) {
|
||||
android.util.Log.e(TAG, toString(objects), t);
|
||||
throw new RuntimeException("Fatal error : " + toString(objects), t);
|
||||
}
|
||||
}
|
||||
|
||||
private static String toString(Object...objects) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Object o : objects) {
|
||||
sb.append(o);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
45
java/impl/org/linphone/core/PayloadTypeImpl.java
Normal file
45
java/impl/org/linphone/core/PayloadTypeImpl.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
PayloadTypeImpl.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
package org.linphone.core;
|
||||
|
||||
class PayloadTypeImpl implements PayloadType {
|
||||
|
||||
protected final long nativePtr;
|
||||
|
||||
private native String toString(long ptr);
|
||||
private native String getMime(long ptr);
|
||||
private native int getRate(long ptr);
|
||||
|
||||
protected PayloadTypeImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
}
|
||||
|
||||
public int getRate() {
|
||||
return getRate(nativePtr);
|
||||
}
|
||||
|
||||
public String getMime() {
|
||||
return getMime(nativePtr);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return toString(nativePtr);
|
||||
}
|
||||
}
|
||||
42
java/impl/org/linphone/core/video/VideoUtil.java
Normal file
42
java/impl/org/linphone/core/video/VideoUtil.java
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
VideoUtil.java
|
||||
Copyright (C) 2011 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core.video;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.linphone.core.VideoSize;
|
||||
|
||||
import android.hardware.Camera.Size;
|
||||
|
||||
/**
|
||||
* @author Guillaume Beraudo
|
||||
*/
|
||||
final class VideoUtil {
|
||||
|
||||
private VideoUtil() {}
|
||||
|
||||
public static List<VideoSize> createList(List<Size> supportedVideoSizes) {
|
||||
List<VideoSize> converted = new ArrayList<VideoSize>(supportedVideoSizes.size());
|
||||
for (Size s : supportedVideoSizes) {
|
||||
converted.add(new VideoSize(s.width, s.height));
|
||||
}
|
||||
return converted;
|
||||
}
|
||||
}
|
||||
|
|
@ -22,15 +22,22 @@ if test "$readline_prefix" != "none"; then
|
|||
AC_CHECK_HEADERS(readline.h readline/readline.h, readline_h_found=yes)
|
||||
AC_CHECK_HEADERS(history.h readline/history.h)
|
||||
|
||||
AC_CHECK_LIB(readline, readline, [readline_libs_found=yes],[],[])
|
||||
|
||||
for termcap_lib in "" -ltermcap -lcurses -lncurses; do
|
||||
unset ac_cv_lib_readline_readline
|
||||
AC_CHECK_LIB(readline, readline, [readline_libs_found=yes],[],[$termcap_lib])
|
||||
if test "x$readline_libs_found" = "xyes" ; then
|
||||
READLINE_LIBS="$READLINE_LIBS -lreadline $termcap_lib"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
LIBS=$LIBS_save
|
||||
CPPFLAGS=$CPPFLAGS_save
|
||||
|
||||
if test "$readline_libs_found$readline_h_found" != "yesyes" ; then
|
||||
AC_MSG_WARN([Could not find libreadline headers or library, linphonec will have limited prompt features])
|
||||
else
|
||||
READLINE_LIBS="$READLINE_LIBS -lreadline "
|
||||
AC_DEFINE([HAVE_READLINE],1,[defined when compiling with readline support])
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit c3d6a095338c7d98647517b949e06e0b85f6443e
|
||||
Subproject commit 83267230336a64dc4a005b29bf8baccf6a5fd2c2
|
||||
2
oRTP
2
oRTP
|
|
@ -1 +1 @@
|
|||
Subproject commit 8a8843b1f3a56888492b298d5262a61369e15bb7
|
||||
Subproject commit ddc4f7d041967305483761fc9c643d3bb290a5f1
|
||||
Loading…
Add table
Reference in a new issue