]> sjero.net Git - linphone/commitdiff
Add configurable delay timeout for ice/upnp
authorYann Diorcet <yann.diorcet@belledonne-communications.com>
Tue, 19 Feb 2013 10:21:20 +0000 (11:21 +0100)
committerYann Diorcet <yann.diorcet@belledonne-communications.com>
Tue, 19 Feb 2013 10:21:20 +0000 (11:21 +0100)
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/private.h
mediastreamer2

index 8068964c0a2f81606597d3cbabb9d7761432ba3a..ea439dc249f9b6a83d5a6db7a02f18822841a140 100644 (file)
@@ -666,6 +666,9 @@ static void sip_config_read(LinphoneCore *lc)
 
        tmp=lp_config_get_int(lc->config,"sip","in_call_timeout",0);
        linphone_core_set_in_call_timeout(lc,tmp);
+       
+       tmp=lp_config_get_int(lc->config,"sip","delayed_timeout",4);
+       linphone_core_set_delayed_timeout(lc,tmp);
 
        /* get proxies config */
        for(i=0;; i++){
@@ -2092,7 +2095,7 @@ void linphone_core_iterate(LinphoneCore *lc){
                 linphone_core_start_invite() */
                calls=calls->next;
                linphone_call_background_tasks(call,one_second_elapsed);
-               if (call->state==LinphoneCallOutgoingInit && (elapsed>=4)){
+               if (call->state==LinphoneCallOutgoingInit && (elapsed>=lc->sip_conf.delayed_timeout)){
                        /*start the call even if the OPTIONS reply did not arrive*/
                        if (call->ice_session != NULL) {
                                ms_warning("ICE candidates gathering from [%s] has not finished yet, proceed with the call without ICE anyway."
@@ -3493,6 +3496,26 @@ int linphone_core_get_in_call_timeout(LinphoneCore *lc){
        return lc->sip_conf.in_call_timeout;
 }
 
+/**
+ * Returns the delayed timeout
+ *
+ * @ingroup call_control
+ * See linphone_core_set_delayed_timeout() for details.
+**/
+int linphone_core_get_delayed_timeout(LinphoneCore *lc){
+       return lc->sip_conf.delayed_timeout;
+}
+
+/**
+ * Set the in delayed timeout in seconds.
+ *
+ * @ingroup call_control
+ * After this timeout period, a delayed call (internal call initialisation or resolution) is resumed.
+**/
+void linphone_core_set_delayed_timeout(LinphoneCore *lc, int seconds){
+       lc->sip_conf.delayed_timeout=seconds;
+}
+
 void linphone_core_set_presence_info(LinphoneCore *lc,int minutes_away,
                                                                                                        const char *contact,
                                                                                                        LinphoneOnlineStatus presence_mode)
@@ -5014,6 +5037,7 @@ void sip_config_uninit(LinphoneCore *lc)
        lp_config_set_string(lc->config,"sip","contact",config->contact);
        lp_config_set_int(lc->config,"sip","inc_timeout",config->inc_timeout);
        lp_config_set_int(lc->config,"sip","in_call_timeout",config->in_call_timeout);
+       lp_config_set_int(lc->config,"sip","delayed_timeout",config->delayed_timeout);
        lp_config_set_int(lc->config,"sip","use_info",config->use_info);
        lp_config_set_int(lc->config,"sip","use_rfc2833",config->use_rfc2833);
        lp_config_set_int(lc->config,"sip","use_ipv6",config->ipv6_enabled);
index 774ef925b5f712e556e146de1567e3f29b38a600..78193aaa0c7f7639f7db7a6f397fbaf7b9232d17 100644 (file)
@@ -1099,6 +1099,10 @@ void linphone_core_set_in_call_timeout(LinphoneCore *lc, int seconds);
 
 int linphone_core_get_in_call_timeout(LinphoneCore *lc);
 
+void linphone_core_set_delayed_timeout(LinphoneCore *lc, int seconds);
+
+int linphone_core_get_delayed_timeout(LinphoneCore *lc);
+
 void linphone_core_set_stun_server(LinphoneCore *lc, const char *server);
 
 const char * linphone_core_get_stun_server(const LinphoneCore *lc);
index 149fbac58eceff612204437df929d4a08e634982..90054052c7b72e48ba790dd682a65b29740e4267 100644 (file)
@@ -420,6 +420,7 @@ typedef struct sip_config
        MSList *deleted_proxies;
        int inc_timeout;        /*timeout after an un-answered incoming call is rejected*/
        int in_call_timeout;    /*timeout after a call is hangup */
+       int delayed_timeout;    /*timeout after a delayed call is resumed */
        unsigned int keepalive_period; /* interval in ms between keep alive messages sent to the proxy server*/
        LCSipTransports transports;
        bool_t use_info;
index 73a772ac4754734c57ecbc1149cbe665acd2f376..756a51419d833105a6378db71679073f6e9492b0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 73a772ac4754734c57ecbc1149cbe665acd2f376
+Subproject commit 756a51419d833105a6378db71679073f6e9492b0