public SetRemoteRTPEndPoint ( |
||
remoteEndPoint | The remote end point to send RTP to. | |
return | void |
/// <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(); } }
/// <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); }