Example #1
0
 public Dialog Get(SipMessageReader message)
 {
     if (Dialog.HasValidId(message))
     {
         return(dictionary.TryGetValue(GetDialogId(message)));
     }
     return(null);
 }
Example #2
0
        private Publication GetValidPublication(string publicationId, bool addIfNotFound)
        {
            Publication publication;

            if (publications.TryGetValue(publicationId, out publication) == false)
            {
                if (addIfNotFound)
                {
                    publication = publications.GetOrAdd(publicationId, new Publication(publicationId));
                }
            }

            return(publication);
        }
        public static void SignMessage(SipMessageWriter writer)
        {
            Tracer.WriteInformation("SingMessage epid: " + writer.Epid.ToString());

            if (writer.Epid.IsValid)
            {
                SecurityAssociation sa;
                if (authorizedAssociations.TryGetValue(writer.Epid.ToString(), out sa))
                {
                    if (sa.IsAuthenticationComplete)
                    {
                        sa.SignMessage(writer);
                    }
                }
            }
        }
Example #4
0
        private RequestProxy GetRequestProxy(int clientTransactionId)
        {
            int serverTransactionId;

            if (clientTransactionIds.TryGetValue(clientTransactionId, out serverTransactionId))
            {
                return(requestProxyes.TryGetValue(serverTransactionId));
            }
            return(null);
        }
Example #5
0
        private void ProccessCancelRequest(AcceptedRequest tu, IncomingMessageEx request)
        {
            var statusCode = StatusCodes.CallLegTransactionDoesNotExist;

            int inviteTransactionKId = Transaction.GetRelaytedInviteServerKId(request.TransactionId);

            if (inviteTransactionKId != Transaction.InvalidKId)
            {
                var requestProxy = requestProxyes.TryGetValue(inviteTransactionKId);

                if (requestProxy != null)
                {
                    CancelClients(requestProxy, request.Reader);
                    statusCode = StatusCodes.OK;
                }
            }

            SendResponse(request, statusCode);
        }
Example #6
0
        public void RemoveBindingsWhenConnectionEnd(int connectionId)
        {
            ByteArrayPart aor;

            if (bindingsByConnectionId.TryGetValue(connectionId, out aor))
            {
                Bindings bindings = GetBindings(aor);

                if (bindings != null)
                {
                    if (bindings.TryRemoveByConnectionId(connectionId, ContactRemovedHandler))
                    {
                        RemoveStaleBindings(bindings);
                    }
                }
            }
        }