public void StartCall(string strRemoteJID) { /// Start up our mic and speaker, start up our mixer /// if (m_bCallActive == true) { Console.WriteLine("Cal active return"); return; } if (addresses.Length <= 0) { throw new Exception("No IP addresses on System"); } int nPort = GetNextPort(); IPEndPoint ep = new IPEndPoint(addresses[0], nPort); source = new AudioStreamSource(); /// may need a lock here to make sure we have this session added to our list before the xmpp response gets back, though this should be many times faster than network traffic MediaSession = new JingleMediaSession(strRemoteJID, ep, App.XMPPClient); MediaSession.UseStun = true; MediaSession.AudioRTPStream.UseInternalTimersForPacketPushPull = false; MediaSession.ClearAllPayloads(); MediaSession.AddKnownAudioPayload(KnownAudioPayload.G722_40); // Only g711, speex can't be encoded real time on the xoom (oops, this is the windows phone, we'll have to try that later) Console.WriteLine(MediaSession.SendInitiateSession()); }
void StopCall(bool bSendTerminate) { m_bCallActive = false; if (MediaSession != null) { App.XMPPClient.JingleSessionManager.TerminateSession(MediaSession.Session, TerminateReason.Gone); MediaSession = null; } if (OnCallStopped != null) { OnCallStopped(this, new EventArgs()); } }
public void StartCall(string strRemoteJID) { /// Start up our mic and speaker, start up our mixer /// if (m_bCallActive == true) return; if (addresses.Length <= 0) throw new Exception("No IP addresses on System"); int nPort = GetNextPort(); IPEndPoint ep = new IPEndPoint(addresses[0], nPort); source = new AudioStreamSource(); /// may need a lock here to make sure we have this session added to our list before the xmpp response gets back, though this should be many times faster than network traffic MediaSession = new JingleMediaSession(strRemoteJID, ep, App.XMPPClient); MediaSession.UseStun = true; MediaSession.AudioRTPStream.UseInternalTimersForPacketPushPull = false; MediaSession.ClearAllPayloads(); MediaSession.AddKnownAudioPayload(KnownAudioPayload.G722_40); // Only g711, speex can't be encoded real time on the xoom (oops, this is the windows phone, we'll have to try that later) MediaSession.SendInitiateSession(); }
void StopCall(bool bSendTerminate) { m_bCallActive = false; if (MediaSession != null) { App.XMPPClient.JingleSessionManager.TerminateSession(MediaSession.Session, TerminateReason.Gone); MediaSession = null; } if (OnCallStopped != null) OnCallStopped(this, new EventArgs()); }