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); }
/// <summary> /// Call someone /// </summary> /// <param name="contact"></param> public void MakeCall(Contact contact) { IRequest request = _stack.CreateRequest("INVITE", _contact, contact); IClientTransaction transaction = _stack.CreateClientTransaction(request); transaction.ResponseReceived += OnInviteResponse; }