Commit c25ec2d6 authored by Yann Diorcet's avatar Yann Diorcet
Browse files

Merge branch 'master' of git.linphone.org:linphone into belle-sip

parents 21622904 db009da1
...@@ -355,10 +355,12 @@ void linphone_upnp_context_destroy(UpnpContext *lupnp) { ...@@ -355,10 +355,12 @@ void linphone_upnp_context_destroy(UpnpContext *lupnp) {
} }
LinphoneUpnpState linphone_upnp_context_get_state(UpnpContext *lupnp) { LinphoneUpnpState linphone_upnp_context_get_state(UpnpContext *lupnp) {
LinphoneUpnpState state; LinphoneUpnpState state = LinphoneUpnpStateKo;
ms_mutex_lock(&lupnp->mutex); if(lupnp != NULL) {
state = lupnp->state; ms_mutex_lock(&lupnp->mutex);
ms_mutex_unlock(&lupnp->mutex); state = lupnp->state;
ms_mutex_unlock(&lupnp->mutex);
}
return state; return state;
} }
...@@ -398,40 +400,46 @@ bool_t _linphone_upnp_context_is_ready_for_register(UpnpContext *lupnp) { ...@@ -398,40 +400,46 @@ bool_t _linphone_upnp_context_is_ready_for_register(UpnpContext *lupnp) {
} }
bool_t linphone_upnp_context_is_ready_for_register(UpnpContext *lupnp) { bool_t linphone_upnp_context_is_ready_for_register(UpnpContext *lupnp) {
bool_t ready; bool_t ready = FALSE;
ms_mutex_lock(&lupnp->mutex); if(lupnp != NULL) {
ready = _linphone_upnp_context_is_ready_for_register(lupnp); ms_mutex_lock(&lupnp->mutex);
ms_mutex_unlock(&lupnp->mutex); ready = _linphone_upnp_context_is_ready_for_register(lupnp);
ms_mutex_unlock(&lupnp->mutex);
}
return ready; return ready;
} }
int linphone_upnp_context_get_external_port(UpnpContext *lupnp) { int linphone_upnp_context_get_external_port(UpnpContext *lupnp) {
int port = -1; int port = -1;
ms_mutex_lock(&lupnp->mutex); if(lupnp != NULL) {
ms_mutex_lock(&lupnp->mutex);
if(lupnp->sip_udp != NULL) {
if(lupnp->sip_udp->state == LinphoneUpnpStateOk) { if(lupnp->sip_udp != NULL) {
port = lupnp->sip_udp->external_port; if(lupnp->sip_udp->state == LinphoneUpnpStateOk) {
} port = lupnp->sip_udp->external_port;
} else if(lupnp->sip_tcp != NULL) { }
if(lupnp->sip_tcp->state == LinphoneUpnpStateOk) { } else if(lupnp->sip_tcp != NULL) {
port = lupnp->sip_tcp->external_port; if(lupnp->sip_tcp->state == LinphoneUpnpStateOk) {
} port = lupnp->sip_tcp->external_port;
} else if(lupnp->sip_tls != NULL) { }
if(lupnp->sip_tls->state == LinphoneUpnpStateOk) { } else if(lupnp->sip_tls != NULL) {
port = lupnp->sip_tls->external_port; if(lupnp->sip_tls->state == LinphoneUpnpStateOk) {
port = lupnp->sip_tls->external_port;
}
} }
ms_mutex_unlock(&lupnp->mutex);
} }
ms_mutex_unlock(&lupnp->mutex);
return port; return port;
} }
const char* linphone_upnp_context_get_external_ipaddress(UpnpContext *lupnp) { const char* linphone_upnp_context_get_external_ipaddress(UpnpContext *lupnp) {
const char* addr = NULL; const char* addr = NULL;
ms_mutex_lock(&lupnp->mutex); if(lupnp != NULL) {
addr = upnp_igd_get_external_ipaddress(lupnp->upnp_igd_ctxt); ms_mutex_lock(&lupnp->mutex);
ms_mutex_unlock(&lupnp->mutex); addr = upnp_igd_get_external_ipaddress(lupnp->upnp_igd_ctxt);
ms_mutex_unlock(&lupnp->mutex);
}
return addr; return addr;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment