public Dialog Get(SipMessageReader message) { if (Dialog.HasValidId(message)) { return(dictionary.TryGetValue(GetDialogId(message))); } return(null); }
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); } } } }
private RequestProxy GetRequestProxy(int clientTransactionId) { int serverTransactionId; if (clientTransactionIds.TryGetValue(clientTransactionId, out serverTransactionId)) { return(requestProxyes.TryGetValue(serverTransactionId)); } return(null); }
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); }
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); } } } }