mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 06:38:08 +00:00
update to latest STUN API
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@231 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
f2c7c36574
commit
04a97f1c91
1 changed files with 3 additions and 3 deletions
|
|
@ -512,7 +512,7 @@ static int sendStunRequest(int sock, const struct sockaddr *server, socklen_t ad
|
|||
memset(&username,0,sizeof(username));
|
||||
memset(&password,0,sizeof(password));
|
||||
stunBuildReqSimple( &req, &username, changeAddr , changeAddr , id);
|
||||
len = stunEncodeMessage( &req, buf, len, &password, FALSE);
|
||||
len = stunEncodeMessage( &req, buf, len, &password);
|
||||
if (len<=0){
|
||||
ms_error("Fail to encode stun message.");
|
||||
return -1;
|
||||
|
|
@ -561,8 +561,8 @@ static int recvStunResponse(ortp_socket_t sock, char *ipaddr, int *port, int *id
|
|||
len=recv(sock,buf,len,0);
|
||||
if (len>0){
|
||||
struct in_addr ia;
|
||||
stunParseMessage(buf,len, &resp,FALSE );
|
||||
*id=resp.msgHdr.id.octet[0];
|
||||
stunParseMessage(buf,len, &resp );
|
||||
*id=resp.msgHdr.tr_id.octet[0];
|
||||
*port = resp.mappedAddress.ipv4.port;
|
||||
ia.s_addr=htonl(resp.mappedAddress.ipv4.addr);
|
||||
strncpy(ipaddr,inet_ntoa(ia),LINPHONE_IPADDR_SIZE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue