public InviteSession(ICallInternal owner, ICallManagerInternal callManager) { _callManager = callManager; Helper.GuardNotNull(owner); Helper.GuardNotNull(callManager); _call = new WeakReference(owner); _state = owner.IsIncoming ? (AbstractState) new IncomingInviteState(this) : new NullInviteState(this); }
public InviteSession(ICallInternal owner, ICallManagerInternal callManager) { _callManager = callManager; Helper.GuardNotNull(owner); Helper.GuardNotNull(callManager); _call = new WeakReference(owner); _state = owner.IsIncoming ? (AbstractState) new IncomingInviteState(this) : new NullInviteState(this); }
public MediaSession(ICallInternal call, ILocalRegistry localRegistry, ICallManagerInternal callManager, IConferenceBridge conferenceBridge) { Helper.GuardNotNull(call); Helper.GuardNotNull(localRegistry); Helper.GuardNotNull(callManager); Helper.GuardNotNull(conferenceBridge); _call = new WeakReference(call); _state = new NoneMediaState(this); _localRegistry = localRegistry; _callManager = callManager; _conferenceBridge = conferenceBridge; }
public MediaSession(ICallInternal call, ILocalRegistry localRegistry, ICallManagerInternal callManager, IConferenceBridge conferenceBridge) { Helper.GuardNotNull(call); Helper.GuardNotNull(localRegistry); Helper.GuardNotNull(callManager); Helper.GuardNotNull(conferenceBridge); _call = new WeakReference(call); _state = new NoneMediaState(this); _localRegistry = localRegistry; _callManager = callManager; _conferenceBridge = conferenceBridge; }
private void AddCallAndUpdateEaCache(string destinationUri, ICallInternal call) { _activeCalls.Add(call.Id, call); CallStateChangedEventArgs ea; if (!_eaCache.TryGetValue(new ValueWrapper <int>(call.Id), out ea)) { ea = new CallStateChangedEventArgs { Id = call.Id }; _eaCache.Add(new ValueWrapper <int>(call.Id), ea); } ea.DestinationUri = destinationUri; }
public void RaiseRingEvent(ICallInternal call, bool ringOn) { //try //{ call.InviteSession.IsRinging = true; // if (_syncContext != null) // _syncContext.Post(s => Ring(this, new RingEventArgs(ringOn, call)), null); // else // Ring(this, new RingEventArgs(ringOn, call)); //} //catch (InvalidOperationException) //{ Ring(this, new RingEventArgs(ringOn, call)); //} }
public void RaiseCallStateChanged(ICallInternal call) { CallStateChangedEventArgs ea; if (_eaCache.TryGetValue(new ValueWrapper <int>(call.Id), out ea)) { ea.InviteState = call.InviteState; ea.MediaState = call.MediaState; //try //{ // if (_syncContext != null) // _syncContext.Post(s => CallStateChanged(this, ea), null); // else // CallStateChanged(this, ea); //} //catch (InvalidOperationException) //{ CallStateChanged(this, ea); //} } }
public void TerminateCall(ICallInternal call) { Helper.GuardNotNull(call); lock (_lock) { if (_activeCalls.ContainsKey(call.Id)) { _activeCalls.Remove(call.Id); } else { throw new InvalidOperationException("There is no call with id = " + call.Id + " in active calls. Can not terminate."); } call.InternalDispose(); if (_activeCalls.Count == 0) { _barrier.Set(); } } }
private void AddCallAndUpdateEaCache(string destinationUri, ICallInternal call) { _activeCalls.Add(call.Id, call); CallStateChangedEventArgs ea; if (!_eaCache.TryGetValue(new ValueWrapper<int>(call.Id), out ea)) { ea = new CallStateChangedEventArgs {Id = call.Id}; _eaCache.Add(new ValueWrapper<int>(call.Id), ea); } ea.DestinationUri = destinationUri; }
public void RaiseRingEvent(ICallInternal call, bool ringOn) { //try //{ call.InviteSession.IsRinging = true; // if (_syncContext != null) // _syncContext.Post(s => Ring(this, new RingEventArgs(ringOn, call)), null); // else // Ring(this, new RingEventArgs(ringOn, call)); //} //catch (InvalidOperationException) //{ Ring(this, new RingEventArgs(ringOn, call)); //} }
public void RaiseCallStateChanged(ICallInternal call) { CallStateChangedEventArgs ea; if (_eaCache.TryGetValue(new ValueWrapper<int>(call.Id), out ea)) { ea.InviteState = call.InviteState; ea.MediaState = call.MediaState; //try //{ // if (_syncContext != null) // _syncContext.Post(s => CallStateChanged(this, ea), null); // else // CallStateChanged(this, ea); //} //catch (InvalidOperationException) //{ CallStateChanged(this, ea); //} } }
public void TerminateCall(ICallInternal call) { Helper.GuardNotNull(call); lock (_lock) { if (_activeCalls.ContainsKey(call.Id)) _activeCalls.Remove(call.Id); else throw new InvalidOperationException("There is no call with id = " + call.Id + " in active calls. Can not terminate."); call.InternalDispose(); if (_activeCalls.Count == 0) _barrier.Set(); } }