X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=coreapi%2Flinphonecore.c;h=729df1fc6e7118c6edba9621aa6e1a6fe7e87de2;hb=0fa5d7c73b672772a8841c65ff0c7fcdc4e1fce7;hp=a2c910064fd1775cde5c491eb0f47b708e7ef69b;hpb=bee6752f6e6c188481521d74dbd0dfc0bd86b5aa;p=linphone diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index a2c91006..729df1fc 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -116,6 +116,7 @@ LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, LinphoneAddress *fro cl->from=from; cl->to=to; cl->status=LinphoneCallAborted; /*default status*/ + cl->quality=-1; return cl; } @@ -406,10 +407,24 @@ const LinphoneAddress *linphone_core_get_current_call_remote_address(struct _Lin return linphone_call_get_remote_address(call); } +void linphone_core_set_log_handler(OrtpLogFunc logfunc) { + ortp_set_log_handler(logfunc); +} + +void linphone_core_set_log_file(FILE *file) { + if (file == NULL) file = stdout; + ortp_set_log_file(file); +} + +void linphone_core_set_log_level(OrtpLogLevel loglevel) { + ortp_set_log_level_mask(loglevel); +} + /** * Enable logs in supplied FILE*. * * @ingroup misc + * @deprecated Use #linphone_core_set_log_file and #linphone_core_set_log_level instead. * * @param file a C FILE* where to fprintf logs. If null stdout is used. * @@ -424,6 +439,7 @@ void linphone_core_enable_logs(FILE *file){ * Enable logs through the user's supplied log callback. * * @ingroup misc + * @deprecated Use #linphone_core_set_log_handler and #linphone_core_set_log_level instead. * * @param logfunc The address of a OrtpLogFunc callback whose protoype is * typedef void (*OrtpLogFunc)(OrtpLogLevel lev, const char *fmt, va_list args); @@ -438,6 +454,7 @@ void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc){ * Entirely disable logging. * * @ingroup misc + * @deprecated Use #linphone_core_set_log_level instead. **/ void linphone_core_disable_logs(){ ortp_set_log_level_mask(ORTP_ERROR|ORTP_FATAL); @@ -463,7 +480,7 @@ static void net_config_read (LinphoneCore *lc) linphone_core_set_firewall_policy(lc,tmp); tmp=lp_config_get_int(lc->config,"net","nat_sdp_only",0); lc->net_conf.nat_sdp_only=tmp; - tmp=lp_config_get_int(lc->config,"net","mtu",0); + tmp=lp_config_get_int(lc->config,"net","mtu",1300); linphone_core_set_mtu(lc,tmp); tmp=lp_config_get_int(lc->config,"net","download_ptime",0); linphone_core_set_download_ptime(lc,tmp); @@ -1194,8 +1211,8 @@ 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); + 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); } @@ -2117,8 +2134,9 @@ void linphone_core_iterate(LinphoneCore *lc){ if (call->state==LinphoneCallIncomingReceived){ ms_message("incoming call ringing for %i seconds",elapsed); if (elapsed>lc->sip_conf.inc_timeout){ + LinphoneReason decline_reason; ms_message("incoming call timeout (%i)",lc->sip_conf.inc_timeout); - LinphoneReason decline_reason=lc->current_call ? LinphoneReasonBusy : LinphoneReasonDeclined; + decline_reason=lc->current_call ? LinphoneReasonBusy : LinphoneReasonDeclined; call->log->status=LinphoneCallMissed; call->reason=LinphoneReasonNotAnswered; linphone_core_decline_call(lc,call,decline_reason); @@ -2150,8 +2168,10 @@ void linphone_core_iterate(LinphoneCore *lc){ lc->initial_subscribes_sent=TRUE; } - if (one_second_elapsed && lp_config_needs_commit(lc->config)){ - lp_config_sync(lc->config); + if (one_second_elapsed) { + if (lp_config_needs_commit(lc->config)) { + lp_config_sync(lc->config); + } } } @@ -4705,7 +4725,7 @@ int linphone_core_get_device_rotation(LinphoneCore *lc ) { * **/ void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation) { -ms_message("%s : rotation=%d\n", __FUNCTION__, rotation); + ms_message("%s : rotation=%d\n", __FUNCTION__, rotation); lc->device_rotation = rotation; #ifdef VIDEO_ENABLED LinphoneCall *call=linphone_core_get_current_call(lc);