예제 #1
0
        public void TransportError(int transactionKId)
        {
            if (transactionKId != Transaction.InvalidKId)
            {
                switch (Transaction.GetTransactionBasicKind(transactionKId))
                {
                case Transaction.Kind.NonInviteClient:
                {
                    NonInviteClientTransaction transaction;
                    int action = nonInviteClientTransactions.ProccessTransportError(transactionKId, out transaction);
                    DoWork <NonInviteClientTransaction>(transaction, action);
                    break;
                }

                case Transaction.Kind.NonInviteServer:
                {
                    NonInviteServerTransaction transaction;
                    int action = nonInviteServerTransactions.ProccessTransportError(transactionKId, out transaction);
                    DoWork <NonInviteServerTransaction>(transaction, action);
                    break;
                }

                case Transaction.Kind.InviteClient:
                {
                    InviteClientTransaction transaction;
                    int action = inviteClientTransactions.ProccessTransportError(transactionKId, out transaction);
                    DoWork <InviteClientTransaction>(transaction, action);
                    break;
                }

                case Transaction.Kind.InviteServer:
                {
                    InviteServerTransaction transaction;
                    int action = inviteServerTransactions.ProccessTransportError(transactionKId, out transaction);
                    DoWork <InviteServerTransaction>(transaction, action);
                    break;
                }

                default:
                    throw new InvalidProgramException();
                }
            }
        }
예제 #2
0
        private void SendResponse(ConnectionAddresses connectionAddresses, int transactionKId, SipMessageWriter writer)
        {
            var e = CreateOutgoingMessage(connectionAddresses, writer, transactionKId);

            int action;

            switch (Transaction.GetTransactionBasicKind(transactionKId))
            {
            case Transaction.Kind.InviteServer:
                action = inviteServerTransactions.ProccessTransactionUser(transactionKId, e, writer.StatusCode);
                break;

            case Transaction.Kind.NonInviteServer:
                action = nonInviteServerTransactions.ProccessTransactionUser(transactionKId, e, writer.StatusCode);
                break;

            default:
                throw new NotImplementedException();
            }

            DoWork(e, transactionKId, action);
        }
예제 #3
0
        private void SendRequest(int router, ConnectionAddresses connectionAddresses, int transactionKId, SipMessageWriter writer, int userData)
        {
            bool isAck = writer.Method == Methods.Ackm;
            var  e     = CreateOutgoingMessage(connectionAddresses, writer, transactionKId);

            int action;

            //switch (Transaction.GetKindForOutgoing(writer.Method, writer.IsRequest))
            switch (Transaction.GetTransactionBasicKind(transactionKId))
            {
            case Transaction.Kind.InviteClient:
                action = inviteClientTransactions.ProccessTransactionUser(transactionKId, router, userData, isAck, e);
                break;

            case Transaction.Kind.NonInviteClient:
                action = nonInviteClientTransactions.ProccessTransactionUser(transactionKId, router, userData, isAck, e);
                break;

            default:
                throw new NotImplementedException();
            }

            DoWork(e, transactionKId, action);
        }