+ /* Refresh registers if we are ready */
+ if(now - lupnp->last_ready_check >= UPNP_CORE_READY_CHECK) {
+ lupnp->last_ready_check = now;
+ ready_state = (_linphone_upnp_context_is_ready_for_register(lupnp))? LinphoneUpnpStateOk: LinphoneUpnpStateKo;
+ if(ready_state != lupnp->last_ready_state) {
+ for(item=linphone_core_get_proxy_config_list(lupnp->lc);item!=NULL;item=item->next) {
+ LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)item->data;
+ if (linphone_proxy_config_register_enabled(cfg)) {
+ if (ready_state != LinphoneUpnpStateOk) {
+ // Only reset ithe registration if we require that upnp should be ok
+ if(lupnp->lc->sip_conf.register_only_when_upnp_is_ok) {
+ linphone_proxy_config_set_state(cfg, LinphoneRegistrationNone, "Registration impossible (uPnP not ready)");
+ }
+ } else {
+ cfg->commit=TRUE;
+ }
+ }
+ }
+ lupnp->last_ready_state = ready_state;
+ }
+ }
+