diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 276dd82f7..d12a92bdf 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -756,6 +756,7 @@ static void sip_config_read(LinphoneCore *lc) sal_use_dates(lc->sal,lp_config_get_int(lc->config,"sip","put_date",0)); sal_enable_sip_update_method(lc->sal,lp_config_get_int(lc->config,"sip","sip_update",1)); lc->sip_conf.vfu_with_info=lp_config_get_int(lc->config,"sip","vfu_with_info",1); + linphone_core_set_sip_transport_timeout(lc, lp_config_get_int(lc->config, "sip", "transport_timeout", 63000)); } static void rtp_config_read(LinphoneCore *lc) @@ -1115,6 +1116,16 @@ void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw){ if (linphone_core_ready(lc)) lp_config_set_int(lc->config,"net","upload_bw",bw); } +void linphone_core_set_sip_transport_timeout(LinphoneCore *lc, int timeout_ms) { + sal_set_transport_timeout(lc->sal, timeout_ms); + if (linphone_core_ready(lc)) + lp_config_set_int(lc->config, "sip", "transport_timeout", timeout_ms); +} + +int linphone_core_get_sip_transport_timeout(LinphoneCore *lc) { + return sal_get_transport_timeout(lc->sal); +} + void linphone_core_enable_dns_srv(LinphoneCore *lc, bool_t enable) { sal_enable_dns_srv(lc->sal, enable); if (linphone_core_ready(lc)) diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index fda0ccc7c..6e0d88807 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1811,6 +1811,22 @@ LINPHONE_PUBLIC void linphone_core_set_upload_ptime(LinphoneCore *lc, int ptime) LINPHONE_PUBLIC int linphone_core_get_upload_ptime(LinphoneCore *lc); +/** + * Set the SIP transport timeout. + * @param[in] lc #LinphoneCore object. + * @param[in] timeout_ms The SIP transport timeout in milliseconds. + * @ingroup media_parameters + */ +void linphone_core_set_sip_transport_timeout(LinphoneCore *lc, int timeout_ms); + +/** + * Get the SIP transport timeout. + * @param[in] lc #LinphoneCore object. + * @return The SIP transport timeout in milliseconds. + * @ingroup media_parameters + */ +int linphone_core_get_sip_transport_timeout(LinphoneCore *lc); + /** * Enable or disable DNS SRV resolution. * @param[in] lc #LinphoneCore object.