SetRemoteRTPEndPoint() public method

Allows an arbitrary block of bytes to be sent on the RTP channel. This is mainly used for the Gingle client which needs to send a STUN binding request to the Google Voice gateway. Sets the remote end point for the RTP channel. This will be set from the SDP packet received from the remote end of the VoIP call.
public SetRemoteRTPEndPoint ( IPEndPoint remoteEndPoint ) : void
remoteEndPoint System.Net.IPEndPoint The remote end point to send RTP to.
return void
Esempio n. 1
0
        /// <summary>
        /// An outgoing call was successfully answered.
        /// </summary>
        /// <param name="uac">The local SIP user agent client that initiated the call.</param>
        /// <param name="sipResponse">The SIP answer response received from the remote party.</param>
        private void CallAnswered(ISIPClientUserAgent uac, SIPResponse sipResponse)
        {
            StatusMessage("Call answered: " + sipResponse.StatusCode + " " + sipResponse.ReasonPhrase + ".");

            if (sipResponse.StatusCode >= 200 && sipResponse.StatusCode <= 299)
            {
                IPEndPoint remoteSDPEndPoint = SDP.GetSDPRTPEndPoint(sipResponse.Body);
                _audioChannel.SetRemoteRTPEndPoint(remoteSDPEndPoint);
                CallAnswer();
            }
            else
            {
                CallFinished();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Event handler for an answer on an outgoing Google Voice call.
        /// </summary>
        /// <param name="xmppSDP">The SDP packet received from the Google Voice gateway.</param>
        private void XMPPAnswered(SDP xmppSDP)
        {
            StatusMessage("Google Voice call answered.");

            IPEndPoint remoteSDPEndPoint = SDP.GetSDPRTPEndPoint(xmppSDP.ToString());

            _audioChannel.SetRemoteRTPEndPoint(remoteSDPEndPoint);

            // Google Voice require that a STUN exchange occurs on the RTP socket before the RTP packet can flow.
            // This code block sends a STUN binding request to the Google Voice gateway.
            STUNMessage initMessage = new STUNMessage(STUNMessageTypesEnum.BindingRequest);

            initMessage.AddUsernameAttribute(xmppSDP.IceUfrag + m_localSTUNUFrag);
            byte[] stunMessageBytes = initMessage.ToByteBuffer();
            //_audioChannel.SendRTPRaw(stunMessageBytes, stunMessageBytes.Length);
        }