cl->from=from;
cl->to=to;
cl->status=LinphoneCallAborted; /*default status*/
+ cl->quality=-1;
return cl;
}
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.
*
* 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);
* 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);
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);
linphone_core_enable_audio_adaptive_jittcomp(lc, adaptive_jitt_comp_enabled);
adaptive_jitt_comp_enabled = lp_config_get_int(lc->config, "rtp", "video_adaptive_jitt_comp_enabled", TRUE);
linphone_core_enable_video_adaptive_jittcomp(lc, adaptive_jitt_comp_enabled);
+ lc->rtp_conf.disable_upnp = lp_config_get_int(lc->config, "rtp", "disable_upnp", FALSE);
}
static PayloadType * find_payload(RtpProfile *prof, const char *mime_type, int clock_rate, int channels, const char *recv_fmtp){
}
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);
}
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);
+ decline_reason=lc->current_call ? LinphoneReasonBusy : LinphoneReasonDeclined;
call->log->status=LinphoneCallMissed;
call->reason=LinphoneReasonNotAnswered;
- linphone_core_terminate_call(lc,call);
+ linphone_core_decline_call(lc,call,decline_reason);
}
}
if (lc->sip_conf.in_call_timeout > 0 && elapsed>lc->sip_conf.in_call_timeout) {
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);
+ }
}
}
}else{
/* else play a tone within the context of the current call */
call->ringing_beep=TRUE;
- linphone_core_play_tone(lc);
+ linphone_core_play_named_tone(lc,LinphoneToneCallWaiting);
}
linphone_call_set_state(call,LinphoneCallIncomingReceived,"Incoming call");
*
* @ingroup call_control
**/
-LinphoneCall *linphone_core_get_current_call(const LinphoneCore *lc)
-{
+LinphoneCall *linphone_core_get_current_call(const LinphoneCore *lc){
return lc->current_call;
}
*
* @ingroup call_control
**/
-int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call)
+int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call){
+ int err=_linphone_core_pause_call(lc,call);
+ if (err==0) call->paused_by_app=TRUE;
+ return err;
+}
+
+/* Internal version that does not play tone indication*/
+int _linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call)
{
const char *subject=NULL;
lc->vtable.display_status(lc,_("Pausing the current call..."));
if (call->audiostream || call->videostream)
linphone_call_stop_media_streams (call);
+ call->paused_by_app=FALSE;
return 0;
}
LinphoneCall *call=(LinphoneCall *)elem->data;
LinphoneCallState cs=linphone_call_get_state(call);
if (cs==LinphoneCallStreamsRunning || cs==LinphoneCallPausedByRemote){
- linphone_core_pause_call(lc,call);
+ _linphone_core_pause_call(lc,call);
}
}
return 0;
current_call=linphone_core_get_current_call(lc);
if(current_call != NULL){
ms_message("Pausing automatically the current call.");
- linphone_core_pause_call(lc,current_call);
+ _linphone_core_pause_call(lc,current_call);
+ }
+ if (lc->ringstream){
+ ring_stop(lc->ringstream);
+ lc->ringstream=NULL;
}
}
*
**/
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);
ms_error("No dtmf generator at this time !");
return;
}
+ memset(&def,0,sizeof(def));
def.duration=300;
- def.frequency=500;
+ def.frequencies[0]=500;
def.amplitude=1;
def.interval=2000;
ms_filter_call_method(f, MS_DTMF_GEN_PLAY_CUSTOM,&def);
}
+void linphone_core_play_named_tone(LinphoneCore *lc, LinphoneToneID toneid){
+ if (linphone_core_tone_indications_enabled(lc)){
+ MSFilter *f=get_dtmf_gen(lc);
+ MSDtmfGenCustomTone def;
+ if (f==NULL){
+ ms_error("No dtmf generator at this time !");
+ return;
+ }
+ memset(&def,0,sizeof(def));
+ def.amplitude=1;
+ /*these are french tones, excepted the failed one, which is USA congestion tone (does not exist in France)*/
+ switch(toneid){
+ case LinphoneToneCallOnHold:
+ case LinphoneToneCallWaiting:
+ def.duration=300;
+ def.frequencies[0]=440;
+ def.interval=2000;
+ break;
+ case LinphoneToneBusy:
+ def.duration=500;
+ def.frequencies[0]=440;
+ def.interval=500;
+ def.repeat_count=3;
+ break;
+ case LinphoneToneCallFailed:
+ def.duration=250;
+ def.frequencies[0]=480;
+ def.frequencies[0]=620;
+ def.interval=250;
+ def.repeat_count=3;
+
+ break;
+ default:
+ ms_warning("Unhandled tone id.");
+ }
+ if (def.duration>0)
+ ms_filter_call_method(f, MS_DTMF_GEN_PLAY_CUSTOM,&def);
+ }
+}
+
/**
* @ingroup media_parameters
*