diff --git a/coreapi/misc.c b/coreapi/misc.c index 1dc3b7e70..0ea84ca1d 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -462,8 +462,13 @@ static int recvStunResponse(ortp_socket_t sock, char *ipaddr, int *port, int *id struct in_addr ia; stunParseMessage(buf,len, &resp ); *id=resp.msgHdr.tr_id.octet[0]; - *port = resp.mappedAddress.ipv4.port; - ia.s_addr=htonl(resp.mappedAddress.ipv4.addr); + if (resp.hasXorMappedAddress){ + *port = resp.xorMappedAddress.ipv4.port; + ia.s_addr=htonl(resp.xorMappedAddress.ipv4.addr); + }else if (resp.hasMappedAddress){ + *port = resp.mappedAddress.ipv4.port; + ia.s_addr=htonl(resp.mappedAddress.ipv4.addr); + }else return -1; strncpy(ipaddr,inet_ntoa(ia),LINPHONE_IPADDR_SIZE); } return len; diff --git a/oRTP b/oRTP index 930fac6f5..d37b7097e 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 930fac6f59b13cdd6cbb5f370911a65f98bad7de +Subproject commit d37b7097e796c6dbdc57ca1f15de30bb628fa395