< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

[reSIProcate-users] confusion on STUN client


Hello,

Webpage https://www.resiprocate.org/STUN_support introduces a way to use UdpTransport class to get STUN mapped IP address and port.

m_pUdpTransport = (resip::UdpTransport*)mStack->addTransport(UDP, UDPPort, V4, StunEnabled, IPAddress));
UdpTransport includes two methods for STUN client support:

bool stunSendTest(const Tuple& dest);
bool stunResult(Tuple& mappedAddress); 

I am wondering whether the STUN client, m_pUdpTransport , can not only be used to interact with STUN server but also be used to transmit & receive media stream data to/from callee? 

My understanding of using STUN server to do NAT traversal during a Voip phone call is that, the STUN client selects a local port and creates a socket to bind to the local port and IP address. Then the STUN client contacts an external STUN server to get its STUN mapped public IP address and port. This public address and port are used in SDP portion of SIP INVITE message for remote peer to know where to send RTP media stream to the caller. Since the local port and IP address have been tied to STUN client socket already, they can not be used to bind another socket for local VOIP applications to send media stream to callee, thus, the application has to send / receive media steam through STUN client. Is this correct?

Tom