public Call Call(Contact from, Contact to) { IRequest request = _stack.CreateRequest(SipMethod.INVITE, from, to); IClientTransaction transaction = _stack.Send(request); transaction.ResponseReceived += OnResponse; transaction.TimedOut += OnTimeout; transaction.TransportFailed += OnTransportFailed; transaction.Terminated += OnTerminate; var call = new Call { Destination = new CallParty { Contact = to }, Caller = new CallParty { Contact = from }, Id = request.CallId, Reason = CallReasons.Direct, State = CallState.Proceeding }; _calls.Add(call.Id, call); CallChanged(this, new CallEventArgs(call)); return(call); }
public void Send(IRequest request) { IClientTransaction transaction = _stack.CreateClientTransaction(request); transaction.Terminated += OnTransactionTerminated; transaction.TransportFailed += OnTransportFailed; transaction.ResponseReceived += OnInviteResponse; _stack.Send(request); }