forked from mirrors/linphone-iphone
Merge branch 'master' of git.linphone.org:linphone
This commit is contained in:
commit
ac4a6d3480
18 changed files with 292 additions and 86 deletions
26
README.mingw
26
README.mingw
|
|
@ -26,7 +26,7 @@ Download lastest linphone-deps-win32 zip from
|
|||
http://download.savannah.gnu.org/releases-noredirect/linphone/misc
|
||||
using your browser.
|
||||
|
||||
Download lastest gtk+ win32 bundle from http://www.gtk.org
|
||||
Download lastest gtk+2 win32 bundle from http://www.gtk.org
|
||||
|
||||
Install all these three package in /:
|
||||
|
||||
|
|
@ -65,20 +65,38 @@ WARNING: During the build, windows might slow down suddenly. Using ctl+alt+del t
|
|||
you might see a process 'LVpSRV.exe' or something like this that eats 90% of cpu.
|
||||
Kill it. Don't know what it is, but once killed, windows runs normally.
|
||||
|
||||
#Compile and install tunnel
|
||||
cd tunnel && ./autogen.sh && ./configure --prefix=/opt/linphone && make && make install
|
||||
#Compile and install tunnel (optional, available under proprietary licensing)
|
||||
|
||||
cd tunnel && ./autogen.sh && ./configure --prefix=/usr --enable-shared --disable-static && make && make install
|
||||
|
||||
#Build linphone itself:
|
||||
#run autogen.sh after a git checkout or update
|
||||
|
||||
./autogen.sh
|
||||
|
||||
./configure --prefix=/opt/linphone --enable-shared --disable-static
|
||||
#note: in order to use the tunnel, append --enable-tunnel to the configure line above.
|
||||
|
||||
#compile:
|
||||
|
||||
make
|
||||
#will install to /opt/linphone, required for compilation of plugins.
|
||||
|
||||
#now install to /opt/linphone, required for compilation of plugins.
|
||||
|
||||
make install
|
||||
|
||||
#make a binary zip of linphone
|
||||
|
||||
make zip
|
||||
|
||||
#additionally you can make binary installer if you have Inno Setup 5 installed in its default path
|
||||
|
||||
make setup.exe
|
||||
|
||||
#now you're done, you have a fresh linphone windows installer in the current directory.
|
||||
|
||||
|
||||
|
||||
#build plugins
|
||||
cd mediastreamer2/plugins/msx264
|
||||
./autogen.sh
|
||||
|
|
|
|||
|
|
@ -484,9 +484,18 @@ static void call_terminated(SalOp *op, const char *from){
|
|||
|
||||
if (call==NULL) return;
|
||||
|
||||
if (linphone_call_get_state(call)==LinphoneCallEnd || linphone_call_get_state(call)==LinphoneCallError){
|
||||
ms_warning("call_terminated: ignoring.");
|
||||
return;
|
||||
switch(linphone_call_get_state(call)){
|
||||
case LinphoneCallEnd:
|
||||
case LinphoneCallError:
|
||||
ms_warning("call_terminated: ignoring.");
|
||||
return;
|
||||
break;
|
||||
case LinphoneCallIncomingReceived:
|
||||
case LinphoneCallIncomingEarlyMedia:
|
||||
call->reason=LinphoneReasonNotAnswered;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ms_message("Current call terminated...");
|
||||
//we stop the call only if we have this current call or if we are in call
|
||||
|
|
|
|||
|
|
@ -497,8 +497,14 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const
|
|||
call->state=cstate;
|
||||
}
|
||||
if (cstate==LinphoneCallEnd || cstate==LinphoneCallError){
|
||||
if (call->reason==LinphoneReasonDeclined){
|
||||
call->log->status=LinphoneCallDeclined;
|
||||
switch(call->reason){
|
||||
case LinphoneReasonDeclined:
|
||||
call->log->status=LinphoneCallDeclined;
|
||||
case LinphoneReasonNotAnswered:
|
||||
call->log->status=LinphoneCallMissed;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
linphone_call_set_terminated (call);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -467,6 +467,7 @@ static void sip_config_read(LinphoneCore *lc)
|
|||
LCSipTransports tr;
|
||||
int i,tmp;
|
||||
int ipv6;
|
||||
int random_port;
|
||||
|
||||
tmp=lp_config_get_int(lc->config,"sip","use_info",0);
|
||||
linphone_core_set_use_info_for_dtmf(lc,tmp);
|
||||
|
|
@ -478,6 +479,7 @@ static void sip_config_read(LinphoneCore *lc)
|
|||
sal_use_rport(lc->sal,lp_config_get_int(lc->config,"sip","use_rport",1));
|
||||
sal_use_101(lc->sal,lp_config_get_int(lc->config,"sip","use_101",1));
|
||||
sal_reuse_authorization(lc->sal, lp_config_get_int(lc->config,"sip","reuse_authorization",0));
|
||||
sal_expire_old_registration_contacts(lc->sal,lp_config_get_int(lc->config,"sip","expire_old_registration_contacts",0));
|
||||
|
||||
tmp=lp_config_get_int(lc->config,"sip","use_rfc2833",0);
|
||||
linphone_core_set_use_rfc2833_for_dtmf(lc,tmp);
|
||||
|
|
@ -488,21 +490,26 @@ static void sip_config_read(LinphoneCore *lc)
|
|||
}
|
||||
linphone_core_enable_ipv6(lc,ipv6);
|
||||
memset(&tr,0,sizeof(tr));
|
||||
if (lp_config_get_int(lc->config,"sip","sip_random_port",0)) {
|
||||
tr.udp_port=(0xDFF&+random())+1024;
|
||||
} else {
|
||||
tr.udp_port=lp_config_get_int(lc->config,"sip","sip_port",5060);
|
||||
}
|
||||
if (lp_config_get_int(lc->config,"sip","sip_tcp_random_port",0)) {
|
||||
tr.tcp_port=(0xDFF&+random())+1024;
|
||||
} else {
|
||||
tr.tcp_port=lp_config_get_int(lc->config,"sip","sip_tcp_port",0);
|
||||
}
|
||||
if (lp_config_get_int(lc->config,"sip","sip_tls_random_port",0)) {
|
||||
tr.tls_port=(0xDFF&+random())+1024;
|
||||
} else {
|
||||
tr.tls_port=lp_config_get_int(lc->config,"sip","sip_tls_port",0);
|
||||
}
|
||||
|
||||
tr.udp_port=lp_config_get_int(lc->config,"sip","sip_port",0);
|
||||
tr.tcp_port=lp_config_get_int(lc->config,"sip","sip_tcp_port",0);
|
||||
tr.tls_port=lp_config_get_int(lc->config,"sip","sip_tls_port",0);
|
||||
|
||||
if (lp_config_get_int(lc->config,"sip","sip_random_port",0)==1)
|
||||
random_port=(0xDFFF&random())+1024;
|
||||
else random_port=0;
|
||||
|
||||
if (tr.udp_port==0 && tr.tcp_port==0 && tr.tls_port==0){
|
||||
tr.udp_port=5060;
|
||||
}
|
||||
|
||||
if (tr.udp_port>0 && random_port){
|
||||
tr.udp_port=random_port;
|
||||
}else if (tr.tcp_port>0 && random_port){
|
||||
tr.tcp_port=random_port;
|
||||
}else if (tr.tls_port>0 && random_port){
|
||||
tr.tls_port=random_port;
|
||||
}
|
||||
|
||||
#ifdef __linux
|
||||
sal_set_root_ca(lc->sal, lp_config_get_string(lc->config,"sip","root_ca", "/etc/ssl/certs"));
|
||||
|
|
@ -1312,6 +1319,7 @@ int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs)
|
|||
{
|
||||
if (lc->codecs_conf.audio_codecs!=NULL) ms_list_free(lc->codecs_conf.audio_codecs);
|
||||
lc->codecs_conf.audio_codecs=codecs;
|
||||
_linphone_core_codec_config_write(lc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1326,6 +1334,7 @@ int linphone_core_set_video_codecs(LinphoneCore *lc, MSList *codecs)
|
|||
{
|
||||
if (lc->codecs_conf.video_codecs!=NULL) ms_list_free(lc->codecs_conf.video_codecs);
|
||||
lc->codecs_conf.video_codecs=codecs;
|
||||
_linphone_core_codec_config_write(lc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1820,6 +1829,7 @@ void linphone_core_iterate(LinphoneCore *lc){
|
|||
ms_message("incoming call ringing for %i seconds",elapsed);
|
||||
if (elapsed>lc->sip_conf.inc_timeout){
|
||||
call->log->status=LinphoneCallMissed;
|
||||
call->reason=LinphoneReasonNotAnswered;
|
||||
linphone_core_terminate_call(lc,call);
|
||||
}
|
||||
}
|
||||
|
|
@ -2562,7 +2572,8 @@ int linphone_core_abort_call(LinphoneCore *lc, LinphoneCall *call, const char *e
|
|||
|
||||
static void terminate_call(LinphoneCore *lc, LinphoneCall *call){
|
||||
if (call->state==LinphoneCallIncomingReceived){
|
||||
call->reason=LinphoneReasonDeclined;
|
||||
if (call->reason!=LinphoneReasonNotAnswered)
|
||||
call->reason=LinphoneReasonDeclined;
|
||||
}
|
||||
/*stop ringing*/
|
||||
if (lc->ringstream!=NULL) {
|
||||
|
|
@ -3478,6 +3489,19 @@ void linphone_core_clear_call_logs(LinphoneCore *lc){
|
|||
call_logs_write_to_config_file(lc);
|
||||
}
|
||||
|
||||
int linphone_core_get_missed_calls_count(LinphoneCore *lc) {
|
||||
return lc->missed_calls;
|
||||
}
|
||||
|
||||
void linphone_core_reset_missed_calls_count(LinphoneCore *lc) {
|
||||
lc->missed_calls=0;
|
||||
}
|
||||
|
||||
void linphone_core_remove_call_log(LinphoneCore *lc, void *data) {
|
||||
lc->call_logs = ms_list_remove(lc->call_logs, data);
|
||||
call_logs_write_to_config_file(lc);
|
||||
}
|
||||
|
||||
static void toggle_video_preview(LinphoneCore *lc, bool_t val){
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (val){
|
||||
|
|
@ -4254,38 +4278,43 @@ void video_config_uninit(LinphoneCore *lc)
|
|||
ms_free(lc->video_conf.cams);
|
||||
}
|
||||
|
||||
void codecs_config_uninit(LinphoneCore *lc)
|
||||
{
|
||||
PayloadType *pt;
|
||||
codecs_config_t *config=&lc->codecs_conf;
|
||||
MSList *node;
|
||||
char key[50];
|
||||
int index;
|
||||
index=0;
|
||||
for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){
|
||||
pt=(PayloadType*)(node->data);
|
||||
void _linphone_core_codec_config_write(LinphoneCore *lc){
|
||||
if (linphone_core_ready(lc)){
|
||||
PayloadType *pt;
|
||||
codecs_config_t *config=&lc->codecs_conf;
|
||||
MSList *node;
|
||||
char key[50];
|
||||
int index;
|
||||
index=0;
|
||||
for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){
|
||||
pt=(PayloadType*)(node->data);
|
||||
sprintf(key,"audio_codec_%i",index);
|
||||
lp_config_set_string(lc->config,key,"mime",pt->mime_type);
|
||||
lp_config_set_int(lc->config,key,"rate",pt->clock_rate);
|
||||
lp_config_set_int(lc->config,key,"enabled",linphone_core_payload_type_enabled(lc,pt));
|
||||
index++;
|
||||
}
|
||||
sprintf(key,"audio_codec_%i",index);
|
||||
lp_config_set_string(lc->config,key,"mime",pt->mime_type);
|
||||
lp_config_set_int(lc->config,key,"rate",pt->clock_rate);
|
||||
lp_config_set_int(lc->config,key,"enabled",linphone_core_payload_type_enabled(lc,pt));
|
||||
index++;
|
||||
}
|
||||
sprintf(key,"audio_codec_%i",index);
|
||||
lp_config_clean_section (lc->config,key);
|
||||
lp_config_clean_section (lc->config,key);
|
||||
|
||||
index=0;
|
||||
for(node=config->video_codecs;node!=NULL;node=ms_list_next(node)){
|
||||
pt=(PayloadType*)(node->data);
|
||||
index=0;
|
||||
for(node=config->video_codecs;node!=NULL;node=ms_list_next(node)){
|
||||
pt=(PayloadType*)(node->data);
|
||||
sprintf(key,"video_codec_%i",index);
|
||||
lp_config_set_string(lc->config,key,"mime",pt->mime_type);
|
||||
lp_config_set_int(lc->config,key,"rate",pt->clock_rate);
|
||||
lp_config_set_int(lc->config,key,"enabled",linphone_core_payload_type_enabled(lc,pt));
|
||||
lp_config_set_string(lc->config,key,"recv_fmtp",pt->recv_fmtp);
|
||||
index++;
|
||||
}
|
||||
sprintf(key,"video_codec_%i",index);
|
||||
lp_config_set_string(lc->config,key,"mime",pt->mime_type);
|
||||
lp_config_set_int(lc->config,key,"rate",pt->clock_rate);
|
||||
lp_config_set_int(lc->config,key,"enabled",linphone_core_payload_type_enabled(lc,pt));
|
||||
lp_config_set_string(lc->config,key,"recv_fmtp",pt->recv_fmtp);
|
||||
index++;
|
||||
lp_config_clean_section (lc->config,key);
|
||||
}
|
||||
sprintf(key,"video_codec_%i",index);
|
||||
lp_config_clean_section (lc->config,key);
|
||||
}
|
||||
|
||||
static void codecs_config_uninit(LinphoneCore *lc)
|
||||
{
|
||||
_linphone_core_codec_config_write(lc);
|
||||
ms_list_free(lc->codecs_conf.audio_codecs);
|
||||
ms_list_free(lc->codecs_conf.video_codecs);
|
||||
}
|
||||
|
|
@ -4510,7 +4539,7 @@ static PayloadType* find_payload_type_from_list(const char* type, int rate,const
|
|||
const MSList *elem;
|
||||
for(elem=from;elem!=NULL;elem=elem->next){
|
||||
PayloadType *pt=(PayloadType*)elem->data;
|
||||
if ((strcmp((char*)type, payload_type_get_mime(pt)) == 0) && (rate == -1 || rate==pt->clock_rate)) {
|
||||
if ((strcasecmp((char*)type, payload_type_get_mime(pt)) == 0) && (rate == -1 || rate==pt->clock_rate)) {
|
||||
return pt;
|
||||
}
|
||||
}
|
||||
|
|
@ -4577,6 +4606,8 @@ const char *linphone_reason_to_string(LinphoneReason err){
|
|||
return "Call declined";
|
||||
case LinphoneReasonNotFound:
|
||||
return "User not found";
|
||||
case LinphoneReasonNotAnswered:
|
||||
return "Not answered";
|
||||
}
|
||||
return "unknown error";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,8 @@ enum _LinphoneReason{
|
|||
LinphoneReasonNoResponse, /**<No response received from remote*/
|
||||
LinphoneReasonBadCredentials, /**<Authentication failed due to bad or missing credentials*/
|
||||
LinphoneReasonDeclined, /**<The call has been declined*/
|
||||
LinphoneReasonNotFound,
|
||||
LinphoneReasonNotFound, /**<Destination of the calls was not found.*/
|
||||
LinphoneReasonNotAnswered
|
||||
};
|
||||
|
||||
typedef enum _LinphoneReason LinphoneReason;
|
||||
|
|
@ -969,6 +970,9 @@ void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, bool_t val);
|
|||
/* returns a list of LinphoneCallLog */
|
||||
const MSList * linphone_core_get_call_logs(LinphoneCore *lc);
|
||||
void linphone_core_clear_call_logs(LinphoneCore *lc);
|
||||
int linphone_core_get_missed_calls_count(LinphoneCore *lc);
|
||||
void linphone_core_reset_missed_calls_count(LinphoneCore *lc);
|
||||
void linphone_core_remove_call_log(LinphoneCore *lc, void *data);
|
||||
|
||||
/* video support */
|
||||
bool_t linphone_core_video_supported(LinphoneCore *lc);
|
||||
|
|
|
|||
|
|
@ -642,6 +642,24 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_stopDtmf( JNIEnv* env
|
|||
linphone_core_stop_dtmf((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_getMissedCallsCount(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
linphone_core_get_missed_calls_count((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_resetMissedCallsCount(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
linphone_core_reset_missed_calls_count((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeCallLog(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc, jlong log) {
|
||||
linphone_core_remove_call_log((LinphoneCore*)lc, (void*) log);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearCallLogs(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
|
|
@ -1119,6 +1137,11 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallLogImpl_getFrom(JNIEnv* env
|
|||
,jlong ptr) {
|
||||
return (jlong)((LinphoneCallLog*)ptr)->from;
|
||||
}
|
||||
extern "C" int Java_org_linphone_core_LinphoneCallLogImpl_getStatus(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return (jlong)((LinphoneCallLog*)ptr)->status;
|
||||
}
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCallLogImpl_getTo(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
|
|
@ -1129,6 +1152,17 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCallLogImpl_isIncoming(JNIEnv
|
|||
,jlong ptr) {
|
||||
return ((LinphoneCallLog*)ptr)->dir==LinphoneCallIncoming?JNI_TRUE:JNI_FALSE;
|
||||
}
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneCallLogImpl_getStartDate(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
jstring jvalue =env->NewStringUTF(((LinphoneCallLog*)ptr)->start_date);
|
||||
return jvalue;
|
||||
}
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCallLogImpl_getCallDuration(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return ((LinphoneCallLog*)ptr)->duration;
|
||||
}
|
||||
|
||||
/*payloadType*/
|
||||
extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env,jobject thiz,jlong ptr) {
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, const PayloadType *p
|
|||
int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bool_t enabled){
|
||||
if (ms_list_find(lc->codecs_conf.audio_codecs,pt) || ms_list_find(lc->codecs_conf.video_codecs,pt)){
|
||||
payload_type_set_enable(pt,enabled);
|
||||
_linphone_core_codec_config_write(lc);
|
||||
return 0;
|
||||
}
|
||||
ms_error("Enabling codec not in audio or video list of PayloadType !");
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ static void initiate_incoming(const SalStreamDescription *local_cap,
|
|||
result->proto=remote_offer->proto;
|
||||
result->type=local_cap->type;
|
||||
result->dir=compute_dir_incoming(local_cap->dir,remote_offer->dir);
|
||||
if (result->payloads && !only_telephone_event(result->payloads)){
|
||||
if (result->payloads && !only_telephone_event(result->payloads) && (remote_offer->port!=0 || remote_offer->port==SalStreamSendOnly)){
|
||||
strcpy(result->addr,local_cap->addr);
|
||||
memcpy(result->candidates,local_cap->candidates,sizeof(result->candidates));
|
||||
result->port=local_cap->port;
|
||||
|
|
|
|||
|
|
@ -568,6 +568,7 @@ bool_t linphone_core_sound_resources_available(LinphoneCore *lc);
|
|||
void linphone_core_notify_refer_state(LinphoneCore *lc, LinphoneCall *referer, LinphoneCall *newcall);
|
||||
|
||||
void __linphone_core_invalidate_registers(LinphoneCore* lc);
|
||||
void _linphone_core_codec_config_write(LinphoneCore *lc);
|
||||
|
||||
#define HOLD_OFF (0)
|
||||
#define HOLD_ON (1)
|
||||
|
|
|
|||
|
|
@ -291,6 +291,7 @@ void sal_set_keepalive_period(Sal *ctx,unsigned int value);
|
|||
unsigned int sal_get_keepalive_period(Sal *ctx);
|
||||
void sal_use_session_timers(Sal *ctx, int expires);
|
||||
void sal_use_double_registrations(Sal *ctx, bool_t enabled);
|
||||
void sal_expire_old_registration_contacts(Sal *ctx, bool_t enabled);
|
||||
void sal_reuse_authorization(Sal *ctx, bool_t enabled);
|
||||
void sal_use_one_matching_codec_policy(Sal *ctx, bool_t one_matching_codec);
|
||||
void sal_use_rport(Sal *ctx, bool_t use_rports);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ static bool_t call_failure(Sal *sal, eXosip_event_t *ev);
|
|||
static void text_received(Sal *sal, eXosip_event_t *ev);
|
||||
|
||||
static void masquerade_via(osip_message_t *msg, const char *ip, const char *port);
|
||||
static bool_t fix_message_contact(SalOp *op, osip_message_t *request,osip_message_t *last_answer);
|
||||
static bool_t fix_message_contact(SalOp *op, osip_message_t *request,osip_message_t *last_answer, bool_t expire_last_contact);
|
||||
static void update_contact_from_response(SalOp *op, osip_message_t *response);
|
||||
|
||||
void _osip_list_set_empty(osip_list_t *l, void (*freefunc)(void*)){
|
||||
|
|
@ -162,7 +162,7 @@ void sal_exosip_fix_route(SalOp *op){
|
|||
}
|
||||
|
||||
SalOp * sal_op_new(Sal *sal){
|
||||
SalOp *op=ms_new(SalOp,1);
|
||||
SalOp *op=ms_new0(SalOp,1);
|
||||
__sal_op_init(op,sal);
|
||||
op->cid=op->did=op->tid=op->rid=op->nid=op->sid=-1;
|
||||
op->result=NULL;
|
||||
|
|
@ -283,6 +283,7 @@ Sal * sal_init(){
|
|||
sal->reuse_authorization=FALSE;
|
||||
sal->rootCa = 0;
|
||||
sal->verify_server_certs=TRUE;
|
||||
sal->expire_old_contact=FALSE;
|
||||
return sal;
|
||||
}
|
||||
|
||||
|
|
@ -429,6 +430,10 @@ void sal_use_double_registrations(Sal *ctx, bool_t enabled){
|
|||
ctx->double_reg=enabled;
|
||||
}
|
||||
|
||||
void sal_expire_old_registration_contacts(Sal *ctx, bool_t enabled){
|
||||
ctx->expire_old_contact=enabled;
|
||||
}
|
||||
|
||||
void sal_use_rport(Sal *ctx, bool_t use_rports){
|
||||
ctx->use_rports=use_rports;
|
||||
}
|
||||
|
|
@ -1733,7 +1738,7 @@ static void masquerade_via(osip_message_t *msg, const char *ip, const char *port
|
|||
}
|
||||
|
||||
|
||||
static bool_t fix_message_contact(SalOp *op, osip_message_t *request,osip_message_t *last_answer) {
|
||||
static bool_t fix_message_contact(SalOp *op, osip_message_t *request,osip_message_t *last_answer, bool_t expire_last_contact) {
|
||||
osip_contact_t *ctt=NULL;
|
||||
const char *received;
|
||||
int rport;
|
||||
|
|
@ -1746,6 +1751,23 @@ static bool_t fix_message_contact(SalOp *op, osip_message_t *request,osip_messag
|
|||
ms_warning("fix_message_contact(): no contact to update");
|
||||
return FALSE;
|
||||
}
|
||||
if (expire_last_contact){
|
||||
osip_contact_t *oldct=NULL,*prevct;
|
||||
osip_generic_param_t *param=NULL;
|
||||
osip_contact_clone(ctt,&oldct);
|
||||
while ((prevct=(osip_contact_t*)osip_list_get(&request->contacts,1))!=NULL){
|
||||
osip_contact_free(prevct);
|
||||
osip_list_remove(&request->contacts,1);
|
||||
}
|
||||
osip_list_add(&request->contacts,oldct,1);
|
||||
osip_contact_param_get_byname(oldct,"expires",¶m);
|
||||
if (param){
|
||||
if (param->gvalue) osip_free(param->gvalue);
|
||||
param->gvalue=osip_strdup("0");
|
||||
}else{
|
||||
osip_contact_param_add(oldct,osip_strdup("expires"),osip_strdup("0"));
|
||||
}
|
||||
}
|
||||
if (ctt->url->host!=NULL){
|
||||
osip_free(ctt->url->host);
|
||||
}
|
||||
|
|
@ -1772,29 +1794,44 @@ static bool_t register_again_with_updated_contact(SalOp *op, osip_message_t *ori
|
|||
char* tmp;
|
||||
osip_message_t *msg=NULL;
|
||||
Sal* sal=op->base.root;
|
||||
int i=0;
|
||||
bool_t found_valid_contact=FALSE;
|
||||
bool_t from_request=FALSE;
|
||||
|
||||
if (sal->double_reg==FALSE ) return FALSE;
|
||||
|
||||
if (extract_received_rport(last_answer,&received,&rport,&transport)==-1) return FALSE;
|
||||
osip_message_get_contact(orig_request,0,&ctt);
|
||||
osip_contact_to_str(ctt,&tmp);
|
||||
ori_contact_address = sal_address_new(tmp);
|
||||
do{
|
||||
ctt=NULL;
|
||||
osip_message_get_contact(last_answer,i,&ctt);
|
||||
if (!from_request && ctt==NULL) {
|
||||
osip_message_get_contact(orig_request,0,&ctt);
|
||||
from_request=TRUE;
|
||||
}
|
||||
if (ctt){
|
||||
osip_contact_to_str(ctt,&tmp);
|
||||
ori_contact_address = sal_address_new(tmp);
|
||||
|
||||
/*check if contact is up to date*/
|
||||
if (strcmp(sal_address_get_domain(ori_contact_address),received) ==0
|
||||
&& sal_address_get_port_int(ori_contact_address) == rport
|
||||
&& sal_address_get_transport(ori_contact_address) == transport) {
|
||||
ms_message("Register has up to date contact, doing nothing.");
|
||||
osip_free(tmp);
|
||||
sal_address_destroy(ori_contact_address);
|
||||
return FALSE;
|
||||
} else ms_message("contact do not match, need to update the register (%s with %s:%i;transport=%s)"
|
||||
,tmp
|
||||
,received
|
||||
,rport
|
||||
,sal_transport_to_string(transport));
|
||||
osip_free(tmp);
|
||||
sal_address_destroy(ori_contact_address);
|
||||
/*check if contact is up to date*/
|
||||
if (strcmp(sal_address_get_domain(ori_contact_address),received) ==0
|
||||
&& sal_address_get_port_int(ori_contact_address) == rport
|
||||
&& sal_address_get_transport(ori_contact_address) == transport) {
|
||||
if (!from_request){
|
||||
ms_message("Register response has up to date contact, doing nothing.");
|
||||
}else {
|
||||
ms_warning("Register response does not have up to date contact, but last request had."
|
||||
"Stupid registrar detected, giving up.");
|
||||
}
|
||||
found_valid_contact=TRUE;
|
||||
}
|
||||
osip_free(tmp);
|
||||
sal_address_destroy(ori_contact_address);
|
||||
}else break;
|
||||
i++;
|
||||
}while(!found_valid_contact);
|
||||
if (!found_valid_contact)
|
||||
ms_message("Contact do not match, resending register.");
|
||||
else return FALSE;
|
||||
|
||||
eXosip_lock();
|
||||
eXosip_register_build_register(op->rid,op->expires,&msg);
|
||||
|
|
@ -1803,7 +1840,7 @@ static bool_t register_again_with_updated_contact(SalOp *op, osip_message_t *ori
|
|||
ms_warning("Fail to create a contact updated register.");
|
||||
return FALSE;
|
||||
}
|
||||
if (fix_message_contact(op,msg,last_answer)) {
|
||||
if (fix_message_contact(op,msg,last_answer,op->base.root->expire_old_contact)) {
|
||||
eXosip_register_send_register(op->rid,msg);
|
||||
eXosip_unlock();
|
||||
ms_message("Resending new register with updated contact");
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ struct Sal{
|
|||
bool_t use_101;
|
||||
bool_t reuse_authorization;
|
||||
bool_t verify_server_certs;
|
||||
bool_t expire_old_contact;
|
||||
};
|
||||
|
||||
struct SalOp{
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ void linphone_gtk_call_log_update(GtkWidget *w){
|
|||
const char *display;
|
||||
gchar *logtxt, *minutes, *seconds;
|
||||
gchar quality[20];
|
||||
const char *status=NULL;
|
||||
|
||||
display=linphone_address_get_display_name (la);
|
||||
if (display==NULL){
|
||||
|
|
@ -67,17 +68,35 @@ void linphone_gtk_call_log_update(GtkWidget *w){
|
|||
if (cl->quality!=-1){
|
||||
snprintf(quality,sizeof(quality),"%.1f",cl->quality);
|
||||
}
|
||||
switch(cl->status){
|
||||
case LinphoneCallAborted:
|
||||
status=_("Aborted");
|
||||
break;
|
||||
case LinphoneCallMissed:
|
||||
status=_("Missed");
|
||||
break;
|
||||
case LinphoneCallDeclined:
|
||||
status=_("Declined");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
minutes=g_markup_printf_escaped(
|
||||
ngettext("%i minute", "%i minutes", cl->duration/60),
|
||||
cl->duration/60);
|
||||
seconds=g_markup_printf_escaped(
|
||||
ngettext("%i second", "%i seconds", cl->duration%60),
|
||||
cl->duration%60);
|
||||
logtxt=g_markup_printf_escaped(
|
||||
if (status==NULL) logtxt=g_markup_printf_escaped(
|
||||
_("<big><b>%s</b></big>\t<small><i>%s</i>\t"
|
||||
"<i>Quality: %s</i></small>\n%s\t%s %s\t"),
|
||||
display, addr, cl->quality!=-1 ? quality : _("n/a"),
|
||||
cl->start_date, minutes, seconds);
|
||||
else logtxt=g_markup_printf_escaped(
|
||||
_("<big><b>%s</b></big>\t<small><i>%s</i></small>\t"
|
||||
"\n%s\t%s"),
|
||||
display, addr,
|
||||
cl->start_date, status);
|
||||
g_free(minutes);
|
||||
g_free(seconds);
|
||||
gtk_list_store_append (store,&iter);
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ static void linphone_gtk_log_file(OrtpLogLevel lev, const char *msg)
|
|||
case of a crash (which is one of the main reasons we have a
|
||||
log facility in the first place). */
|
||||
fprintf(outlog, "[%s] [%s] %s\n", date, lname, msg);
|
||||
fflush(outlog);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
29
gtk/main.c
29
gtk/main.c
|
|
@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
|
||||
|
||||
#define VIDEOSELFVIEW_DEFAULT 1
|
||||
#define VIDEOSELFVIEW_DEFAULT 0
|
||||
|
||||
#include "linphone.h"
|
||||
#include "lpconfig.h"
|
||||
|
|
@ -66,11 +66,13 @@ static void linphone_gtk_call_encryption_changed(LinphoneCore *lc, LinphoneCall
|
|||
static void linphone_gtk_transfer_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate);
|
||||
static gboolean linphone_gtk_auto_answer(LinphoneCall *call);
|
||||
static void linphone_gtk_status_icon_set_blinking(gboolean val);
|
||||
void _linphone_gtk_enable_video(gboolean val);
|
||||
|
||||
|
||||
static gboolean verbose=0;
|
||||
static gboolean auto_answer = 0;
|
||||
static gchar * addr_to_call = NULL;
|
||||
static gboolean no_video=FALSE;
|
||||
static gboolean iconified=FALSE;
|
||||
static gchar *workingdir=NULL;
|
||||
static char *progpath=NULL;
|
||||
|
|
@ -91,6 +93,13 @@ static GOptionEntry linphone_options[]={
|
|||
.arg_data = &linphone_logfile,
|
||||
.description = N_("path to a file to write logs into.")
|
||||
},
|
||||
{
|
||||
.long_name = "no-video",
|
||||
.short_name = '\0',
|
||||
.arg = G_OPTION_ARG_NONE,
|
||||
.arg_data = (gpointer)&no_video,
|
||||
.description = N_("Start linphone with video disabled.")
|
||||
},
|
||||
{
|
||||
.long_name="iconified",
|
||||
.short_name= '\0',
|
||||
|
|
@ -234,6 +243,10 @@ static void linphone_gtk_init_liblinphone(const char *config_file,
|
|||
linphone_core_set_zrtp_secrets_file(the_core,secrets_file);
|
||||
g_free(secrets_file);
|
||||
linphone_core_enable_video(the_core,TRUE,TRUE);
|
||||
if (no_video) {
|
||||
_linphone_gtk_enable_video(FALSE);
|
||||
linphone_gtk_set_ui_config_int("videoselfview",0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -648,10 +661,8 @@ bool_t linphone_gtk_video_enabled(void){
|
|||
void linphone_gtk_show_main_window(){
|
||||
GtkWidget *w=linphone_gtk_get_main_window();
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
if (linphone_gtk_video_enabled()){
|
||||
linphone_core_enable_video_preview(lc,linphone_gtk_get_ui_config_int("videoselfview",
|
||||
linphone_core_enable_video_preview(lc,linphone_gtk_get_ui_config_int("videoselfview",
|
||||
VIDEOSELFVIEW_DEFAULT));
|
||||
}
|
||||
gtk_widget_show(w);
|
||||
gtk_window_present(GTK_WINDOW(w));
|
||||
}
|
||||
|
|
@ -772,9 +783,7 @@ void linphone_gtk_answer_clicked(GtkWidget *button){
|
|||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_enable_video(GtkWidget *w){
|
||||
gboolean val=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
|
||||
//GtkWidget *selfview_item=linphone_gtk_get_widget(linphone_gtk_get_main_window(),"selfview_item");
|
||||
void _linphone_gtk_enable_video(gboolean val){
|
||||
LinphoneVideoPolicy policy={0};
|
||||
policy.automatically_initiate=policy.automatically_accept=val;
|
||||
linphone_core_enable_video(linphone_gtk_get_core(),TRUE,TRUE);
|
||||
|
|
@ -788,6 +797,12 @@ void linphone_gtk_enable_video(GtkWidget *w){
|
|||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_enable_video(GtkWidget *w){
|
||||
gboolean val=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
|
||||
//GtkWidget *selfview_item=linphone_gtk_get_widget(linphone_gtk_get_main_window(),"selfview_item");
|
||||
_linphone_gtk_enable_video(val);
|
||||
}
|
||||
|
||||
void linphone_gtk_enable_self_view(GtkWidget *w){
|
||||
gboolean val=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
|
|
|
|||
|
|
@ -94,4 +94,16 @@ public interface LinphoneCallLog {
|
|||
* @return
|
||||
*/
|
||||
public CallStatus getStatus();
|
||||
|
||||
public long getNativePtr();
|
||||
|
||||
/**
|
||||
* @return a human readble String with the start date/time of the call
|
||||
*/
|
||||
public String getStartDate();
|
||||
|
||||
/**
|
||||
* @return the call duration, in seconds
|
||||
*/
|
||||
public int getCallDuration();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package org.linphone.core;
|
|||
|
||||
import java.util.Vector;
|
||||
|
||||
import org.linphone.core.LinphoneCallLog;
|
||||
import org.linphone.core.LinphoneCallParams;
|
||||
|
||||
/**
|
||||
|
|
@ -759,4 +760,19 @@ public interface LinphoneCore {
|
|||
void setUserAgent(String name, String version);
|
||||
|
||||
void setCpuCount(int count);
|
||||
|
||||
/**
|
||||
* remove a call log
|
||||
*/
|
||||
public void removeCallLog(LinphoneCallLog log);
|
||||
|
||||
/**
|
||||
* @return count of missed calls
|
||||
*/
|
||||
public int getMissedCallsCount();
|
||||
|
||||
/**
|
||||
* Set missed calls count to zero
|
||||
*/
|
||||
public void resetMissedCallsCount();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 8fb5d72cf1ecc1c30c29fc4ba093b9bade74ba6a
|
||||
Subproject commit 5b865fce6a98d20b9b8696784b5e7e6467f2ced0
|
||||
Loading…
Add table
Reference in a new issue