+}
+
+bool_t linphone_core_upnp_hook(void *data) {
+ LCSipTransports transport;
+ UpnpContext *lupnp = (UpnpContext *)data;
+
+ ms_mutex_lock(&lupnp->mutex);
+
+ /* Update ports */
+ if(lupnp->state == LinphoneUpnpStateOk) {
+ linphone_core_get_sip_transports(lupnp->lc, &transport);
+ linphone_upnp_update_port_binding(lupnp, &lupnp->sip_udp, UPNP_IGD_IP_PROTOCOL_UDP, transport.udp_port, UPNP_CORE_RETRY_DELAY);
+ linphone_upnp_update_port_binding(lupnp, &lupnp->sip_tcp, UPNP_IGD_IP_PROTOCOL_TCP, transport.tcp_port, UPNP_CORE_RETRY_DELAY);
+ linphone_upnp_update_port_binding(lupnp, &lupnp->sip_tls, UPNP_IGD_IP_PROTOCOL_TCP, transport.tls_port, UPNP_CORE_RETRY_DELAY);
+ }
+
+ linphone_upnp_update_proxy(lupnp, FALSE);