Merge branch 'master' into dev_multicall

Conflicts:
	console/commands.c
	coreapi/callbacks.c
	coreapi/linphonecore.c
	coreapi/sal_eXosip2.c
	mediastreamer2
This commit is contained in:
Simon Morlat 2010-08-09 09:55:45 +02:00
commit f521b69f42
20 changed files with 326 additions and 116 deletions

8
NEWS
View file

@ -1,3 +1,11 @@
linphone-3.3.2 -- July 1st, 2010
* fix crash when setting firewall address in gtk interface
* fix crash while closing video window on windows
* fix un-sent BYE message in some rare cases.
Requires:
mediastreamer2-2.6.0
ortp-0.16.3
linphone-3.3.1 -- June 3, 2010
* fix bugs when carrying non ascii displaynames in SIP messages
* fix crash when codecs are incompatible

View file

@ -53,7 +53,7 @@ LOCAL_CFLAGS += \
-D_BYTE_ORDER=_LITTLE_ENDIAN \
-DORTP_INET6 \
-DENABLE_TRACE \
-DLINPHONE_VERSION=\"Linphone-3.1.2\" \
-DLINPHONE_VERSION=\"Linphone-3.3.x\" \
-DLINPHONE_PLUGINS_DIR=\"\\tmp\" \
-DLOG_DOMAIN=\"Linphone\"
@ -71,14 +71,16 @@ LOCAL_C_INCLUDES += \
LOCAL_LDLIBS += -llog
LOCAL_STATIC_LIBRARIES := \
libmsandroidsnd \
libmediastreamer2 \
libortp \
libspeex \
libeXosip2 \
libosip2 \
libgsm
# libmsilbc \
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS += -DHAVE_ILBC=1
LOCAL_STATIC_LIBRARIES += libmsilbc
endif
LOCAL_MODULE_CLASS = SHARED_LIBRARIES
include $(BUILD_SHARED_LIBRARY)

View file

@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([linphone],[3.3.1],[linphone-developers@nongnu.org])
AC_INIT([linphone],[3.3.2],[linphone-developers@nongnu.org])
AC_CANONICAL_SYSTEM
dnl Source packaging numbers

View file

@ -41,6 +41,9 @@
#include <sys/wait.h>
#endif
#define AUDIO 0
#define VIDEO 1
/***************************************************************************
*
* Forward declarations
@ -76,7 +79,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args);
static int lpc_cmd_status(LinphoneCore *lc, char *args);
static int lpc_cmd_ports(LinphoneCore *lc, char *args);
static int lpc_cmd_speak(LinphoneCore *lc, char *args);
static int lpc_cmd_codec(LinphoneCore *lc, char *args);
static int lpc_cmd_acodec(LinphoneCore *lc, char *args);
static int lpc_cmd_vcodec(LinphoneCore *lc, char *args);
static int lpc_cmd_codec(int type, LinphoneCore *lc, char *args);
static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args);
static int lpc_cmd_pause(LinphoneCore *lc, char *args);
static int lpc_cmd_resume(LinphoneCore *lc, char *args);
@ -100,9 +105,9 @@ static int linphonec_friend_add(LinphoneCore *lc, const char *name, const char *
#endif
static int linphonec_friend_delete(LinphoneCore *lc, int num);
static int linphonec_friend_delete(LinphoneCore *lc, int num);
static void linphonec_codec_list(LinphoneCore *lc);
static void linphonec_codec_enable(LinphoneCore *lc, int index);
static void linphonec_codec_disable(LinphoneCore *lc, int index);
static void linphonec_codec_list(int type, LinphoneCore *lc);
static void linphonec_codec_enable(int type, LinphoneCore *lc, int index);
static void linphonec_codec_disable(int type, LinphoneCore *lc, int index);
@ -224,10 +229,14 @@ LPC_COMMAND commands[] = {
"'speak <voice name> <sentence>' : speak a text using the specified espeak voice.\n"
"Example for english voice: 'speak default Hello my friend !'"
},
{ "codec", lpc_cmd_codec, "Codec configuration",
"'codec list' : list codecs\n"
"'codec enable <index>' : enable available codec\n"
"'codec disable <index>' : disable codecs" },
{ "codec", lpc_cmd_acodec, "Audio codec configuration",
"'codec list' : list audio codecs\n"
"'codec enable <index>' : enable available audio codec\n"
"'codec disable <index>' : disable audio codec" },
{ "vcodec", lpc_cmd_vcodec, "Video codec configuration",
"'vcodec list' : list video codecs\n"
"'vcodec enable <index>' : enable available video codec\n"
"'vcodec disable <index>' : disable video codec" },
{ "ec", lpc_cmd_echocancellation, "Echo cancellation",
"'ec on [<delay>] [<tail>] [<framesize>]' : turn EC on with given delay, tail length and framesize\n"
"'ec off' : turn echo cancellation (EC) off\n"
@ -1854,7 +1863,15 @@ static int lpc_cmd_speak(LinphoneCore *lc, char *args){
return 1;
}
static int lpc_cmd_codec(LinphoneCore *lc, char *args){
static int lpc_cmd_acodec(LinphoneCore *lc, char *args){
return lpc_cmd_codec(AUDIO, lc, args);
}
static int lpc_cmd_vcodec(LinphoneCore *lc, char *args){
return lpc_cmd_codec(VIDEO, lc, args);
}
static int lpc_cmd_codec(int type, LinphoneCore *lc, char *args){
char *arg1 = args;
char *arg2 = NULL;
char *ptr = args;
@ -1875,20 +1892,20 @@ static int lpc_cmd_codec(LinphoneCore *lc, char *args){
#ifdef HAVE_READLINE
rl_inhibit_completion=1;
#endif
if (!strcmp(arg2,"all")) linphonec_codec_enable(lc,-1);
else linphonec_codec_enable(lc,atoi(arg2));
if (!strcmp(arg2,"all")) linphonec_codec_enable(type,lc,-1);
else linphonec_codec_enable(type,lc,atoi(arg2));
#ifdef HAVE_READLINE
rl_inhibit_completion=0;
#endif
}
else if (strcmp(arg1,"list")==0)
{
linphonec_codec_list(lc);
linphonec_codec_list(type,lc);
}
else if (strcmp(arg1,"disable")==0)
{
if (!strcmp(arg2,"all")) linphonec_codec_disable(lc,-1);
else linphonec_codec_disable(lc,atoi(arg2));
if (!strcmp(arg2,"all")) linphonec_codec_disable(type,lc,-1);
else linphonec_codec_disable(type,lc,atoi(arg2));
}
else
{
@ -1898,12 +1915,19 @@ static int lpc_cmd_codec(LinphoneCore *lc, char *args){
return 1;
}
static void linphonec_codec_list(LinphoneCore *lc){
static void linphonec_codec_list(int type, LinphoneCore *lc){
PayloadType *pt;
codecs_config_t *config=&lc->codecs_conf;
int index=0;
MSList *node;
for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){
MSList *node=NULL;
if (type == AUDIO) {
node=config->audio_codecs;
} else if(type==VIDEO) {
node=config->video_codecs;
}
for(;node!=NULL;node=ms_list_next(node)){
pt=(PayloadType*)(node->data);
linphonec_out("%2d: %s (%d) %s\n", index, pt->mime_type, pt->clock_rate,
linphone_core_payload_type_enabled(lc,pt) ? "enabled" : "disabled");
@ -1911,12 +1935,19 @@ static void linphonec_codec_list(LinphoneCore *lc){
}
}
static void linphonec_codec_enable(LinphoneCore *lc, int sel_index){
static void linphonec_codec_enable(int type, LinphoneCore *lc, int sel_index){
PayloadType *pt;
codecs_config_t *config=&lc->codecs_conf;
int index=0;
MSList *node;
for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){
MSList *node=NULL;
if (type == AUDIO) {
node=config->audio_codecs;
} else if(type==VIDEO) {
node=config->video_codecs;
}
for(;node!=NULL;node=ms_list_next(node)){
if (index == sel_index || sel_index == -1) {
pt=(PayloadType*)(node->data);
pt->flags|=PAYLOAD_TYPE_ENABLED;
@ -1926,12 +1957,19 @@ static void linphonec_codec_enable(LinphoneCore *lc, int sel_index){
}
}
static void linphonec_codec_disable(LinphoneCore *lc, int sel_index){
static void linphonec_codec_disable(int type, LinphoneCore *lc, int sel_index){
PayloadType *pt;
codecs_config_t *config=&lc->codecs_conf;
int index=0;
MSList *node;
for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){
MSList *node=NULL;
if (type == AUDIO) {
node=config->audio_codecs;
} else if(type==VIDEO) {
node=config->video_codecs;
}
for(;node!=NULL;node=ms_list_next(node)){
if (index == sel_index || sel_index == -1) {
pt=(PayloadType*)(node->data);
pt->flags&=~PAYLOAD_TYPE_ENABLED;

View file

@ -142,7 +142,11 @@ static void spawn_linphonec(int argc, char *argv[]){
}
args[j++]=NULL;
#ifdef __uClinux__
pid = vfork();
#else
pid = fork();
#endif
if (pid < 0){
fprintf(stderr,"Could not fork\n");
exit(-1);

View file

@ -133,8 +133,11 @@ static void call_received(SalOp *h){
}
call->state=LinphoneCallRinging;
sal_call_notify_ringing(h);
linphone_core_init_media_streams(lc,call);
#if !(__IPHONE_OS_VERSION_MIN_REQUIRED >= 40000)
linphone_core_init_media_streams(lc,lc->call);
#endif
if (lc->vtable.inv_recv) lc->vtable.inv_recv(lc,call);
#endif
ms_free(barmesg);
ms_free(tmp);
}
@ -372,7 +375,7 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
/*char *retrymsg=_("%s. Retry after %i minute(s).");*/
char *msg600=_("User does not want to be disturbed.");
char *msg603=_("Call declined.");
char *msg=(char*)details;
const char *msg=details;
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
LinphoneGeneralStateContext gctx;
@ -380,11 +383,13 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
if (lc->vtable.show) lc->vtable.show(lc);
if (error==SalErrorNoResponse){
msg=_("No response.");
if (lc->vtable.display_status)
lc->vtable.display_status(lc,_("No response."));
lc->vtable.display_status(lc,msg);
}else if (error==SalErrorProtocol){
msg=details ? details : _("Protocol error.");
if (lc->vtable.display_status)
lc->vtable.display_status(lc, details ? details : _("Protocol error."));
lc->vtable.display_status(lc, msg);
}else if (error==SalErrorFailure){
switch(sr){
case SalReasonDeclined:

View file

@ -470,8 +470,8 @@ static void sound_config_read(LinphoneCore *lc)
linphone_core_enable_agc(lc,
lp_config_get_int(lc->config,"sound","agc",0));
gain=lp_config_get_float(lc->config,"sound","soft_play_lev",0);
linphone_core_set_soft_play_level(lc,gain);
gain=lp_config_get_float(lc->config,"sound","playback_gain_db",0);
linphone_core_set_playback_gain_db (lc,gain);
}
static void sip_config_read(LinphoneCore *lc)
@ -1068,7 +1068,8 @@ int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact)
/*result must be an array of chars at least LINPHONE_IPADDR_SIZE */
void linphone_core_get_local_ip(LinphoneCore *lc, const char *dest, char *result){
if (linphone_core_get_firewall_policy(lc)==LINPHONE_POLICY_USE_NAT_ADDRESS){
if (linphone_core_get_firewall_policy(lc)==LINPHONE_POLICY_USE_NAT_ADDRESS
&& linphone_core_get_nat_address(lc)!=NULL){
strncpy(result,linphone_core_get_nat_address(lc),LINPHONE_IPADDR_SIZE);
return;
}
@ -2090,8 +2091,8 @@ void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){
const char *type=lp_config_get_string(lc->config,"sound","el_type","mic");
if (strcasecmp(type,"mic")==0)
audio_stream_enable_echo_limiter(lc->audiostream,ELControlMic);
else if (strcasecmp(type,"speaker")==0)
audio_stream_enable_echo_limiter(lc->audiostream,ELControlSpeaker);
else if (strcasecmp(type,"full")==0)
audio_stream_enable_echo_limiter(lc->audiostream,ELControlFull);
}
audio_stream_enable_gain_control(lc->audiostream,TRUE);
if (linphone_core_echo_cancellation_enabled(lc)){
@ -2157,46 +2158,53 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){
static void post_configure_audio_streams(LinphoneCore *lc){
AudioStream *st=lc->audiostream;
float gain=lp_config_get_float(lc->config,"sound","mic_gain",-1);
if (gain!=-1)
audio_stream_set_mic_gain(st,gain);
float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",1);
float thres = 0;
float recv_gain;
float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05);
float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0);
int dc_removal=lp_config_get_int(lc->config,"sound","dc_removal",0);
if (mic_gain!=-1)
audio_stream_set_mic_gain(st,mic_gain);
lc->audio_muted=FALSE;
float recv_gain = lc->sound_conf.soft_play_lev;
recv_gain = lc->sound_conf.soft_play_lev;
if (recv_gain != 0) {
linphone_core_set_soft_play_level(lc,recv_gain);
linphone_core_set_playback_gain_db (lc,recv_gain);
}
if (st->volsend){
ms_filter_call_method(st->volsend,MS_VOLUME_REMOVE_DC,&dc_removal);
}
if (linphone_core_echo_limiter_enabled(lc)){
float speed=lp_config_get_float(lc->config,"sound","el_speed",-1);
float thres=lp_config_get_float(lc->config,"sound","el_thres",-1);
thres=lp_config_get_float(lc->config,"sound","el_thres",-1);
float force=lp_config_get_float(lc->config,"sound","el_force",-1);
int sustain=lp_config_get_int(lc->config,"sound","el_sustain",-1);
MSFilter *f=NULL;
if (st->el_type==ELControlMic){
if (st->el_type!=ELInactive){
f=st->volsend;
if (speed==-1) speed=0.03;
if (force==-1) force=10;
}
else if (st->el_type==ELControlSpeaker){
f=st->volrecv;
if (speed==-1) speed=0.02;
if (force==-1) force=5;
}
if (speed!=-1)
if (force==-1) force=25;
ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed);
if (thres!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres);
if (force!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force);
if (sustain!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain);
if (thres!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres);
if (sustain!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain);
}
}
if (st->volsend){
float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05);
float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0);
ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_thres);
ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&ng_floorgain);
}
if (st->volrecv){
/* parameters for a limited noise-gate effect, using echo limiter threshold */
float floorgain = 1/mic_gain;
ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&thres);
ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&floorgain);
}
parametrize_equalizer(lc,st);
if (lc->vtable.dtmf_received!=NULL){
/* replace by our default action*/
@ -2445,7 +2453,9 @@ int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call)
contact=get_fixed_contact(lc,call,cfg);
if (contact)
sal_op_set_contact(call->op,contact);
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
linphone_core_init_media_streams(lc,call);
#endif
sal_call_accept(call->op);
if (lc->vtable.display_status!=NULL)
lc->vtable.display_status(lc,_("Connected."));
@ -2786,13 +2796,13 @@ void linphone_core_set_ring_level(LinphoneCore *lc, int level){
}
/**
* Sets call playback gain in db
* Allow to control play level before entering sound card: gain in db
*
* @ingroup media_parameters
**/
void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){
float gain=level;
lc->sound_conf.soft_play_lev=level;
void linphone_core_set_playback_gain_db (LinphoneCore *lc, float gaindb){
float gain=gaindb;
lc->sound_conf.soft_play_lev=gaindb;
AudioStream *st=lc->audiostream;
if (!st) return; /*just return*/
@ -2802,11 +2812,11 @@ void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){
}
/**
* Returns call playback gain in db
* Get playback gain in db before entering sound card.
*
* @ingroup media_parameters
**/
float linphone_core_get_soft_play_level(LinphoneCore *lc) {
float linphone_core_get_playback_gain_db(LinphoneCore *lc) {
float gain=0;
AudioStream *st=lc->audiostream;
if (st->volrecv){
@ -3120,7 +3130,7 @@ bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc){
void linphone_core_mute_mic(LinphoneCore *lc, bool_t val){
if (lc->audiostream!=NULL){
audio_stream_set_mic_gain(lc->audiostream,
(val==TRUE) ? 0 : 1.0);
(val==TRUE) ? 0 : 1.0); // REVISIT: take mic_gain value
if ( linphone_core_get_rtp_no_xmit_on_audio_mute(lc) ){
audio_stream_mute_rtp(lc->audiostream,val);
}
@ -4017,3 +4027,28 @@ int linphone_core_del_call( LinphoneCore *lc, LinphoneCall *call)
lc->calls = the_calls;
return 0;
}
static PayloadType* find_payload_type_from_list(const char* type, int rate,const MSList* from) {
const MSList *elem;
for(elem=from;elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
if ((strcmp((char*)type, payload_type_get_mime(pt)) == 0) && rate==pt->clock_rate) {
return pt;
}
}
return NULL;
}
PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate) {
PayloadType* result = find_payload_type_from_list(type, rate, linphone_core_get_audio_codecs(lc));
if (result) {
return result;
} else {
result = find_payload_type_from_list(type, rate, linphone_core_get_video_codecs(lc));
if (result) {
return result;
}
}
//not found
return NULL;
}

View file

@ -623,6 +623,14 @@ bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, PayloadType *pt);
int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bool_t enable);
/*
* get payload type from mime type an clock rate
* @ingroup media_parameters
* iterates both audio an video
* return NULL if not found
*/
PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate) ;
const char *linphone_core_get_payload_type_description(LinphoneCore *lc, PayloadType *pt);
bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType *pt);
@ -717,18 +725,10 @@ int linphone_core_get_play_level(LinphoneCore *lc);
int linphone_core_get_rec_level(LinphoneCore *lc);
void linphone_core_set_ring_level(LinphoneCore *lc, int level);
void linphone_core_set_play_level(LinphoneCore *lc, int level);
/**
* Allow to control play level before entering sound card: level in db
*
* @ingroup media_parameters
**/
void linphone_core_set_soft_play_level(LinphoneCore *lc, float level);
/**
* get play level before entering sound card: level in db
*
* @ingroup media_parameters
**/
float linphone_core_get_soft_play_level(LinphoneCore *lc);
void linphone_core_set_playback_gain_db(LinphoneCore *lc, float level);
float linphone_core_get_playback_gain_db(LinphoneCore *lc);
void linphone_core_set_rec_level(LinphoneCore *lc, int level);
const char * linphone_core_get_ringer_device(LinphoneCore *lc);
const char * linphone_core_get_playback_device(LinphoneCore *lc);

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern "C" void libmsilbc_init();
#endif /*ANDROID*/
extern "C" void ms_andsnd_register_card(JavaVM *jvm) ;
extern "C" void ms_andsnd_set_jvm(JavaVM *jvm) ;
static JavaVM *jvm=0;
#ifdef ANDROID
@ -44,7 +44,7 @@ static void linphone_android_log_handler(OrtpLogLevel lev, const char *fmt, va_l
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *ajvm, void *reserved)
{
#ifdef ANDROID
ms_andsnd_register_card(ajvm);
ms_andsnd_set_jvm(ajvm);
#endif /*ANDROID*/
jvm=ajvm;
return JNI_VERSION_1_2;
@ -83,7 +83,7 @@ public:
/*displayStatus(LinphoneCore lc,String message);*/
displayStatusId = env->GetMethodID(listernerClass,"displayStatus","(Lorg/linphone/core/LinphoneCore;Ljava/lang/String;)V");
/*void generalState(LinphoneCore lc,int state); */
generalStateId = env->GetMethodID(listernerClass,"generalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GeneralState;)V");
generalStateId = env->GetMethodID(listernerClass,"generalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GeneralState;Ljava/lang/String;)V");
generalStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$GeneralState"));
generalStateFromIntId = env->GetStaticMethodID(generalStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$GeneralState;");
@ -145,7 +145,8 @@ public:
env->CallVoidMethod(lcData->listener
,lcData->generalStateId
,lcData->core
,env->CallStaticObjectMethod(lcData->generalStateClass,lcData->generalStateFromIntId,gstate->new_state));
,env->CallStaticObjectMethod(lcData->generalStateClass,lcData->generalStateFromIntId,gstate->new_state),
gstate->message ? env->NewStringUTF(gstate->message) : NULL);
}
};
@ -160,10 +161,12 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv*
const char* factoryConfig = env->GetStringUTFChars(jfactoryConfig, NULL);
LinphoneCoreData* ldata = new LinphoneCoreData(env,thiz,jlistener,juserdata);
#ifdef ANDROID
ms_andsnd_register_card(jvm);
// requires an fpu libmsilbc_init();
ms_andsnd_set_jvm(jvm);
#endif /*ANDROID*/
#ifdef HAVE_ILBC
libmsilbc_init(); // requires an fpu
#endif
jlong nativePtr = (jlong)linphone_core_new( &ldata->vTable
,userConfig
,factoryConfig
@ -292,17 +295,17 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setNetworkStateReachable
linphone_core_set_network_reachable((LinphoneCore*)lc,isReachable);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSoftPlayLevel( JNIEnv* env
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPlaybackGain( JNIEnv* env
,jobject thiz
,jlong lc
,jfloat gain) {
linphone_core_set_soft_play_level((LinphoneCore*)lc,gain);
linphone_core_set_playback_gain_db((LinphoneCore*)lc,gain);
}
extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getSoftPlayLevel( JNIEnv* env
extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getPlaybackGain( JNIEnv* env
,jobject thiz
,jlong lc) {
return linphone_core_get_soft_play_level((LinphoneCore*)lc);
return linphone_core_get_playback_gain_db((LinphoneCore*)lc);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_muteMic( JNIEnv* env
@ -337,7 +340,35 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isMicMuted( JNIEnv*
,jlong lc) {
return linphone_core_is_mic_muted((LinphoneCore*)lc);
}
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findPayloadType(JNIEnv* env
,jobject thiz
,jlong lc
,jstring jmime
,jint rate) {
const char* mime = env->GetStringUTFChars(jmime, NULL);
jlong result = (jlong)linphone_core_find_payload_type((LinphoneCore*)lc,mime,rate);
env->ReleaseStringUTFChars(jmime, mime);
return result;
}
extern "C" jlong 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);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env
,jobject thiz
,jlong lc
,jboolean enable) {
linphone_core_enable_echo_cancellation((LinphoneCore*)lc,enable);
}
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isEchoCancellationEnabled(JNIEnv* env
,jobject thiz
,jlong lc
) {
return linphone_core_echo_cancellation_enabled((LinphoneCore*)lc);
}
//ProxyConfig
@ -377,6 +408,20 @@ extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getProxy(JNIEn
return NULL;
}
}
extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_setRoute(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jroute) {
const char* route = env->GetStringUTFChars(jroute, NULL);
int err=linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,route);
env->ReleaseStringUTFChars(jroute, route);
return err;
}
extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getRoute(JNIEnv* env,jobject thiz,jlong proxyCfg) {
const char* route = linphone_proxy_config_get_route((LinphoneProxyConfig*)proxyCfg);
if (route) {
return env->NewStringUTF(route);
} else {
return NULL;
}
}
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enableRegister(JNIEnv* env,jobject thiz,jlong proxyCfg,jboolean enableRegister) {
linphone_proxy_config_enable_register((LinphoneProxyConfig*)proxyCfg,enableRegister);
@ -531,9 +576,9 @@ extern "C" void Java_org_linphone_core_LinphoneAddressImpl_setDisplayName(JNIEnv
,jobject thiz
,jlong address
,jstring jdisplayName) {
const char* displayName = env->GetStringUTFChars(jdisplayName, NULL);
const char* displayName = jdisplayName!= NULL?env->GetStringUTFChars(jdisplayName, NULL):NULL;
linphone_address_set_display_name((LinphoneAddress*)address,displayName);
env->ReleaseStringUTFChars(jdisplayName, displayName);
if (displayName != NULL) env->ReleaseStringUTFChars(jdisplayName, displayName);
}
@ -553,3 +598,17 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCallLogImpl_isIncoming(JNIEnv
,jlong ptr) {
return ((LinphoneCallLog*)ptr)->dir==LinphoneCallIncoming?JNI_TRUE:JNI_FALSE;
}
extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env
,jobject thiz
,jlong ptr) {
PayloadType* pt = (PayloadType*)ptr;
char* value = ms_strdup_printf("[%s] clock [%s], bitrate [%s]"
,payload_type_get_mime(pt)
,payload_type_get_rate(pt)
,payload_type_get_bitrate(pt));
jstring jvalue =env->NewStringUTF(value);
ms_free(value);
return jvalue;
}

View file

@ -59,8 +59,8 @@ static MSList *match_payloads(const MSList *local, const MSList *remote){
matched=find_payload_type_best_match(local,p2);
if (matched){
matched=payload_type_clone(matched);
if (p2->recv_fmtp)
payload_type_set_send_fmtp(matched,p2->recv_fmtp);
if (p2->send_fmtp)
payload_type_set_send_fmtp(matched,p2->send_fmtp);
res=ms_list_append(res,matched);
payload_type_set_number(matched,payload_type_get_number(p2));
}else{

View file

@ -90,22 +90,20 @@ bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj){
* - hostnames : sip:sip.example.net
**/
int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr){
LinphoneAddress *addr;
char *try=NULL;
LinphoneAddress *addr=NULL;
char *modified=NULL;
if (obj->reg_proxy!=NULL) ms_free(obj->reg_proxy);
obj->reg_proxy=NULL;
if (server_addr!=NULL && strlen(server_addr)>0){
addr=linphone_address_new(server_addr);
if (!addr){
/*try to prepend 'sip:' */
if (strstr(server_addr,"sip:")==NULL){
try=ms_strdup_printf("sip:%s",server_addr);
addr=linphone_address_new(try);
ms_free(try);
}
if (strstr(server_addr,"sip:")==NULL){
modified=ms_strdup_printf("sip:%s",server_addr);
addr=linphone_address_new(modified);
ms_free(modified);
}
if (addr==NULL)
addr=linphone_address_new(server_addr);
if (addr){
obj->reg_proxy=linphone_address_as_string_uri_only(addr);
linphone_address_destroy(addr);
@ -167,7 +165,12 @@ int linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route)
ms_free(obj->reg_route);
obj->reg_route=NULL;
}
obj->reg_route=ms_strdup(route);
if (route!=NULL){
/*try to prepend 'sip:' */
if (strstr(route,"sip:")==NULL){
obj->reg_route=ms_strdup_printf("sip:%s",route);
}else obj->reg_route=ms_strdup(route);
}
return 0;
}

View file

@ -907,9 +907,9 @@ static void call_accepted(Sal *sal, eXosip_event_t *ev){
ms_error("A closed call is accepted ?");
return;
}
if (op->did==-1){
op->did=ev->did;
}
op->did=ev->did;
sdp=eXosip_get_sdp_info(ev->response);
if (sdp){
op->base.remote_media=sal_media_description_new();

View file

@ -70,7 +70,18 @@ public interface LinphoneCore {
}
}
static public class Transport {
public final static Transport udp =new Transport("udp");
public final static Transport tcp =new Transport("tcp");
private final String mStringValue;
private Transport(String stringValue) {
mStringValue=stringValue;
}
public String toString() {
return mStringValue;
}
}
/**
* clear all added proxy config
*/
@ -159,12 +170,12 @@ public interface LinphoneCore {
* Allow to control play level before entering sound card:
* @param level in db
*/
public void setSoftPlayLevel(float gain);
public void setPlaybackGain(float gain);
/**
* get play level before entering sound card:
* @return level in db
*/
public float getSoftPlayLevel();
public float getPlaybackGain();
/**
* Mutes or unmutes the local microphone.
* @param isMuted
@ -185,4 +196,23 @@ public interface LinphoneCore {
*
*/
public void clearCallLogs();
<<<<<<< master
/***
* get payload type from mime type an clock rate
*
* return null if not found
*/
public PayloadType findPayloadType(String mime,int clockRate);
public void enablePayloadType(PayloadType pt, boolean enable) throws LinphoneCoreException;
public void enableEchoCancellation(boolean enable);
public boolean isEchoCancellationEnabled();
=======
public void setSignalingTransport(Transport aTransport);
>>>>>>> local
}

View file

@ -47,5 +47,6 @@ public interface LinphoneCoreListener {
* @param state LinphoneCore.GeneralState
* @return
* */
public void generalState(LinphoneCore lc,LinphoneCore.GeneralState state);
public void generalState(LinphoneCore lc,LinphoneCore.GeneralState state, String message);
}

View file

@ -72,4 +72,7 @@ public interface LinphoneProxyConfig {
public String getProxy();
public boolean registerEnabled();
public boolean isRegistered();
public void setRoute(String routeUri) throws LinphoneCoreException;
public String getRoute();
}

View file

@ -0,0 +1,23 @@
/*
PayloadType.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 interface PayloadType {
}

@ -1 +0,0 @@
Subproject commit bc6cdb650a9fc76d00380221eb0198ba4bb96812

2
oRTP

@ -1 +1 @@
Subproject commit 18eccd4f3af64f3bd5293d635a1a169dc77c92ad
Subproject commit 534074027a2163694ce6f8a520f0d6f6ac82b15d

View file

@ -11,7 +11,7 @@ status-green.png \
status-orange.png \
status-red.png \
status-offline.png \
contact-orange.png dialer-orange.png \
contact-orange.png dialer-orange.png history-orange.png\
startcall-green.png stopcall-red.png
EXTRA_DIST=$(pixmap_DATA)

View file

@ -71,4 +71,4 @@ mediastreamer2/src/drawdib-display.c
mediastreamer2/src/audiomixer.c
mediastreamer2/src/chanadapt.c
mediastreamer2/src/itc.c
mediastreamer2/src/extdisplay.c