コード例 #1
0
ファイル: CallManager.cs プロジェクト: jeoffman/SipSharp
        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);
        }
コード例 #2
0
ファイル: UserAgent.cs プロジェクト: jeoffman/SipSharp
        public void Send(IRequest request)
        {
            IClientTransaction transaction = _stack.CreateClientTransaction(request);

            transaction.Terminated       += OnTransactionTerminated;
            transaction.TransportFailed  += OnTransportFailed;
            transaction.ResponseReceived += OnInviteResponse;
            _stack.Send(request);
        }