lc->sip_conf.ping_with_options=lp_config_get_int(lc->config,"sip","ping_with_options",1);
lc->sip_conf.auto_net_state_mon=lp_config_get_int(lc->config,"sip","auto_net_state_mon",1);
lc->sip_conf.keepalive_period=lp_config_get_int(lc->config,"sip","keepalive_period",10000);
- sal_set_keepalive_period(lc->sal,lc->sip_conf.keepalive_period);
+ lc->sip_conf.tcp_tls_keepalive=lp_config_get_int(lc->config,"sip","tcp_tls_keepalive",0);
+ linphone_core_enable_keep_alive(lc, (lc->sip_conf.keepalive_period > 0));
sal_use_one_matching_codec_policy(lc->sal,lp_config_get_int(lc->config,"sip","only_one_codec",0));
sal_use_double_registrations(lc->sal,lp_config_get_int(lc->config,"sip","use_double_registrations",1));
sal_use_dates(lc->sal,lp_config_get_int(lc->config,"sip","put_date",0));
}
/**
- * Enable adaptive rate control (experimental feature, audio-only).
+ * Enable adaptive rate control.
+ *
+ * @ingroup media_parameters
*
* Adaptive rate control consists in using RTCP feedback provided information to dynamically
- * control the output bitrate of the encoders, so that we can adapt to the network conditions and
- * available bandwidth.
+ * control the output bitrate of the audio and video encoders, so that we can adapt to the network conditions and
+ * available bandwidth. Control of the audio encoder is done in case of audio-only call, and control of the video encoder is done for audio & video calls.
+ * Adaptive rate control feature is enabled by default.
**/
void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled){
lp_config_set_int(lc->config,"net","adaptive_rate_control",(int)enabled);
/**
* Returns whether adaptive rate control is enabled.
+ *
+ * @ingroup media_parameters
*
* See linphone_core_enable_adaptive_rate_control().
**/
return lc->net_conf.upload_bw;
}
/**
- * Set audio packetization time linphone expects to receive from peer
+ * Set audio packetization time linphone expects to receive from peer.
+ * A value of zero means that ptime is not specified.
+ * @ingroup media_parameters
*/
void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime) {
lp_config_set_int(lc->config,"rtp","download_ptime",ptime);
}
/**
- * Get audio packetization time linphone expects to receive from peer
+ * Get audio packetization time linphone expects to receive from peer.
+ * A value of zero means that ptime is not specified.
+ * @ingroup media_parameters
*/
int linphone_core_get_download_ptime(LinphoneCore *lc) {
return lp_config_get_int(lc->config,"rtp","download_ptime",0);
* Set audio packetization time linphone will send (in absence of requirement from peer)
* A value of 0 stands for the current codec default packetization time.
*
+ * @ingroup media_parameters
**/
void linphone_core_set_upload_ptime(LinphoneCore *lc, int ptime){
lp_config_set_int(lc->config,"rtp","upload_ptime",ptime);
* Set audio packetization time linphone will send (in absence of requirement from peer)
* A value of 0 stands for the current codec default packetization time.
*
+ *
+ * @ingroup media_parameters
**/
int linphone_core_get_upload_ptime(LinphoneCore *lc){
return lp_config_get_int(lc->config,"rtp","upload_ptime",0);
* structure holding the codec information.
* It is possible to make copy of the list with ms_list_copy() in order to modify it
* (such as the order of codecs).
+ * @ingroup media_parameters
**/
const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc)
{
* structure holding the codec information.
* It is possible to make copy of the list with ms_list_copy() in order to modify it
* (such as the order of codecs).
+ * @ingroup media_parameters
**/
const MSList *linphone_core_get_video_codecs(const LinphoneCore *lc)
{
/**
* Sets the UDP port range from which to randomly select the port used for audio streaming.
+ * @ingroup media_parameters
*/
void linphone_core_set_audio_port_range(LinphoneCore *lc, int min_port, int max_port)
{
/**
* Sets the UDP port range from which to randomly select the port used for video streaming.
+ * @ingroup media_parameters
*/
void linphone_core_set_video_port_range(LinphoneCore *lc, int min_port, int max_port)
{
/**
* Interpret a call destination as supplied by the user, and returns a fully qualified
* LinphoneAddress.
+ *
+ * @ingroup call_control
*
* A sip address should look like DisplayName <sip:username@domain:port> .
* Basically this function performs the following tasks
/**
* Performs a simple call transfer to the specified destination.
*
+ * @ingroup call_control
* The remote endpoint is expected to issue a new call to the specified destination.
* The current call remains active and thus can be later paused or terminated.
**/
* @param lc linphone core object
* @param call a running call you want to transfer
* @param dest a running call whose remote person will receive the transfer
+ *
+ * @ingroup call_control
*
* The transfered call is supposed to be in paused state, so that it is able to accept the transfer immediately.
* The destination call is a call previously established to introduce the transfered person.
bool_t linphone_core_incompatible_security(LinphoneCore *lc, SalMediaDescription *md){
if (linphone_core_is_media_encryption_mandatory(lc) && linphone_core_get_media_encryption(lc)==LinphoneMediaEncryptionSRTP){
int i;
- for(i=0;i<md->nstreams;i++){
+ for(i=0;i<md->n_active_streams;i++){
SalStreamDescription *sd=&md->streams[i];
if (sd->proto!=SalProtoRtpSavp){
return TRUE;
linphone_core_update_local_media_description_from_upnp(call->localdesc, call->upnp_session);
}
#endif //BUILD_UPNP
+ linphone_call_update_remote_session_id_and_ver(call);
sal_call_set_local_media_description(call->op,call->localdesc);
sal_call_accept(call->op);
md=sal_call_get_final_media_description(call->op);
* @return 0 if sucessful, -1 otherwise (actually when this function call is performed outside ot #LinphoneCallUpdatedByRemote state).
**/
int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){
+ SalMediaDescription *remote_desc;
+ bool_t keep_sdp_version;
#ifdef VIDEO_ENABLED
bool_t old_has_video = call->params.has_video;
#endif
linphone_call_state_to_string(call->state));
return -1;
}
+ remote_desc = sal_call_get_remote_media_description(call->op);
+ keep_sdp_version = lp_config_get_int(lc->config, "sip", "keep_sdp_version", 0);
+ if (keep_sdp_version &&(remote_desc->session_id == call->remote_session_id) && (remote_desc->session_ver == call->remote_session_ver)) {
+ /* Remote has sent an INVITE with the same SDP as before, so send a 200 OK with the same SDP as before. */
+ ms_warning("SDP version has not changed, send same SDP as before.");
+ sal_call_accept(call->op);
+ linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)");
+ return 0;
+ }
if (params==NULL){
call->params.has_video=lc->video_policy.automatically_accept || call->current_params.has_video;
}else
ms_warning("Video isn't supported in conference");
call->params.has_video = FALSE;
}
- call->params.has_video &= linphone_core_media_description_contains_video_stream(sal_call_get_remote_media_description(call->op));
+ call->params.has_video &= linphone_core_media_description_contains_video_stream(remote_desc);
call->camera_active=call->params.has_video;
linphone_call_make_local_media_description(lc,call);
if (call->ice_session != NULL) {
- linphone_core_update_ice_from_remote_media_description(call, sal_call_get_remote_media_description(call->op));
+ linphone_core_update_ice_from_remote_media_description(call, remote_desc);
#ifdef VIDEO_ENABLED
if ((call->ice_session != NULL) &&!ice_session_candidates_gathered(call->ice_session)) {
if ((call->params.has_video) && (call->params.has_video != old_has_video)) {
audio_stream_prepare_sound(call->audiostream,lc->sound_conf.play_sndcard,lc->sound_conf.capt_sndcard);
}
+ linphone_call_update_remote_session_id_and_ver(call);
sal_call_accept(call->op);
if (lc->vtable.display_status!=NULL)
lc->vtable.display_status(lc,_("Connected."));
/**
* Decline a pending incoming call, with a reason.
+ *
+ * @ingroup call_control
+ *
* @param lc the linphone core
* @param call the LinphoneCall, must be in the IncomingReceived state.
* @param reason the reason for rejecting the call: LinphoneReasonDeclined or LinphoneReasonBusy
/**
* Pause all currently running calls.
+ * @ingroup call_control
**/
int linphone_core_pause_all_calls(LinphoneCore *lc){
const MSList *elem;
* @param lc
* @param remote_address
* @return the LinphoneCall of the call if found
+ *
+ * @ingroup call_control
*/
LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, const char *remote_address){
LinphoneAddress *raddr=linphone_address_new(remote_address);
* @param path
* @param lc The LinphoneCore object
*
- * @ingroup media_parameters
+ * @ingroup initializing
**/
void linphone_core_set_root_ca(LinphoneCore *lc,const char *path){
sal_set_root_ca(lc->sal, path);
}
/**
- * Gets the path to a file or folder containing trusted root CAs (PEM format)
+ * Gets the path to a file or folder containing the trusted root CAs (PEM format)
*
* @param lc The LinphoneCore object
*
- * @ingroup media_parameters
+ * @ingroup initializing
**/
const char *linphone_core_get_root_ca(LinphoneCore *lc){
return sal_get_root_ca(lc->sal);
/**
* Specify whether the tls server certificate must be verified when connecting to a SIP/TLS server.
+ *
+ * @ingroup initializing
**/
void linphone_core_verify_server_certificates(LinphoneCore *lc, bool_t yesno){
sal_verify_server_certificates(lc->sal,yesno);
/**
* Specify whether the tls server certificate common name must be verified when connecting to a SIP/TLS server.
+ * @ingroup initializing
**/
void linphone_core_verify_server_cn(LinphoneCore *lc, bool_t yesno){
sal_verify_server_cn(lc->sal,yesno);
return lc->data;
}
+
+/**
+ * Associate a user pointer to the linphone core.
+ *
+ * @ingroup initializing
+**/
void linphone_core_set_user_data(LinphoneCore *lc, void *userdata){
lc->data=userdata;
}
return lc->net_conf.mtu;
}
+/**
+ * Sets the maximum transmission unit size in bytes.
+ * This information is useful for sending RTP packets.
+ * Default value is 1500.
+ *
+ * @ingroup media_parameters
+**/
void linphone_core_set_mtu(LinphoneCore *lc, int mtu){
lc->net_conf.mtu=mtu;
if (mtu>0){
*/
void linphone_core_enable_keep_alive(LinphoneCore* lc,bool_t enable) {
if (enable > 0) {
+ sal_use_tcp_tls_keepalive(lc->sal,lc->sip_conf.tcp_tls_keepalive);
sal_set_keepalive_period(lc->sal,lc->sip_conf.keepalive_period);
} else {
sal_set_keepalive_period(lc->sal,0);