after having heavy Problems with my xamarin Client I made a Windows 7 pc Client (.Net 4.6) of it.
I have a working sip Connection and I get an incoming call from the Gateway / Server, with an Invite and later Ack. I use the exact session description I get from the Server to create a rtp Client:
if (rtpClient == null || !rtpClient.IsActive)
Media.Sdp.SessionDescription sessionDescription = new Media.Sdp.SessionDescription(session.ToString());
sessionDescription.SessionName = session.Name;
sessionDescription.SessionId = session.Owner.SessionID.ToString();
rtpClient = Media.Rtp.RtpClient.FromSessionDescription(sessionDescription);
In my case, 114 is the Server / Gateway, 125 is me.
The Session description is:
o=sip 123456 654321 IN IP4 192.168.1.114
c=IN IP4 192.168.1.114
m=audio 7078 RTP/AVP 0 8 101
m=video 9078 RTP/AVP 96
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0IAHqtAoPyA,aM44gA==
I always get a
37 6.408811 192.168.1.114 192.168.1.125 ICMP 126 Destination unreachable (Port unreachable)
I added some logging to the media.RtpClient.
I found the part where I hang:
In the SendReceive Method I changed it to:
//if Rtcp is enabled
if (rtcpEnabled && false == (shouldStop || IsDisposed || m_StopRequested))
Console.WriteLine("RTCP is enabled");
if (//The last report was never received or recieved longer ago then required
(tc.LastRtcpReportReceived == TimeSpan.MinValue || tc.LastRtcpReportReceived >= tc.m_ReceiveInterval))
// && //And the socket can read
// /tc.RtcpSocket.Available > 0 ||
/ tc.RtcpSocket.Poll((int)(Math.Round(Media.Common.Extensions.TimeSpan.TimeSpanExtensions.TotalMicroseconds(tc.m_ReceiveInterval) / Media.Common.Extensions.TimeSpan.TimeSpanExtensions.MicrosecondsPerMillisecond,
MidpointRounding.ToEven) /* 3000
receivedRtcp += ReceiveData(tc.RtcpSocket, ref tc.RemoteRtcp, out lastError, duplexing, rtcpEnabled, tc.ContextMemory);
Console.WriteLine("RTCP receives data");
//Check if an error occured
if (lastError != SocketError.Success)
Console.WriteLine("RTCP error: "+lastError.ToString());
Only when I remove the RtcpSocket.Poll I get into the part under it.
I get then a console log like this:
RTCP is enabled
RTCP receives data
RTCP error: ConnectionReset
RTCP is enabled
Since I am using the IPs and Ports from the SIP, I do not understand how These can be Problem or how to fix that?
I also added a log for Initializing the Transport context in the initialize method:
Transportcontext initialized: localRTP:192.168.1.125:30000 remoteRTP:192.168.1.114:7078 localRTCP:192.168.1.125:30001 remoteRTCP:192.168.1.114:7079
Transportcontext initialized: localRTP:192.168.1.125:30002 remoteRTP:192.168.1.114:9078 localRTCP:192.168.1.125:30003 remoteRTCP:192.168.1.114:9079
Can you pleaase tell me what I am doing wrong here or what could cause this Problem?
I am still having Problems with my Xamarin Client, but I thought I could just get my Windows Client working.
Help would be great, thanks!