Merge branch 'local_videoios' into dev_videoios

This commit is contained in:
Simon Morlat 2011-10-28 21:58:40 +02:00
commit b9394b5b86
32 changed files with 4800 additions and 365 deletions

View file

@ -119,6 +119,9 @@ endif
LOCAL_STATIC_LIBRARIES += libspeex
ifeq ($(BUILD_SRTP), 1)
LOCAL_C_INCLUDES += $(SRTP_C_INCLUDE)
endif
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS += -DHAVE_ILBC=1

View file

@ -553,7 +553,8 @@ char *linphonec_readline(char *prompt){
}
}else{
#ifdef HAVE_READLINE
return readline(prompt);
char* ret=readline(prompt);
return ret;
#endif
}
}

View file

@ -67,7 +67,7 @@
* Time between calls to linphonec_idle_call during main
* input read loop in microseconds.
*/
#define LPC_READLINE_TIMEOUT 1000000
#define LPC_READLINE_TIMEOUT 10000
/*
* Filename of linphonec history

View file

@ -237,6 +237,18 @@ const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const cha
return ret;
}
static void write_auth_infos(LinphoneCore *lc){
MSList *elem;
int i;
if (!linphone_core_ready(lc)) return;
for(elem=lc->auth_info,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
LinphoneAuthInfo *ai=(LinphoneAuthInfo*)(elem->data);
linphone_auth_info_write_config(lc->config,ai,i);
}
linphone_auth_info_write_config(lc->config,NULL,i); /* mark the end */
}
/**
* Adds authentication information to the LinphoneCore.
*
@ -273,6 +285,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
}
}
ms_list_free(l);
write_auth_infos(lc);
}
@ -287,18 +300,13 @@ void linphone_core_abort_authentication(LinphoneCore *lc, LinphoneAuthInfo *inf
* Removes an authentication information object.
**/
void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info){
int i;
MSList *elem;
LinphoneAuthInfo *r;
r=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username);
if (r){
lc->auth_info=ms_list_remove(lc->auth_info,r);
/*printf("len=%i newlen=%i\n",len,newlen);*/
linphone_auth_info_destroy(r);
for (elem=lc->auth_info,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
linphone_auth_info_write_config(lc->config,(LinphoneAuthInfo*)elem->data,i);
}
linphone_auth_info_write_config(lc->config,NULL,i);
write_auth_infos(lc);
}
}

View file

@ -94,7 +94,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
linphone_call_start_media_streams(call,all_muted,send_ringbacktone);
}
}
#if 0
static bool_t is_duplicate_call(LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to){
MSList *elem;
for(elem=lc->calls;elem!=NULL;elem=elem->next){
@ -106,6 +106,22 @@ static bool_t is_duplicate_call(LinphoneCore *lc, const LinphoneAddress *from, c
}
return FALSE;
}
#endif
static bool_t already_a_call_pending(LinphoneCore *lc){
MSList *elem;
for(elem=lc->calls;elem!=NULL;elem=elem->next){
LinphoneCall *call=(LinphoneCall*)elem->data;
if (call->state==LinphoneCallIncomingReceived
|| call->state==LinphoneCallOutgoingInit
|| call->state==LinphoneCallOutgoingProgress
|| call->state==LinphoneCallOutgoingEarlyMedia
|| call->state==LinphoneCallOutgoingRinging){
return TRUE;
}
}
return FALSE;
}
static void call_received(SalOp *h){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(h));
@ -145,8 +161,8 @@ static void call_received(SalOp *h){
from_addr=linphone_address_new(from);
to_addr=linphone_address_new(to);
if (is_duplicate_call(lc,from_addr,to_addr)){
ms_warning("Receiving duplicated call, refusing this one.");
if (already_a_call_pending(lc)){
ms_warning("Receiving another call while one is ringing or initiated, refusing this one with busy message.");
sal_call_decline(h,SalReasonBusy,NULL);
sal_op_release(h);
linphone_address_destroy(from_addr);
@ -178,24 +194,27 @@ static void call_received(SalOp *h){
lc->vtable.display_status(lc,barmesg);
/* play the ring if this is the only call*/
if (lc->sound_conf.ring_sndcard!=NULL && ms_list_size(lc->calls)==1){
if (ms_list_size(lc->calls)==1){
lc->current_call=call;
if (lc->ringstream && lc->dmfs_playing_start_time!=0){
ring_stop(lc->ringstream);
lc->ringstream=NULL;
lc->dmfs_playing_start_time=0;
}
if(lc->ringstream==NULL && lc->sound_conf.local_ring){
MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard;
ms_message("Starting local ring...");
lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,ringcard);
}
else
{
ms_message("the local ring is already started");
if (lc->sound_conf.ring_sndcard!=NULL){
if(lc->ringstream==NULL && lc->sound_conf.local_ring){
MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard;
ms_message("Starting local ring...");
lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,ringcard);
}
else
{
ms_message("the local ring is already started");
}
}
}else{
/* play a tone within the context of the current call */
/* else play a tone within the context of the current call */
call->ringing_beep=TRUE;
linphone_core_play_tone(lc);
}
@ -378,9 +397,14 @@ static void call_updating(SalOp *op){
SalMediaDescription *md;
md=sal_call_get_final_media_description(op);
/*accept the modification (sends a 200Ok)*/
sal_call_accept(op);
if (md && !sal_media_description_empty(md))
{
linphone_core_update_streams (lc,call,md);
if (sal_media_description_has_dir(call->localdesc,SalStreamSendRecv)){
ms_message("Our local status is SalStreamSendRecv");
if (sal_media_description_has_dir (md,SalStreamRecvOnly) || sal_media_description_has_dir(md,SalStreamInactive)){
@ -396,12 +420,12 @@ static void call_updating(SalOp *op){
lc->current_call=call;
}else{
prevstate=call->state;
if(lc->vtable.display_status)
lc->vtable.display_status(lc,_("Call has been updated by remote..."));
linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote");
}
}
/*accept the modification (sends a 200Ok)*/
sal_call_accept(op);
linphone_core_update_streams (lc,call,md);
if (prevstate!=LinphoneCallIdle){
linphone_call_set_state (call,prevstate,"Connected (streams running)");
}

View file

@ -25,10 +25,13 @@
#include "private.h"
#include "mediastreamer2/msvolume.h"
static void conference_check_init(LinphoneConference *ctx){
if (ctx->conf==NULL){
ctx->conf=ms_audio_conference_new();
MSAudioConferenceParams params;
params.samplerate=16000;
ctx->conf=ms_audio_conference_new(&params);
}
}
@ -42,10 +45,13 @@ static void remove_local_endpoint(LinphoneConference *ctx){
}
}
static void conference_check_uninit(LinphoneConference *ctx){
void linphone_core_conference_check_uninit(LinphoneConference *ctx){
if (ctx->conf){
if (ctx->conf->nmembers==0){
ms_message("conference_check_uninit(): nmembers=%i",ctx->conf->nmembers);
if (ctx->conf->nmembers==1 && ctx->local_participant!=NULL){
remove_local_endpoint(ctx);
}
if (ctx->conf->nmembers==0){
ms_audio_conference_destroy(ctx->conf);
ctx->conf=NULL;
}
@ -57,6 +63,8 @@ void linphone_call_add_to_conf(LinphoneCall *call){
LinphoneCore *lc=call->core;
LinphoneConference *conf=&lc->conf_ctx;
MSAudioEndpoint *ep;
call->params.has_video = FALSE;
call->camera_active = FALSE;
ep=ms_audio_endpoint_get_from_stream(call->audiostream,TRUE);
ms_audio_conference_add_member(conf->conf,ep);
call->endpoint=ep;
@ -69,7 +77,14 @@ void linphone_call_remove_from_conf(LinphoneCall *call){
ms_audio_conference_remove_member(conf->conf,call->endpoint);
ms_audio_endpoint_release_from_stream(call->endpoint);
call->endpoint=NULL;
conference_check_uninit(conf);
}
static RtpProfile *make_dummy_profile(int samplerate){
RtpProfile *prof=rtp_profile_new("dummy");
PayloadType *pt=payload_type_clone(&payload_type_l16_mono);
pt->clock_rate=samplerate;
rtp_profile_set_payload(prof,0,pt);
return prof;
}
static void add_local_endpoint(LinphoneConference *conf,LinphoneCore *lc){
@ -79,8 +94,10 @@ static void add_local_endpoint(LinphoneConference *conf,LinphoneCore *lc){
MSSndCard *playcard=lc->sound_conf.lsd_card ?
lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard;
MSSndCard *captcard=lc->sound_conf.capt_sndcard;
const MSAudioConferenceParams *params=ms_audio_conference_get_params(conf->conf);
RtpProfile *prof=make_dummy_profile(params->samplerate);
audio_stream_start_full(st, &av_profile,
audio_stream_start_full(st, prof,
"127.0.0.1",
65000,
65001,
@ -96,6 +113,20 @@ static void add_local_endpoint(LinphoneConference *conf,LinphoneCore *lc){
conf->local_participant=st;
conf->local_endpoint=ms_audio_endpoint_get_from_stream(st,FALSE);
ms_audio_conference_add_member(conf->conf,conf->local_endpoint);
/*normally and exceptionnaly, the profile is no more accessed past this point*/
rtp_profile_destroy(prof);
}
float linphone_core_get_conference_local_input_volume(LinphoneCore *lc){
LinphoneConference *conf=&lc->conf_ctx;
AudioStream *st=conf->local_participant;
if (st && st->volsend && !conf->local_muted){
float vol=0;
ms_filter_call_method(st->volsend,MS_VOLUME_GET,&vol);
return vol;
}
return LINPHONE_VOLUME_DB_LOWEST;
}
int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call){
@ -114,8 +145,12 @@ int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call){
linphone_core_resume_call(lc,call);
else if (call->state==LinphoneCallStreamsRunning){
/*this will trigger a reINVITE that will later redraw the streams */
if (call->audiostream || call->videostream)
if (call->audiostream || call->videostream){
linphone_call_stop_media_streams (call); /*free the audio & video local resources*/
}
if (call==lc->current_call){
lc->current_call=NULL;
}
linphone_core_update_call(lc,call,&params);
add_local_endpoint(conf,lc);
}else{
@ -126,6 +161,7 @@ int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call){
}
int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call){
int err=0;
if (!call->current_params.in_conference){
if (call->params.in_conference){
ms_warning("Not (yet) in conference, be patient");
@ -136,7 +172,8 @@ int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call){
}
}
call->params.in_conference=FALSE;
return linphone_core_pause_call(lc,call);
err=linphone_core_pause_call(lc,call);
return err;
}
bool_t linphone_core_is_in_conference(const LinphoneCore *lc){

View file

@ -1,7 +1,7 @@
/*
linphone
Copyright (C) 2010 Belledonne Communications SARL
Copyright (C) 2010 Belledonne Communications SARL
(simon.morlat@linphone.org)
This program is free software; you can redistribute it and/or
@ -169,14 +169,14 @@ static SalMediaDescription *_create_local_media_description(LinphoneCore *lc, Li
LinphoneAddress *addr=linphone_address_new(me);
const char *username=linphone_address_get_username (addr);
SalMediaDescription *md=sal_media_description_new();
md->session_id=session_id;
md->session_ver=session_ver;
md->nstreams=1;
strncpy(md->addr,call->localip,sizeof(md->addr));
strncpy(md->username,username,sizeof(md->username));
md->bandwidth=linphone_core_get_download_bandwidth(lc);
/*set audio capabilities */
strncpy(md->streams[0].addr,call->localip,sizeof(md->streams[0].addr));
md->streams[0].port=call->audio_port;
@ -187,7 +187,7 @@ static SalMediaDescription *_create_local_media_description(LinphoneCore *lc, Li
pt=payload_type_clone(rtp_profile_get_payload_from_mime(&av_profile,"telephone-event"));
l=ms_list_append(l,pt);
md->streams[0].payloads=l;
if (call->params.has_video){
md->nstreams++;
@ -254,7 +254,7 @@ static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from,
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;
}
static void discover_mtu(LinphoneCore *lc, const char *remote){
@ -310,7 +310,7 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
sal_ping(call->ping_op,linphone_core_find_best_identity(lc,from,NULL),from_str);
ms_free(from_str);
}
linphone_address_clean(from);
linphone_core_get_local_ip(lc,linphone_address_get_domain(from),call->localip);
linphone_call_init_common(call, from, to);
@ -331,13 +331,13 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
static void linphone_call_set_terminated(LinphoneCall *call){
LinphoneCore *lc=call->core;
linphone_core_update_allocated_audio_bandwidth(lc);
call->owns_call_log=FALSE;
linphone_call_log_completed(call);
if (call == lc->current_call){
ms_message("Resetting the current call");
lc->current_call=NULL;
@ -346,10 +346,15 @@ static void linphone_call_set_terminated(LinphoneCall *call){
if (linphone_core_del_call(lc,call) != 0){
ms_error("Could not remove the call from the list !!!");
}
if (ms_list_size(lc->calls)==0)
linphone_core_notify_all_friends(lc,lc->presence_mode);
linphone_core_conference_check_uninit(&lc->conf_ctx);
if (call->ringing_beep){
linphone_core_stop_dtmf(lc);
call->ringing_beep=FALSE;
}
}
const char *linphone_call_state_to_string(LinphoneCallState cs){
@ -423,7 +428,7 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const
if (cstate == LinphoneCallConnected) {
call->log->status=LinphoneCallSuccess;
}
if (lc->vtable.call_state_changed)
lc->vtable.call_state_changed(lc,call,cstate,message);
if (cstate==LinphoneCallReleased){
@ -479,8 +484,9 @@ static void linphone_call_destroy(LinphoneCall *obj)
* valid. Once the application no more needs this pointer,
* it must call linphone_call_unref().
**/
void linphone_call_ref(LinphoneCall *obj){
LinphoneCall * linphone_call_ref(LinphoneCall *obj){
obj->refcnt++;
return obj;
}
/**
@ -592,7 +598,7 @@ const char *linphone_call_get_remote_user_agent(LinphoneCall *call){
* executed yet.
* Pending transfers are executed when this call is being paused or closed,
* locally or by remote endpoint.
* If the call is already paused while receiving the transfer request, the
* If the call is already paused while receiving the transfer request, the
* transfer immediately occurs.
**/
bool_t linphone_call_has_transfer_pending(const LinphoneCall *call){
@ -757,7 +763,7 @@ void linphone_call_init_media_streams(LinphoneCall *call){
LinphoneCore *lc=call->core;
SalMediaDescription *md=call->localdesc;
AudioStream *audiostream;
call->audiostream=audiostream=audio_stream_new(md->streams[0].port,linphone_core_ipv6_enabled(lc));
if (linphone_core_echo_limiter_enabled(lc)){
const char *type=lp_config_get_string(lc->config,"sound","el_type","mic");
@ -783,7 +789,7 @@ void linphone_call_init_media_streams(LinphoneCall *call){
int enabled=lp_config_get_int(lc->config,"sound","noisegate",0);
audio_stream_enable_noise_gate(audiostream,enabled);
}
if (lc->a_rtp)
rtp_session_set_transports(audiostream->session,lc->a_rtp,lc->a_rtcp);
@ -852,16 +858,17 @@ void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t mute
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 (!muted)
audio_stream_set_mic_gain(st,mic_gain);
else
else
audio_stream_set_mic_gain(st,0);
recv_gain = lc->sound_conf.soft_play_lev;
if (recv_gain != 0) {
linphone_core_set_playback_gain_db (lc,recv_gain);
}
if (st->volsend){
ms_filter_call_method(st->volsend,MS_VOLUME_REMOVE_DC,&dc_removal);
float speed=lp_config_get_float(lc->config,"sound","el_speed",-1);
@ -888,7 +895,9 @@ void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t mute
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);
int spk_agc=lp_config_get_int(lc->config,"sound","speaker_agc_enabled",0);
ms_filter_call_method(st->volrecv, MS_VOLUME_ENABLE_AGC, &spk_agc);
ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_thres);
ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&floorgain);
}
parametrize_equalizer(lc,st);
@ -914,11 +923,11 @@ static RtpProfile *make_profile(LinphoneCall *call, const SalMediaDescription *m
LinphoneCore *lc=call->core;
int up_ptime=0;
*used_pt=-1;
for(elem=desc->payloads;elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
int number;
if ((pt->flags & PAYLOAD_TYPE_FLAG_CAN_SEND) && first) {
if (desc->type==SalAudio){
linphone_core_update_allocated_audio_bandwidth_in_call(call,pt);
@ -935,8 +944,8 @@ static RtpProfile *make_profile(LinphoneCall *call, const SalMediaDescription *m
remote_bw=get_video_bandwidth(remote_bw,call->audio_bw);
}
}
if (desc->type==SalAudio){
if (desc->type==SalAudio){
bw=get_min_bandwidth(call->audio_bw,remote_bw);
}else bw=get_min_bandwidth(get_video_bandwidth(linphone_core_get_upload_bandwidth (lc),call->audio_bw),remote_bw);
if (bw>0) pt->normal_bitrate=bw*1000;
@ -969,15 +978,22 @@ static void setup_ring_player(LinphoneCore *lc, LinphoneCall *call){
#define LINPHONE_RTCP_SDES_TOOL "Linphone-" LINPHONE_VERSION
static bool_t linphone_call_sound_resources_available(LinphoneCall *call){
LinphoneCore *lc=call->core;
LinphoneCall *current=linphone_core_get_current_call(lc);
return !linphone_core_is_in_conference(lc) &&
(current==NULL || current==call);
}
static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cname, bool_t muted, bool_t send_ringbacktone, bool_t use_arc){
LinphoneCore *lc=call->core;
int jitt_comp=lc->rtp_conf.audio_jitt_comp;
int used_pt=-1;
const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc,
SalProtoRtpAvp,SalAudio);
if (stream && stream->dir!=SalStreamInactive && stream->port!=0){
MSSndCard *playcard=lc->sound_conf.lsd_card ?
MSSndCard *playcard=lc->sound_conf.lsd_card ?
lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard;
MSSndCard *captcard=lc->sound_conf.capt_sndcard;
const char *playfile=lc->play_file;
@ -1017,6 +1033,10 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
/* first create the graph without soundcard resources*/
captcard=playcard=NULL;
}
if (!linphone_call_sound_resources_available(call)){
ms_message("Sound resources are used by another call, not using soundcard.");
captcard=playcard=NULL;
}
use_ec=captcard==NULL ? FALSE : linphone_core_echo_cancellation_enabled(lc);
audio_stream_enable_adaptive_bitrate_control(call->audiostream,use_arc);
@ -1025,7 +1045,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
call->audio_profile,
stream->addr[0]!='\0' ? stream->addr : call->resultdesc->addr,
stream->port,
stream->port+1,
linphone_core_rtcp_enabled(lc) ? (stream->port+1) : 0,
used_pt,
jitt_comp,
playfile,
@ -1051,7 +1071,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
linphone_call_add_to_conf(call);
}
}else ms_warning("No audio stream accepted ?");
}
}
}
static void linphone_call_start_video_stream(LinphoneCall *call, const char *cname,bool_t all_inputs_muted){
@ -1066,7 +1086,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
lc->previewstream=NULL;
}
call->current_params.has_video=FALSE;
if (vstream && vstream->dir!=SalStreamInactive && vstream->port!=0) {
if (vstream!=NULL && vstream->dir!=SalStreamInactive && vstream->port!=0) {
const char *addr=vstream->addr[0]!='\0' ? vstream->addr : call->resultdesc->addr;
call->video_profile=make_profile(call,call->resultdesc,vstream,&used_pt);
if (used_pt!=-1){
@ -1075,7 +1095,9 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
bool_t is_inactive=FALSE;
call->current_params.has_video=TRUE;
video_stream_enable_adaptive_bitrate_control(call->videostream,
linphone_core_adaptive_rate_control_enabled(lc));
video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc));
video_stream_enable_self_view(call->videostream,lc->video_conf.selfview);
if (lc->video_window_id!=0)
@ -1110,7 +1132,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
video_stream_set_device_rotation(call->videostream, lc->device_rotation);
video_stream_start(call->videostream,
call->video_profile, addr, vstream->port,
vstream->port+1,
linphone_core_rtcp_enabled(lc) ? (vstream->port+1) : 0,
used_pt, lc->rtp_conf.audio_jitt_comp, cam);
video_stream_set_rtcp_information(call->videostream, cname,LINPHONE_RTCP_SDES_TOOL);
}
@ -1130,7 +1152,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
const SalStreamDescription *vstream=sal_media_description_find_stream(call->resultdesc,
SalProtoRtpAvp,SalVideo);
#endif
if(call->audiostream == NULL)
{
ms_fatal("start_media_stream() called without prior init !");
@ -1141,18 +1163,20 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
cname=linphone_address_as_string_uri_only(me);
#if defined(VIDEO_ENABLED)
if (vstream && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL){
if (vstream!=NULL && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL){
/*when video is used, do not make adaptive rate control on audio, it is stupid.*/
use_arc=FALSE;
}
#endif
linphone_call_start_audio_stream(call,cname,all_inputs_muted,send_ringbacktone,use_arc);
linphone_call_start_video_stream(call,cname,all_inputs_muted);
if (call->videostream!=NULL) {
linphone_call_start_video_stream(call,cname,all_inputs_muted);
}
call->all_muted=all_inputs_muted;
call->playing_ringbacktone=send_ringbacktone;
call->up_bw=linphone_core_get_upload_bandwidth(lc);
if (ortp_zrtp_available()) {
OrtpZrtpParams params;
params.zid=get_hexa_zrtp_identifier(lc);
@ -1202,9 +1226,9 @@ void linphone_call_stop_media_streams(LinphoneCall *call){
video_stream_stop(call->videostream);
call->videostream=NULL;
}
#endif
ms_event_queue_skip(call->core->msevq);
#endif
if (call->audio_profile){
rtp_profile_clear_all(call->audio_profile);
rtp_profile_destroy(call->audio_profile);
@ -1260,11 +1284,11 @@ bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call){
/**
* @addtogroup call_misc
* @{
**/
**/
/**
* Returns the measured sound volume played locally (received from remote)
* It is expressed in dbm0.
* It is expressed in dbm0.
**/
float linphone_call_get_play_volume(LinphoneCall *call){
AudioStream *st=call->audiostream;
@ -1272,14 +1296,14 @@ float linphone_call_get_play_volume(LinphoneCall *call){
float vol=0;
ms_filter_call_method(st->volrecv,MS_VOLUME_GET,&vol);
return vol;
}
return LINPHONE_VOLUME_DB_LOWEST;
}
/**
* Returns the measured sound volume recorded locally (sent to remote)
* It is expressed in dbm0.
* It is expressed in dbm0.
**/
float linphone_call_get_record_volume(LinphoneCall *call){
AudioStream *st=call->audiostream;
@ -1287,7 +1311,7 @@ float linphone_call_get_record_volume(LinphoneCall *call){
float vol=0;
ms_filter_call_method(st->volsend,MS_VOLUME_GET,&vol);
return vol;
}
return LINPHONE_VOLUME_DB_LOWEST;
}
@ -1306,7 +1330,7 @@ float linphone_call_get_record_volume(LinphoneCall *call){
* 1-2 = very poor quality <br>
* 0-1 = can't be worse, mostly unusable <br>
*
* @returns The function returns -1 if no quality measurement is available, for example if no
* @returns The function returns -1 if no quality measurement is available, for example if no
* active audio stream exist. Otherwise it returns the quality rating.
**/
float linphone_call_get_current_quality(LinphoneCall *call){
@ -1349,7 +1373,7 @@ static void linphone_core_disconnected(LinphoneCore *lc, LinphoneCall *call){
{
snprintf(temp,sizeof(temp),"Remote end %s seems to have disconnected, the call is going to be closed.",from);
free(from);
}
}
else
{
snprintf(temp,sizeof(temp),"Remote end seems to have disconnected, the call is going to be closed.");
@ -1362,7 +1386,7 @@ static void linphone_core_disconnected(LinphoneCore *lc, LinphoneCall *call){
void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapsed){
int disconnect_timeout = linphone_core_get_nortp_timeout(call->core);
bool_t disconnected=FALSE;
if (call->state==LinphoneCallStreamsRunning && one_second_elapsed){
RtpSession *as=NULL,*vs=NULL;
float audio_load=0, video_load=0;
@ -1426,9 +1450,9 @@ void linphone_call_background_tasks(LinphoneCall *call, bool_t one_second_elapse
void linphone_call_log_completed(LinphoneCall *call){
LinphoneCore *lc=call->core;
call->log->duration=time(NULL)-call->start_time;
if (call->log->status==LinphoneCallMissed){
char *info;
lc->missed_calls++;

View file

@ -37,6 +37,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/*#define UNSTANDART_GSM_11K 1*/
#define ROOT_CA_FILE PACKAGE_DATA_DIR "/linphone/rootca.pem"
static const char *liblinphone_version=LIBLINPHONE_VERSION;
static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t curtime);
static void linphone_core_run_hooks(LinphoneCore *lc);
@ -381,6 +383,8 @@ static void sound_config_read(LinphoneCore *lc)
MSSndCard *card=ms_alsa_card_new_custom(devid,devid);
ms_snd_card_manager_add_card(ms_snd_card_manager_get(),card);
}
tmp=lp_config_get_int(lc->config,"sound","alsa_forced_rate",-1);
if (tmp>0) ms_alsa_card_set_forced_sample_rate(tmp);
#endif
/* retrieve all sound devices */
build_sound_devices_table(lc);
@ -431,10 +435,10 @@ static void sound_config_read(LinphoneCore *lc)
linphone_core_set_play_file(lc,lp_config_get_string(lc->config,"sound","hold_music",PACKAGE_SOUND_DIR "/" HOLD_MUSIC));
check_sound_device(lc);
lc->sound_conf.latency=0;
#if !defined(TARGET_OS_IPHONE) && !defined(ANDROID)
#ifndef __ios
tmp=TRUE;
#else
tmp=FALSE;
tmp=FALSE; /* on iOS we have builtin echo cancellation.*/
#endif
tmp=lp_config_get_int(lc->config,"sound","echocancellation",tmp);
linphone_core_enable_echo_cancellation(lc,tmp);
@ -514,7 +518,11 @@ static void sip_config_read(LinphoneCore *lc)
ms_free(contact);
}
#ifdef __linux
sal_root_ca(lc->sal, lp_config_get_string(lc->config,"sip","root_ca", "/etc/ssl/certs"));
#else
sal_root_ca(lc->sal, lp_config_get_string(lc->config,"sip","root_ca", ROOT_CA_FILE));
#endif
tmp=lp_config_get_int(lc->config,"sip","guess_hostname",1);
linphone_core_set_guess_hostname(lc,tmp);
@ -808,7 +816,11 @@ void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled
* See linphone_core_enable_adaptive_rate_control().
**/
bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc){
return lp_config_get_int(lc->config,"net","adaptive_rate_control",FALSE);
return lp_config_get_int(lc->config,"net","adaptive_rate_control",TRUE);
}
bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc){
return lp_config_get_int(lc->config,"rtp","rtcp_enabled",TRUE);
}
/**
@ -827,6 +839,7 @@ bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc){
*/
void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw){
lc->net_conf.download_bw=bw;
if (linphone_core_ready(lc)) lp_config_set_int(lc->config,"net","download_bw",bw);
}
/**
@ -844,6 +857,7 @@ void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw){
*/
void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw){
lc->net_conf.upload_bw=bw;
if (linphone_core_ready(lc)) lp_config_set_int(lc->config,"net","upload_bw",bw);
}
/**
@ -961,6 +975,7 @@ void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const
static void misc_config_read (LinphoneCore *lc) {
LpConfig *config=lc->config;
lc->max_call_logs=lp_config_get_int(config,"misc","history_max_size",15);
lc->max_calls=lp_config_get_int(config,"misc","max_calls",NB_MAX_CALLS);
}
static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, const char *config_path,
@ -1028,7 +1043,11 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
linphone_core_assign_payload_type(lc,&payload_type_aal2_g726_24,-1,NULL);
linphone_core_assign_payload_type(lc,&payload_type_aal2_g726_32,-1,NULL);
linphone_core_assign_payload_type(lc,&payload_type_aal2_g726_40,-1,NULL);
linphone_core_assign_payload_type(lc,&payload_type_silk_nb,-1,NULL);
linphone_core_assign_payload_type(lc,&payload_type_silk_mb,-1,NULL);
linphone_core_assign_payload_type(lc,&payload_type_silk_wb,-1,NULL);
linphone_core_assign_payload_type(lc,&payload_type_silk_swb,-1,NULL);
ms_init();
/* create a mediastreamer2 event queue and set it as global */
/* This allows to run event's callback in linphone_core_iterate() */
@ -1491,6 +1510,12 @@ int linphone_core_set_sip_transports(LinphoneCore *lc, const LCSipTransports * t
return 0;
memcpy(&lc->sip_conf.transports,tr,sizeof(*tr));
if (linphone_core_ready(lc)){
lp_config_set_int(lc->config,"sip","sip_port",tr->udp_port);
lp_config_set_int(lc->config,"sip","sip_tcp_port",tr->tcp_port);
lp_config_set_int(lc->config,"sip","sip_tls_port",tr->tls_port);
}
if (lc->sal==NULL) return 0;
return apply_transports(lc);
}
@ -2300,6 +2325,10 @@ int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call)
ms_message("ring stopped");
lc->ringstream=NULL;
}
if (call->ringing_beep){
linphone_core_stop_dtmf(lc);
call->ringing_beep=FALSE;
}
linphone_core_get_default_proxy(lc,&cfg);
dest_proxy=cfg;
@ -2357,10 +2386,6 @@ static void terminate_call(LinphoneCore *lc, LinphoneCall *call){
lc->ringstream=NULL;
}
/*stop any dtmf tone still playing */
ms_message("test");
linphone_core_stop_dtmf(lc);
linphone_call_stop_media_streams(call);
if (lc->vtable.display_status!=NULL)
lc->vtable.display_status(lc,_("Call ended") );
@ -2544,8 +2569,10 @@ int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *the_call)
linphone_core_preempt_sound_resources(lc);
ms_message("Resuming call %p",call);
}
update_local_media_description(lc,the_call,&call->localdesc);
sal_call_set_local_media_description(call->op,call->localdesc);
sal_media_description_set_dir(call->localdesc,SalStreamSendRecv);
if (call->params.in_conference) subject="Resuming conference";
if (call->params.in_conference && !call->current_params.in_conference) subject="Conference";
if(sal_call_update(call->op,subject) != 0){
return -1;
}
@ -3034,23 +3061,34 @@ bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc){
**/
void linphone_core_mute_mic(LinphoneCore *lc, bool_t val){
LinphoneCall *call=linphone_core_get_current_call(lc);
if (call==NULL){
AudioStream *st=NULL;
if (linphone_core_is_in_conference(lc)){
lc->conf_ctx.local_muted=val;
st=lc->conf_ctx.local_participant;
}else if (call==NULL){
ms_warning("linphone_core_mute_mic(): No current call !");
return;
}
if (call->audiostream!=NULL){
audio_stream_set_mic_gain(call->audiostream,
(val==TRUE) ? 0 : lp_config_get_float(lc->config,"sound","mic_gain",1));
if ( linphone_core_get_rtp_no_xmit_on_audio_mute(lc) ){
audio_stream_mute_rtp(call->audiostream,val);
}
}else{
st=call->audiostream;
call->audio_muted=val;
}
if (st!=NULL){
audio_stream_set_mic_gain(st,
(val==TRUE) ? 0 : lp_config_get_float(lc->config,"sound","mic_gain",1));
if ( linphone_core_get_rtp_no_xmit_on_audio_mute(lc) ){
audio_stream_mute_rtp(st,val);
}
}
}
/**
* Returns whether microphone is muted.
**/
bool_t linphone_core_is_mic_muted(LinphoneCore *lc) {
LinphoneCall *call=linphone_core_get_current_call(lc);
if (call==NULL){
if (linphone_core_is_in_conference(lc)){
return lc->conf_ctx.local_muted;
}else if (call==NULL){
ms_warning("linphone_core_is_mic_muted(): No current call !");
return FALSE;
}
@ -3678,11 +3716,14 @@ void linphone_core_set_record_file(LinphoneCore *lc, const char *file){
static MSFilter *get_dtmf_gen(LinphoneCore *lc){
LinphoneCall *call=linphone_core_get_current_call (lc);
AudioStream *stream=NULL;
if (call){
AudioStream *stream=call->audiostream;
if (stream){
return stream->dtmfgen;
}
stream=call->audiostream;
}else if (linphone_core_is_in_conference(lc)){
stream=lc->conf_ctx.local_participant;
}
if (stream){
return stream->dtmfgen;
}
if (lc->ringstream==NULL){
float amp=0.1;
@ -3731,7 +3772,7 @@ void linphone_core_play_tone(LinphoneCore *lc){
def.duration=300;
def.frequency=500;
def.amplitude=1;
def.interval=800;
def.interval=2000;
ms_filter_call_method(f, MS_DTMF_GEN_PLAY_CUSTOM,&def);
}
@ -3837,8 +3878,6 @@ int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, r
void net_config_uninit(LinphoneCore *lc)
{
net_config_t *config=&lc->net_conf;
lp_config_set_int(lc->config,"net","download_bw",config->download_bw);
lp_config_set_int(lc->config,"net","upload_bw",config->upload_bw);
if (config->stun_server!=NULL){
lp_config_set_string(lc->config,"net","stun_server",config->stun_server);
@ -3861,9 +3900,7 @@ void sip_config_uninit(LinphoneCore *lc)
MSList *elem;
int i;
sip_config_t *config=&lc->sip_conf;
lp_config_set_int(lc->config,"sip","sip_port",config->transports.udp_port);
lp_config_set_int(lc->config,"sip","sip_tcp_port",config->transports.tcp_port);
lp_config_set_int(lc->config,"sip","sip_tls_port",config->transports.tls_port);
lp_config_set_int(lc->config,"sip","guess_hostname",config->guess_hostname);
lp_config_set_string(lc->config,"sip","contact",config->contact);
lp_config_set_int(lc->config,"sip","inc_timeout",config->inc_timeout);
@ -3873,15 +3910,12 @@ void sip_config_uninit(LinphoneCore *lc)
lp_config_set_int(lc->config,"sip","register_only_when_network_is_up",config->register_only_when_network_is_up);
lp_config_set_int(lc->config,"sip","default_proxy",linphone_core_get_default_proxy(lc,NULL));
for(elem=config->proxies,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)(elem->data);
linphone_proxy_config_write_to_config_file(lc->config,cfg,i);
linphone_proxy_config_edit(cfg); /* to unregister */
}
/*to ensure remove configs are erased:*/
linphone_proxy_config_write_to_config_file(lc->config,NULL,i);
for (i=0;i<20;i++){
sal_iterate(lc->sal);
@ -3898,11 +3932,6 @@ void sip_config_uninit(LinphoneCore *lc)
linphone_proxy_config_write_to_config_file(lc->config,NULL,i); /*mark the end */
for(elem=lc->auth_info,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
LinphoneAuthInfo *ai=(LinphoneAuthInfo*)(elem->data);
linphone_auth_info_write_config(lc->config,ai,i);
}
linphone_auth_info_write_config(lc->config,NULL,i); /* mark the end */
ms_list_for_each(lc->auth_info,(void (*)(void*))linphone_auth_info_destroy);
ms_list_free(lc->auth_info);
lc->auth_info=NULL;
@ -4127,9 +4156,9 @@ int linphone_core_get_calls_nb(const LinphoneCore *lc){
**/
bool_t linphone_core_can_we_add_call(LinphoneCore *lc)
{
if(linphone_core_get_calls_nb(lc) < NB_MAX_CALLS)
if(linphone_core_get_calls_nb(lc) < lc->max_calls)
return TRUE;
ms_error("Maximum amount of simultaneous calls reached !");
ms_message("Maximum amount of simultaneous calls reached !");
return FALSE;
}
@ -4285,6 +4314,11 @@ void linphone_core_stop_dtmf_stream(LinphoneCore* lc) {
lc->ringstream=NULL;
}
int linphone_core_get_max_calls(LinphoneCore *lc) {
return lc->max_calls;
}
typedef struct Hook{
LinphoneCoreIterateHook fun;
void *data;

View file

@ -242,7 +242,7 @@ const LinphoneAddress * linphone_core_get_current_call_remote_address(struct _Li
const LinphoneAddress * linphone_call_get_remote_address(const LinphoneCall *call);
char *linphone_call_get_remote_address_as_string(const LinphoneCall *call);
LinphoneCallDir linphone_call_get_dir(const LinphoneCall *call);
void linphone_call_ref(LinphoneCall *call);
LinphoneCall * linphone_call_ref(LinphoneCall *call);
void linphone_call_unref(LinphoneCall *call);
LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
const char *linphone_call_get_refer_to(const LinphoneCall *call);
@ -1026,10 +1026,13 @@ int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call);
bool_t linphone_core_is_in_conference(const LinphoneCore *lc);
int linphone_core_enter_conference(LinphoneCore *lc);
int linphone_core_leave_conference(LinphoneCore *lc);
float linphone_core_get_conference_local_input_volume(LinphoneCore *lc);
int linphone_core_terminate_conference(LinphoneCore *lc);
int linphone_core_get_conference_size(LinphoneCore *lc);
int linphone_core_get_max_calls(LinphoneCore *lc);
#ifdef __cplusplus
}
#endif

View file

@ -1191,6 +1191,13 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoWindowId(JNIEnv*
,jobject thiz
,jlong lc
,jobject obj) {
jobject oldWindow = (jobject) linphone_core_get_native_video_window_id((LinphoneCore*)lc);
if (oldWindow != NULL) {
env->DeleteGlobalRef(oldWindow);
}
if (obj != NULL) {
obj = env->NewGlobalRef(obj);
}
linphone_core_set_native_video_window_id((LinphoneCore*)lc,(unsigned long)obj);
}
@ -1198,6 +1205,13 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPreviewWindowId(JNIEn
,jobject thiz
,jlong lc
,jobject obj) {
jobject oldWindow = (jobject) linphone_core_get_native_preview_window_id((LinphoneCore*)lc);
if (oldWindow != NULL) {
env->DeleteGlobalRef(oldWindow);
}
if (obj != NULL) {
obj = env->NewGlobalRef(obj);
}
linphone_core_set_native_preview_window_id((LinphoneCore*)lc,(unsigned long)obj);
}
@ -1394,8 +1408,10 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateAllCalls(JNIEnv *env,jobject thiz,jlong pCore) {
linphone_core_terminate_all_calls((LinphoneCore *) pCore);
}
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCall(JNIEnv *env,jobject thiz,jlong pCore,jint position) {
return (jlong)ms_list_nth_data(linphone_core_get_calls((LinphoneCore *) pCore),position);
extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getCall(JNIEnv *env,jobject thiz,jlong pCore,jint position) {
LinphoneCoreData *lcd=(LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)pCore);
LinphoneCall* lCall = (LinphoneCall*) ms_list_nth_data(linphone_core_get_calls((LinphoneCore *) pCore),position);
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));
@ -1420,11 +1436,12 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setZrtpSecretsCache(JNIE
}
}
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findCallFromUri(JNIEnv *env,jobject thiz,jlong pCore, jstring jUri) {
extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_findCallFromUri(JNIEnv *env,jobject thiz,jlong pCore, jstring jUri) {
const char* cUri=env->GetStringUTFChars(jUri, NULL);
const LinphoneCall *call=linphone_core_find_call_from_uri((LinphoneCore *) pCore,cUri);
LinphoneCall *call= (LinphoneCall *) linphone_core_find_call_from_uri((LinphoneCore *) pCore,cUri);
env->ReleaseStringUTFChars(jUri, cUri);
return (jlong) call;
LinphoneCoreData *lcdata=(LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)pCore);
return (jobject) lcdata->getCall(env,call);
}
@ -1489,5 +1506,10 @@ extern "C" void msandroid_hack_speaker_state(bool speakerOn);
extern "C" void Java_org_linphone_LinphoneManager_hackSpeakerState(JNIEnv* env,jobject thiz,jboolean speakerOn){
msandroid_hack_speaker_state(speakerOn);
// End Galaxy S hack functions
}
// End Galaxy S hack functions
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMaxCalls(JNIEnv *env,jobject thiz,jlong pCore) {
return (jint) linphone_core_get_max_calls((LinphoneCore *) pCore);
}

View file

@ -43,6 +43,10 @@
#define PACKAGE_SOUND_DIR "."
#endif
#ifndef PACKAGE_DATA_DIR
#define PACKAGE_DATA_DIR "."
#endif
#ifdef HAVE_GETTEXT
#include <libintl.h>
#ifndef _
@ -102,7 +106,7 @@ struct _LinphoneCall
bool_t all_muted; /*this flag is set during early medias*/
bool_t playing_ringbacktone;
bool_t owns_call_log;
bool_t pad;
bool_t ringing_beep; /* whether this call is ringing through an already existent current call*/
OrtpEvQueue *audiostream_app_evq;
char *auth_token;
OrtpEvQueue *videostream_app_evq;
@ -226,6 +230,8 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, LinphonePro
void linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call);
extern SalCallbacks linphone_sal_callbacks;
void linphone_proxy_config_set_error(LinphoneProxyConfig *cfg, LinphoneReason error);
bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc);
struct _LinphoneProxyConfig
{
@ -398,6 +404,7 @@ struct _LinphoneConference{
MSAudioConference *conf;
AudioStream *local_participant;
MSAudioEndpoint *local_endpoint;
bool_t local_muted;
};
typedef struct _LinphoneConference LinphoneConference;
@ -464,6 +471,7 @@ struct _LinphoneCore
bool_t use_preview_window;
int device_rotation;
bool_t ringstream_autorelease;
int max_calls;
};
bool_t linphone_core_can_we_add_call(LinphoneCore *lc);
@ -512,6 +520,8 @@ void linphone_core_preempt_sound_resources(LinphoneCore *lc);
void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t muted);
void linphone_call_add_to_conf(LinphoneCall *call);
void linphone_call_remove_from_conf(LinphoneCall *call);
void linphone_core_conference_check_uninit(LinphoneConference *ctx);
bool_t linphone_core_sound_resources_available(LinphoneCore *lc);
#define HOLD_OFF (0)
#define HOLD_ON (1)

View file

@ -31,10 +31,15 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org)
void linphone_proxy_config_write_all_to_config_file(LinphoneCore *lc){
MSList *elem;
int i;
if (!linphone_core_ready(lc)) return;
for(elem=lc->sip_conf.proxies,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
linphone_proxy_config_write_to_config_file(lc->config,cfg,i);
}
/*to ensure removed configs are erased:*/
linphone_proxy_config_write_to_config_file(lc->config,NULL,i);
lp_config_set_int(lc->config,"sip","default_proxy",linphone_core_get_default_proxy(lc,NULL));
}
void linphone_proxy_config_init(LinphoneProxyConfig *obj){
@ -536,6 +541,7 @@ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cf
if (lc->default_proxy==cfg){
lc->default_proxy=NULL;
}
linphone_proxy_config_write_all_to_config_file(lc);
}
/**
* Erase all proxies from config.
@ -548,6 +554,7 @@ void linphone_core_clear_proxy_config(LinphoneCore *lc){
linphone_core_remove_proxy_config(lc,(LinphoneProxyConfig *)list->data);
}
ms_list_free(list);
linphone_proxy_config_write_all_to_config_file(lc);
}
/**
* Sets the default proxy.
@ -566,7 +573,8 @@ void linphone_core_set_default_proxy(LinphoneCore *lc, LinphoneProxyConfig *conf
}
}
lc->default_proxy=config;
if (linphone_core_ready(lc))
lp_config_set_int(lc->config,"sip","default_proxy",linphone_core_get_default_proxy(lc,NULL));
}
void linphone_core_set_default_proxy_index(LinphoneCore *lc, int index){

View file

@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define sal_h
#include "mediastreamer2/mscommon.h"
#include "ortp/ortp_srtp.h"
/*Dirty hack, keep in sync with mediastreamer2/include/mediastream.h */
#ifndef PAYLOAD_TYPE_FLAG_CAN_RECV

View file

@ -541,13 +541,16 @@ int sal_call_set_local_media_description(SalOp *h, SalMediaDescription *desc){
int sal_call(SalOp *h, const char *from, const char *to){
int err;
const char *route;
osip_message_t *invite=NULL;
sal_op_set_from(h,from);
sal_op_set_to(h,to);
sal_exosip_fix_route(h);
err=eXosip_call_build_initial_invite(&invite,to,from,sal_op_get_route(h),"Phone call");
route = sal_op_get_route(h);
err=eXosip_call_build_initial_invite(&invite,to,from,route,"Phone call");
if (err!=0){
ms_error("Could not create call.");
ms_error("Could not create call. Error %d (from=%s to=%s route=%s)",
err, from, to, route);
return -1;
}
osip_message_set_allow(invite, "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO");
@ -574,7 +577,7 @@ int sal_call(SalOp *h, const char *from, const char *to){
eXosip_unlock();
h->cid=err;
if (err<0){
ms_error("Fail to send invite !");
ms_error("Fail to send invite ! Error code %d", err);
return -1;
}else{
sal_add_call(h->base.root,h);
@ -810,6 +813,7 @@ static void pop_auth_from_exosip() {
int sal_call_terminate(SalOp *h){
int err;
if (h == NULL) return -1;
if (h->auth_info) push_auth_to_exosip(h->auth_info);
eXosip_lock();
err=eXosip_call_terminate(h->cid,h->did);

View file

@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ortp/b64.h"
#include "ortp/ortp_srtp.h"
#include "sal.h"
#include <eXosip2/eXosip.h>

View file

@ -45,6 +45,7 @@ linphone_SOURCES= \
incall_view.c \
loginframe.c \
singleinstance.c \
conference.c \
linphone.h
linphone_LDADD=$(ORTP_LIBS) \

View file

@ -23,9 +23,118 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "linphone.h"
#include "linphone.h"
#define PADDING_PIXELS 4
static GtkWidget *create_conference_label(void){
GtkWidget *box=gtk_hbox_new(FALSE,0);
gtk_box_pack_start(GTK_BOX(box),gtk_image_new_from_stock(GTK_STOCK_ADD,GTK_ICON_SIZE_MENU),FALSE,FALSE,0);
gtk_box_pack_end(GTK_BOX(box),gtk_label_new(_("Conference")),TRUE,FALSE,0);
gtk_widget_show_all(box);
return box;
}
static void init_local_participant(GtkWidget *participant){
GtkWidget *sound_meter;
GtkWidget *button=linphone_gtk_get_widget(participant,"conference_control");
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(participant,"callee_name_label")),_("Me"));
sound_meter=linphone_gtk_get_widget(participant,"sound_indicator");
linphone_gtk_enable_mute_button(GTK_BUTTON(button),TRUE);
g_signal_connect(G_OBJECT(button),"clicked",(GCallback)linphone_gtk_mute_clicked,NULL);
gtk_widget_show(button);
linphone_gtk_init_audio_meter(sound_meter, (get_volume_t) linphone_core_get_conference_local_input_volume, linphone_gtk_get_core());
}
static GtkWidget *get_conference_tab(GtkWidget *mw){
GtkWidget *box=(GtkWidget*)g_object_get_data(G_OBJECT(mw),"conference_tab");
if (box==NULL){
GtkWidget *box=gtk_vbox_new(FALSE,0);
GtkWidget *participant=linphone_gtk_create_widget("main","callee_frame");
gtk_box_set_homogeneous(GTK_BOX(box),TRUE);
init_local_participant(participant);
gtk_box_pack_start(GTK_BOX(box),participant,FALSE,FALSE,PADDING_PIXELS);
gtk_widget_show(box);
g_object_set_data(G_OBJECT(mw),"conference_tab",box);
gtk_notebook_append_page(GTK_NOTEBOOK(linphone_gtk_get_widget(mw,"viewswitch")),box,
create_conference_label());
}
return box;
}
static GtkWidget *find_conferencee_from_call(LinphoneCall *call){
GtkWidget *mw=linphone_gtk_get_main_window();
GtkWidget *tab=get_conference_tab(mw);
GList *elem;
GtkWidget *ret=NULL;
if (call!=NULL){
GList *l=gtk_container_get_children(GTK_CONTAINER(tab));
for(elem=l;elem!=NULL;elem=elem->next){
GtkWidget *frame=(GtkWidget*)elem->data;
if (call==g_object_get_data(G_OBJECT(frame),"call")){
ret=frame;
break;
}
}
g_list_free(l);
}
//g_message("find_conferencee_from_call(): found widget %p for call %p",ret,call);
return ret;
}
void linphone_gtk_set_in_conference(LinphoneCall *call){
GtkWidget *mw=linphone_gtk_get_main_window();
GtkWidget *participant=find_conferencee_from_call(call);
if (participant==NULL){
GtkWidget *tab=get_conference_tab(mw);
const LinphoneAddress *addr=linphone_call_get_remote_address(call);
participant=linphone_gtk_create_widget("main","callee_frame");
GtkWidget *sound_meter;
GtkWidget *viewswitch=linphone_gtk_get_widget(mw,"viewswitch");
gchar *markup;
if (linphone_address_get_display_name(addr)!=NULL){
markup=g_strdup_printf("<b>%s</b>",linphone_address_get_display_name(addr));
}else{
char *tmp=linphone_address_as_string_uri_only(addr);
markup=g_strdup_printf("%s",tmp);
ms_free(tmp);
}
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(participant,"callee_name_label")),markup);
g_free(markup);
sound_meter=linphone_gtk_get_widget(participant,"sound_indicator");
linphone_gtk_init_audio_meter(sound_meter, (get_volume_t) linphone_call_get_play_volume, call);
gtk_box_pack_start(GTK_BOX(tab),participant,FALSE,FALSE,PADDING_PIXELS);
g_object_set_data_full(G_OBJECT(participant),"call",linphone_call_ref(call),(GDestroyNotify)linphone_call_unref);
gtk_widget_show(participant);
gtk_notebook_set_current_page(GTK_NOTEBOOK(viewswitch),
gtk_notebook_page_num(GTK_NOTEBOOK(viewswitch),tab));
}
}
void linphone_gtk_terminate_conference_participant(LinphoneCall *call){
GtkWidget *frame=find_conferencee_from_call(call);
if (frame){
gtk_widget_set_sensitive(frame,FALSE);
}
}
void linphone_gtk_unset_from_conference(LinphoneCall *call){
GtkWidget *mw=linphone_gtk_get_main_window();
GtkWidget *box=(GtkWidget*)g_object_get_data(G_OBJECT(mw),"conference_tab");
GtkWidget *frame=find_conferencee_from_call(call);
GList *children;
if (frame){
gtk_widget_destroy(frame);
}
children=gtk_container_get_children(GTK_CONTAINER(box));
if (g_list_length(children)==1){
/*the conference is terminated */
gtk_widget_destroy(box);
g_object_set_data(G_OBJECT(mw),"conference_tab",NULL);
}
g_list_free(children);
}

View file

@ -36,11 +36,12 @@ gboolean linphone_gtk_use_in_call_view(){
return val;
}
LinphoneCall *linphone_gtk_get_currently_displayed_call(){
LinphoneCall *linphone_gtk_get_currently_displayed_call(gboolean *is_conf){
LinphoneCore *lc=linphone_gtk_get_core();
GtkWidget *main_window=linphone_gtk_get_main_window ();
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
const MSList *calls=linphone_core_get_calls(lc);
if (is_conf) *is_conf=FALSE;
if (!linphone_gtk_use_in_call_view() || ms_list_size(calls)==1){
if (calls) return (LinphoneCall*)calls->data;
}else{
@ -48,6 +49,13 @@ LinphoneCall *linphone_gtk_get_currently_displayed_call(){
GtkWidget *page=gtk_notebook_get_nth_page(notebook,idx);
if (page!=NULL){
LinphoneCall *call=(LinphoneCall*)g_object_get_data(G_OBJECT(page),"call");
if (call==NULL){
if (page==g_object_get_data(G_OBJECT(main_window),"conference_tab")){
if (is_conf)
*is_conf=TRUE;
return NULL;
}
}
return call;
}
}
@ -94,8 +102,8 @@ static void linphone_gtk_in_call_set_animation_spinner(GtkWidget *callview){
static void linphone_gtk_transfer_call(LinphoneCall *dest_call){
LinphoneCall *call=linphone_gtk_get_currently_displayed_call();
linphone_core_transfer_call_to_another (linphone_gtk_get_core(),call,dest_call);
LinphoneCall *call=linphone_gtk_get_currently_displayed_call(NULL);
if (call) linphone_core_transfer_call_to_another(linphone_gtk_get_core(),call,dest_call);
}
static void transfer_button_clicked(GtkWidget *button, gpointer call_ref){
@ -140,6 +148,7 @@ void linphone_gtk_enable_transfer_button(LinphoneCore *lc, gboolean value){
button=NULL;
}else if (!button && value==TRUE){
button=gtk_button_new_with_label (_("Transfer"));
//gtk_button_set_image_position(GTK_BUTTON(button),GTK_POS_BOTTOM);
gtk_button_set_image(GTK_BUTTON(button),gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD,GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(button),"clicked",(GCallback)transfer_button_clicked,call);
gtk_widget_show_all(button);
@ -150,7 +159,9 @@ void linphone_gtk_enable_transfer_button(LinphoneCore *lc, gboolean value){
}
static void conference_button_clicked(GtkWidget *button, gpointer call_ref){
linphone_core_add_all_to_conference(linphone_gtk_get_core());
//linphone_core_add_to_conference(linphone_gtk_get_core(),(LinphoneCall*)call_ref);
gtk_widget_set_sensitive(button,FALSE);
}
void linphone_gtk_enable_conference_button(LinphoneCore *lc, gboolean value){
@ -165,6 +176,7 @@ void linphone_gtk_enable_conference_button(LinphoneCore *lc, gboolean value){
button=NULL;
}else if (!button && value==TRUE){
button=gtk_button_new_with_label (_("Conference"));
//gtk_button_set_image_position(GTK_BUTTON(button),GTK_POS_BOTTOM);
gtk_button_set_image(GTK_BUTTON(button),gtk_image_new_from_stock (GTK_STOCK_ADD,GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(button),"clicked",(GCallback)conference_button_clicked,call);
gtk_widget_show_all(button);
@ -204,14 +216,29 @@ void linphone_gtk_remove_in_call_view(LinphoneCall *call){
GtkWidget *w=(GtkWidget*)linphone_call_get_user_pointer (call);
GtkWidget *main_window=linphone_gtk_get_main_window ();
GtkWidget *nb=linphone_gtk_get_widget(main_window,"viewswitch");
gboolean in_conf=linphone_call_params_local_conference_mode(linphone_call_get_current_params(call));
int idx;
g_return_if_fail(w!=NULL);
idx=gtk_notebook_page_num(GTK_NOTEBOOK(nb),w);
gtk_notebook_remove_page (GTK_NOTEBOOK(nb),idx);
gtk_widget_destroy(w);
if (in_conf){
linphone_gtk_unset_from_conference(call);
}
linphone_call_set_user_pointer (call,NULL);
linphone_call_unref(call);
gtk_notebook_set_current_page(GTK_NOTEBOOK(nb), 0);
call=linphone_core_get_current_call(linphone_gtk_get_core());
if (call==NULL){
if (linphone_core_is_in_conference(linphone_gtk_get_core())){
/*show the conference*/
gtk_notebook_set_current_page(GTK_NOTEBOOK(nb),gtk_notebook_page_num(GTK_NOTEBOOK(nb),
g_object_get_data(G_OBJECT(main_window),"conference_tab")));
}else gtk_notebook_set_current_page(GTK_NOTEBOOK(nb), 0);
}else{
/*show the active call*/
gtk_notebook_set_current_page(GTK_NOTEBOOK(nb),gtk_notebook_page_num(GTK_NOTEBOOK(nb),
linphone_call_get_user_pointer(call)));
}
}
static void display_peer_name_in_label(GtkWidget *label, const LinphoneAddress *from){
@ -319,7 +346,7 @@ static gboolean linphone_gtk_in_call_view_refresh(LinphoneCall *call){
return TRUE;
}
typedef float (*get_volume_t)(void *data);
typedef struct _volume_ctx{
GtkWidget *widget;
@ -363,7 +390,15 @@ void linphone_gtk_init_audio_meter(GtkWidget *w, get_volume_t get_volume, void *
}
}
void linphone_gtk_in_call_view_enable_audio_view(LinphoneCall *call){
void linphone_gtk_uninit_audio_meter(GtkWidget *w){
guint task_id=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"task_id"));
if (task_id!=0){
g_object_set_data(G_OBJECT(w),"ctx",NULL);
g_object_set_data(G_OBJECT(w),"task_id",NULL);
}
}
void linphone_gtk_in_call_view_enable_audio_view(LinphoneCall *call, gboolean val){
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
GtkWidget *audio_view=linphone_gtk_get_widget(callview,"incall_audioview");
//GtkWidget *mic=linphone_gtk_get_widget(callview,"incall_mic_icon");
@ -373,11 +408,17 @@ void linphone_gtk_in_call_view_enable_audio_view(LinphoneCall *call){
GdkPixbuf *pbuf;
//gtk_image_set_from_pixbuf(GTK_IMAGE(mic),(pbuf=create_pixbuf("mic_active.png")));
//g_object_unref(pbuf);
gtk_image_set_from_pixbuf(GTK_IMAGE(spk),(pbuf=create_pixbuf("speaker.png")));
g_object_unref(pbuf);
linphone_gtk_init_audio_meter(mic_level,(get_volume_t)linphone_call_get_record_volume,call);
linphone_gtk_init_audio_meter(spk_level,(get_volume_t)linphone_call_get_play_volume,call);
gtk_widget_show_all(audio_view);
if (val){
gtk_image_set_from_pixbuf(GTK_IMAGE(spk),(pbuf=create_pixbuf("speaker.png")));
g_object_unref(pbuf);
linphone_gtk_init_audio_meter(mic_level,(get_volume_t)linphone_call_get_record_volume,call);
linphone_gtk_init_audio_meter(spk_level,(get_volume_t)linphone_call_get_play_volume,call);
gtk_widget_show_all(audio_view);
}else{
linphone_gtk_uninit_audio_meter(mic_level);
linphone_gtk_uninit_audio_meter(spk_level);
gtk_widget_hide(audio_view);
}
}
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
@ -386,22 +427,24 @@ void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
gboolean in_conf=linphone_call_params_local_conference_mode(linphone_call_get_current_params(call));
display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
gtk_widget_show(linphone_gtk_get_widget(callview,"mute_pause_buttons"));
gtk_widget_set_visible(linphone_gtk_get_widget(callview,"mute_pause_buttons"),!in_conf);
gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
gtk_label_set_markup(GTK_LABEL(status),_("<b>In call</b>"));
gtk_label_set_markup(GTK_LABEL(status),in_conf ? _("In conference") : _("<b>In call</b>"));
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
linphone_gtk_in_call_set_animation_image(callview,GTK_STOCK_MEDIA_PLAY,TRUE);
linphone_gtk_enable_mute_button(
GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),TRUE);
GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),!in_conf);
if (taskid==0){
taskid=g_timeout_add(250,(GSourceFunc)linphone_gtk_in_call_view_refresh,call);
g_object_set_data(G_OBJECT(callview),"taskid",GINT_TO_POINTER(taskid));
}
linphone_gtk_in_call_view_enable_audio_view(call);
linphone_gtk_in_call_view_enable_audio_view(call, !in_conf);
if (in_conf) linphone_gtk_set_in_conference(call);
}
void linphone_gtk_in_call_view_set_paused(LinphoneCall *call){
@ -433,6 +476,7 @@ void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_m
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
gboolean in_conf=linphone_call_params_local_conference_mode(linphone_call_get_current_params(call));
if (error_msg==NULL)
gtk_label_set_markup(GTK_LABEL(status),_("<b>Call ended.</b>"));
@ -449,8 +493,11 @@ void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_m
linphone_gtk_enable_mute_button(
GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),FALSE);
linphone_gtk_enable_hold_button(call,FALSE,TRUE);
if (taskid!=0) g_source_remove(taskid);
g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,call);
if (in_conf)
linphone_gtk_terminate_conference_participant(call);
}
void linphone_gtk_draw_mute_button(GtkButton *button, gboolean active){
@ -506,7 +553,8 @@ void linphone_gtk_draw_hold_button(GtkButton *button, gboolean active){
void linphone_gtk_hold_clicked(GtkButton *button){
int active=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),"active"));
LinphoneCall *call=linphone_gtk_get_currently_displayed_call ();
LinphoneCall *call=linphone_gtk_get_currently_displayed_call(NULL);
if (!call) return;
if(!active)
{
linphone_core_pause_call(linphone_gtk_get_core(),call);

View file

@ -96,7 +96,7 @@ void linphone_gtk_show_directory_search(void);
/*functions controlling the different views*/
gboolean linphone_gtk_use_in_call_view();
LinphoneCall *linphone_gtk_get_currently_displayed_call();
LinphoneCall *linphone_gtk_get_currently_displayed_call(gboolean *is_conf);
void linphone_gtk_create_in_call_view(LinphoneCall *call);
void linphone_gtk_in_call_view_set_calling(LinphoneCall *call);
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call);
@ -104,10 +104,16 @@ void linphone_gtk_in_call_view_update_duration(LinphoneCall *call);
void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg);
void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call);
void linphone_gtk_in_call_view_set_paused(LinphoneCall *call);
void linphone_gtk_mute_clicked(GtkButton *button);
void linphone_gtk_enable_mute_button(GtkButton *button, gboolean sensitive);
void linphone_gtk_enable_hold_button(LinphoneCall *call, gboolean sensitive, gboolean holdon);
void linphone_gtk_enable_transfer_button(LinphoneCore *lc, gboolean value);
void linphone_gtk_enable_conference_button(LinphoneCore *lc, gboolean value);
void linphone_gtk_set_in_conference(LinphoneCall *call);
void linphone_gtk_unset_from_conference(LinphoneCall *call);
void linphone_gtk_terminate_conference_participant(LinphoneCall *call);
typedef float (*get_volume_t)(void *data);
void linphone_gtk_init_audio_meter(GtkWidget *w, get_volume_t get_volume, void *data);
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg);
void linphone_gtk_exit_login_frame(void);

View file

@ -719,7 +719,7 @@ void linphone_gtk_start_call(GtkWidget *w){
GtkWidget *mw=gtk_widget_get_toplevel(w);
GtkWidget *uri_bar=linphone_gtk_get_widget(mw,"uribar");
call=linphone_gtk_get_currently_displayed_call();
call=linphone_gtk_get_currently_displayed_call(NULL);
if (call!=NULL && linphone_call_get_state(call)==LinphoneCallIncomingReceived){
linphone_core_accept_call(lc,call);
}else{
@ -737,21 +737,24 @@ void linphone_gtk_uri_bar_activate(GtkWidget *w){
void linphone_gtk_terminate_call(GtkWidget *button){
LinphoneCall *call=linphone_gtk_get_currently_displayed_call ();
if (call)
gboolean is_conf;
LinphoneCall *call=linphone_gtk_get_currently_displayed_call(&is_conf);
if (call){
linphone_core_terminate_call(linphone_gtk_get_core(),call);
}else if (is_conf){
linphone_core_terminate_conference(linphone_gtk_get_core());
}
}
void linphone_gtk_decline_clicked(GtkWidget *button){
LinphoneCall *call=linphone_gtk_get_currently_displayed_call ();
LinphoneCall *call=linphone_gtk_get_currently_displayed_call(NULL);
if (call)
linphone_core_terminate_call(linphone_gtk_get_core(),call);
}
void linphone_gtk_answer_clicked(GtkWidget *button){
LinphoneCall *call=linphone_gtk_get_currently_displayed_call ();
LinphoneCall *call=linphone_gtk_get_currently_displayed_call(NULL);
if (call){
linphone_core_pause_all_calls(linphone_gtk_get_core());
linphone_core_accept_call(linphone_gtk_get_core(),call);
linphone_gtk_show_main_window(); /* useful when the button is clicked on a notification */
}

View file

@ -20,9 +20,37 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkProgressBar" id="sound_indicator">
<object class="GtkHBox" id="conf_hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="callee_name_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Callee name&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="justify">right</property>
<property name="ellipsize">end</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="conference_control">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
@ -31,33 +59,25 @@
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkButton" id="hangup_button">
<object class="GtkProgressBar" id="sound_indicator">
<property name="width_request">170</property>
<property name="height_request">30</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_conf_hangup_clicked" swapped="no"/>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="callee_name_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Callee name&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<child type="label_item">
<placeholder/>
</child>
</object>
</child>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">500</property>
<property name="upper">3001</property>
@ -41,6 +40,13 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment7">
<property name="lower">1</property>
<property name="upper">65535</property>
<property name="value">5060</property>
<property name="step_increment">1</property>
<property name="page_increment">9.9999999995529656</property>
</object>
<object class="GtkAdjustment" id="adjustment_tcp_port">
<property name="upper">65535</property>
<property name="value">1</property>
@ -127,6 +133,23 @@
</row>
</data>
</object>
<object class="GtkListStore" id="model8">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">SIP (UDP)</col>
</row>
<row>
<col id="0" translatable="yes">SIP (TCP)</col>
</row>
<row>
<col id="0" translatable="yes">SIP (TLS)</col>
</row>
</data>
</object>
<object class="GtkWindow" id="parameters">
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@ -190,8 +213,6 @@
<property name="can_focus">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">adjustment1</property>
<signal name="value-changed" handler="linphone_gtk_mtu_changed" swapped="no"/>
</object>
@ -275,134 +296,120 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTable" id="table1">
<object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="can_focus">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="n_rows">4</property>
<property name="n_columns">2</property>
<child>
<object class="GtkSpinButton" id="video_rtp_port">
<property name="visible">True</property>
<property name="can_focus">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="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">adjustment2</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">3</property>
<property name="bottom_attach">4</property>
</packing>
<placeholder/>
</child>
<child>
<object class="GtkSpinButton" id="audio_rtp_port">
<property name="visible">True</property>
<property name="can_focus">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="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">adjustment3</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">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="tcp_sip_port">
<property name="visible">True</property>
<property name="can_focus">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="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_tcp_port</property>
<signal name="value-changed" handler="linphone_gtk_tcp_sip_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="udp_sip_port">
<property name="visible">True</property>
<property name="can_focus">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="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">adjustment4</property>
<signal name="value-changed" handler="linphone_gtk_udp_sip_port_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="can_focus">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="label" translatable="yes">Video RTP/UDP:</property>
<property name="justify">right</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<child>
<object class="GtkComboBox" id="proto_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">model8</property>
<signal name="changed" handler="linphone_gtk_proto_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="renderer1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkSpinButton" id="proto_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="adjustment">adjustment7</property>
<signal name="value-changed" handler="linphone_gtk_update_my_port" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_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="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</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="adjustment">adjustment2</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">1</property>
<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="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</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="adjustment">adjustment3</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">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">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="label" translatable="yes">Video RTP/UDP:</property>
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">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="label" translatable="yes">Audio RTP/UDP:</property>
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">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="label" translatable="yes">Audio RTP/UDP:</property>
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_tcp_port">
<property name="visible">True</property>
<property name="can_focus">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="label" translatable="yes">SIP (TCP):</property>
<property name="justify">right</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">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="label" translatable="yes">SIP (UDP):</property>
<property name="justify">right</property>
</object>
</child>
</object>
</child>
</object>
@ -412,7 +419,7 @@
<property name="visible">True</property>
<property name="can_focus">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="label" translatable="yes">&lt;b&gt;Ports&lt;/b&gt;</property>
<property name="label" translatable="yes">&lt;b&gt;Network protocol and ports&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
@ -499,8 +506,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</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>
<signal name="changed" handler="linphone_gtk_nat_address_changed" swapped="no"/>
</object>
<packing>
@ -571,8 +576,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</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>
<signal name="changed" handler="linphone_gtk_stun_server_changed" swapped="no"/>
</object>
<packing>
@ -740,8 +743,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</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>
<signal name="editing-done" handler="linphone_gtk_alsa_special_device_changed" swapped="no"/>
</object>
<packing>
@ -760,7 +761,7 @@
<property name="model">model1</property>
<signal name="changed" handler="linphone_gtk_capture_device_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="renderer1"/>
<object class="GtkCellRendererText" id="renderer2"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
@ -782,7 +783,7 @@
<property name="model">model2</property>
<signal name="changed" handler="linphone_gtk_ring_device_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="renderer2"/>
<object class="GtkCellRendererText" id="renderer3"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
@ -858,7 +859,7 @@
<property name="model">model3</property>
<signal name="changed" handler="linphone_gtk_playback_device_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="renderer3"/>
<object class="GtkCellRendererText" id="renderer4"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
@ -946,7 +947,7 @@
<property name="model">model4</property>
<signal name="changed" handler="linphone_gtk_cam_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="renderer4"/>
<object class="GtkCellRendererText" id="renderer5"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
@ -977,7 +978,7 @@
<property name="active">0</property>
<signal name="changed" handler="linphone_gtk_video_size_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="renderer5"/>
<object class="GtkCellRendererText" id="renderer6"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
@ -1092,8 +1093,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</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>
<signal name="changed" handler="linphone_gtk_update_my_contact" swapped="no"/>
</object>
<packing>
@ -1132,8 +1131,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</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>
<signal name="changed" handler="linphone_gtk_update_my_contact" swapped="no"/>
</object>
<packing>
@ -1151,8 +1148,6 @@
<property name="editable">False</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>
</object>
<packing>
<property name="left_attach">1</property>
@ -1204,13 +1199,14 @@
<property name="visible">True</property>
<property name="can_focus">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="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="proxy_list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</object>
</child>
</object>
@ -1600,7 +1596,7 @@ virtual network !</property>
<property name="active">0</property>
<signal name="changed" handler="linphone_gtk_codec_view_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="renderer6"/>
<object class="GtkCellRendererText" id="renderer7"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
@ -1622,8 +1618,6 @@ virtual network !</property>
<property name="visible">True</property>
<property name="can_focus">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="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">out</property>
<child>
<object class="GtkTreeView" id="codec_list">
@ -1631,6 +1625,9 @@ virtual network !</property>
<property name="can_focus">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="has_tooltip">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2"/>
</child>
</object>
</child>
</object>
@ -1827,7 +1824,7 @@ virtual network !</property>
<property name="visible">True</property>
<property name="can_focus">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="n_rows">2</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<child>
<object class="GtkSpinButton" id="upload_bw">
@ -1837,8 +1834,6 @@ virtual network !</property>
<property name="tooltip_text" translatable="yes">0 stands for "unlimited"</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">adjustment5</property>
<signal name="value-changed" handler="linphone_gtk_upload_bw_changed" swapped="no"/>
</object>
@ -1847,6 +1842,8 @@ virtual network !</property>
<property name="right_attach">2</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>
</packing>
</child>
<child>
@ -1857,14 +1854,14 @@ virtual network !</property>
<property name="tooltip_text" translatable="yes">0 stands for "unlimited"</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">adjustment6</property>
<signal name="value-changed" handler="linphone_gtk_download_bw_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
<child>
@ -1889,6 +1886,41 @@ virtual network !</property>
<property name="justify">right</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="adaptive_rate_control">
<property name="label" translatable="yes">Enable adaptive rate control</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"/>
</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>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;i&gt;Adaptive rate control is a technique to dynamically guess the available bandwidth during a call.&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
</object>
</child>
</object>
@ -1973,7 +2005,7 @@ virtual network !</property>
<property name="model">model7</property>
<signal name="changed" handler="linphone_gtk_lang_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="renderer7"/>
<object class="GtkCellRendererText" id="renderer9"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>

View file

@ -33,7 +33,7 @@ static void linphone_gtk_fill_combo_box(GtkWidget *combo, const char **devices,
This dummy text needs to be removed first*/
gtk_combo_box_remove_text(GTK_COMBO_BOX(combo),0);
for(;*p!=NULL;++p){
if ( cap==CAP_IGNORE
if ( cap==CAP_IGNORE
|| (cap==CAP_CAPTURE && linphone_core_sound_device_can_capture(linphone_gtk_get_core(),*p))
|| (cap==CAP_PLAYBACK && linphone_core_sound_device_can_playback(linphone_gtk_get_core(),*p)) ){
gtk_combo_box_append_text(GTK_COMBO_BOX(combo),*p);
@ -87,6 +87,49 @@ void linphone_gtk_update_my_contact(GtkWidget *w){
linphone_gtk_load_identities();
}
void linphone_gtk_update_my_port(GtkWidget *w){
GtkWidget *pb=gtk_widget_get_toplevel(GTK_WIDGET(w));
LCSipTransports tr;
LinphoneCore *lc=linphone_gtk_get_core();
GtkComboBox *combo = GTK_COMBO_BOX(linphone_gtk_get_widget(pb, "proto_combo"));
gint port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
if (port == 1) { // We use default port if not specified
if (strcmp(gtk_combo_box_get_active_text(combo), "SIP (UDP)") == 0) {
gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
5060);
}
else if (strcmp(gtk_combo_box_get_active_text(combo), "SIP (TCP)") == 0) {
gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
5060);
}
else if (strcmp(gtk_combo_box_get_active_text(combo), "SIP (TLS)") == 0) {
gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
5061);
}
}
linphone_core_get_sip_transports(lc,&tr);
gchar *selected = gtk_combo_box_get_active_text(combo);
if (strcmp(selected, "SIP (TCP)") == 0) {
tr.tcp_port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
tr.udp_port = 0;
tr.tls_port = 0;
}
else if (strcmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(linphone_gtk_get_widget(pb, "proto_combo"))), "SIP (UDP)") == 0) {
tr.udp_port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
tr.tcp_port = 0;
tr.tls_port = 0;
}
else if (strcmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(linphone_gtk_get_widget(pb, "proto_combo"))), "SIP (TLS)") == 0){
tr.udp_port = 0;
tr.tcp_port = 0;
tr.tls_port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
}
linphone_core_set_sip_transports(lc,&tr);
}
void linphone_gtk_stun_server_changed(GtkWidget *w){
const gchar *addr=gtk_entry_get_text(GTK_ENTRY(w));
linphone_core_set_stun_server(linphone_gtk_get_core(),addr);
@ -102,24 +145,6 @@ void linphone_gtk_ipv6_toggled(GtkWidget *w){
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
}
void linphone_gtk_udp_sip_port_changed(GtkWidget *w){
LCSipTransports tr;
LinphoneCore *lc=linphone_gtk_get_core();
linphone_core_get_sip_transports(lc,&tr);
tr.udp_port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
linphone_core_set_sip_transports(lc,&tr);
}
void linphone_gtk_tcp_sip_port_changed(GtkWidget *w){
LCSipTransports tr;
LinphoneCore *lc=linphone_gtk_get_core();
linphone_core_get_sip_transports(lc,&tr);
tr.tcp_port = (gint)gtk_spin_button_get_value(GTK_SPIN_BUTTON(w));
linphone_core_set_sip_transports(lc,&tr);
}
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)));
@ -329,7 +354,7 @@ static void linphone_gtk_show_codecs(GtkTreeView *listview, const MSList *codecl
for(elem=codeclist; elem!=NULL; elem=elem->next){
gchar *status;
gint rate;
gfloat bitrate;
gfloat bitrate;
const gchar *color;
const char *params="";
@ -355,9 +380,9 @@ static void linphone_gtk_show_codecs(GtkTreeView *listview, const MSList *codecl
CODEC_INFO,(gpointer)linphone_core_get_payload_type_description(linphone_gtk_get_core(),pt),
-1);
}
/* Setup the selection handler */
selection = gtk_tree_view_get_selection (listview);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
@ -374,10 +399,10 @@ static void linphone_gtk_check_codec_bandwidth(GtkTreeView *v){
g_return_if_fail(gtk_tree_model_get_iter_first(model,&iter));
do{
PayloadType *pt=NULL;
gfloat bitrate;
gtk_tree_model_get(model,&iter,CODEC_PRIVDATA,&pt,-1);
bitrate=payload_type_get_bitrate(pt)/1000.0;
gtk_list_store_set(GTK_LIST_STORE(model),&iter,CODEC_COLOR, (gpointer)get_codec_color(linphone_gtk_get_core(),pt),
CODEC_BITRATE, bitrate,-1);
@ -397,7 +422,7 @@ static void linphone_gtk_select_codec(GtkTreeView *v, PayloadType *ref){
if (pt==ref){
gtk_tree_selection_select_iter(selection,&iter);
}
}while(gtk_tree_model_iter_next(model,&iter));
}
@ -428,6 +453,11 @@ void linphone_gtk_upload_bw_changed(GtkWidget *w){
linphone_gtk_check_codec_bandwidth(v);
}
void linphone_gtk_adaptive_rate_control_toggled(GtkToggleButton *button){
gboolean active=gtk_toggle_button_get_active(button);
linphone_core_enable_adaptive_rate_control(linphone_gtk_get_core(),active);
}
static void linphone_gtk_codec_move(GtkWidget *button, int dir){
GtkTreeView *v=GTK_TREE_VIEW(linphone_gtk_get_widget(gtk_widget_get_toplevel(button),"codec_list"));
GtkTreeSelection *sel=gtk_tree_view_get_selection(v);
@ -516,7 +546,7 @@ void linphone_gtk_show_sip_accounts(GtkWidget *w){
GtkTreeViewColumn *column;
/* create the proxy list */
store = gtk_list_store_new (PROXY_CONFIG_NCOL, G_TYPE_STRING, G_TYPE_POINTER);
gtk_tree_view_set_model(v,GTK_TREE_MODEL(store));
g_object_unref(G_OBJECT(store));
renderer = gtk_cell_renderer_text_new ();
@ -525,7 +555,7 @@ void linphone_gtk_show_sip_accounts(GtkWidget *w){
"text", PROXY_CONFIG_IDENTITY,
NULL);
gtk_tree_view_append_column (v, column);
select = gtk_tree_view_get_selection (v);
gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
model=GTK_TREE_MODEL(store);
@ -712,7 +742,7 @@ static void linphone_gtk_fill_langs(GtkWidget *pb){
name=lang_get_name(code);
snprintf(text,sizeof(text)-1,"%s : %s",code,name!=NULL ? _(name) : code);
gtk_combo_box_append_text(GTK_COMBO_BOX(combo),text);
if (cur_lang_index==-1 && lang_equals(cur_lang,code))
if (cur_lang_index==-1 && lang_equals(cur_lang,code))
cur_lang_index=index;
index++;
}
@ -743,6 +773,14 @@ void linphone_gtk_lang_changed(GtkComboBox *combo){
}
}
void linphone_gtk_proto_changed(GtkComboBox *combo){
GtkWidget *pb=gtk_widget_get_toplevel(GTK_WIDGET(combo));
GtkWidget *proto_port = linphone_gtk_get_widget(pb, "proto_port");
// When we change the network protocol, we call update_my_port to move the port number from the old protocol to the new one
linphone_gtk_update_my_port(proto_port);
}
static void linphone_gtk_ui_level_adapt(GtkWidget *top) {
gboolean ui_advanced;
const char *simple_ui = linphone_gtk_get_ui_config("simple_ui", "parameters.codec_tab parameters.transport_frame parameters.ports_frame");
@ -781,14 +819,28 @@ void linphone_gtk_show_parameters(void){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"ipv6_enabled")),
linphone_core_ipv6_enabled(lc));
linphone_core_get_sip_transports(lc,&tr);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"udp_sip_port")),
tr.udp_port);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"tcp_sip_port")),
if (tr.tcp_port > 0) {
gtk_combo_box_set_active(GTK_COMBO_BOX(linphone_gtk_get_widget(pb,"proto_combo")), 1);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"proto_port")),
tr.tcp_port);
}
else if (tr.tls_port > 0) {
gtk_combo_box_set_active(GTK_COMBO_BOX(linphone_gtk_get_widget(pb,"proto_combo")), 2);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"proto_port")),
tr.tls_port);
}
else {
gtk_combo_box_set_active(GTK_COMBO_BOX(linphone_gtk_get_widget(pb,"proto_combo")), 0);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"proto_port")),
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));
tmp=linphone_core_get_nat_address(lc);
if (tmp) gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"nat_address")),tmp);
tmp=linphone_core_get_stun_server(lc);
@ -852,7 +904,9 @@ void linphone_gtk_show_parameters(void){
linphone_core_get_download_bandwidth(lc));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"upload_bw")),
linphone_core_get_upload_bandwidth(lc));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"adaptive_rate_control")),
linphone_core_adaptive_rate_control_enabled(lc));
/* UI CONFIG */
linphone_gtk_fill_langs(pb);

View file

@ -621,4 +621,7 @@ public interface LinphoneCore {
void transferCallToAnother(LinphoneCall callToTransfer, LinphoneCall destination);
LinphoneCall findCallFromUri(String uri);
int getMaxCalls();
}

View file

@ -4,9 +4,18 @@ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([LP_CHECK_OSIP2])
case $target_os in
*darwin*)
OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation "
case $host_alias in
i386-apple*)
OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation -framework CFNetwork"
;;
armv6-apple*)
OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation -framework CFNetwork"
;;
armv7-apple*)
OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation -framework CFNetwork"
;;
x86_64-apple*)
OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation"
;;
esac

@ -1 +1 @@
Subproject commit a12854a1f99d56e08a78981fc3eec0181a5c1c0d
Subproject commit 98198b49dc5f4bd7f192e87b6abd88e5c1e08a3a

2
oRTP

@ -1 +1 @@
Subproject commit a4e50eedc1d6b6f8855d1c600b56b116e95c5060
Subproject commit 7606207905bd3dc661e68576097adce471916697

BIN
pixmaps/pausecall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

BIN
pixmaps/resumecall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,007 B

View file

@ -423,7 +423,7 @@ msgstr "Reprendre"
#: ../gtk/incall_view.c:347 ../gtk/main.ui.h:46
msgid "Pause"
msgstr "Mettre en attente"
msgstr "Pause"
#: ../gtk/loginframe.c:93
#, c-format

View file

@ -29,8 +29,13 @@ linphone_fd_DATA= linphone.desktop
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA=linphone.pc
linphonedir=$(datadir)/linphone
linphone_DATA=rootca.pem
EXTRA_DIST = $(LINPHONE_SOUNDS) \
$(LINPHONE_RINGS) \
linphone.desktop.in \
linphone.pc.in \
Makefile.inc
Makefile.inc \
rootca.pem

3965
share/rootca.pem Normal file

File diff suppressed because it is too large Load diff