Ejemplo n.º 1
0
        /// Что с этой функцией делать?! Как отсюда убрать? Убрать в Helpers?
        private void WriteAuthorization(SipMessageWriter writer, Methods method, ArraySegment <byte> content)
        {
            if (trunk.Nonce.IsValid)
            {
                int nc     = trunk.GetNextNonceCount();
                int cnonce = Environment.TickCount;

                var response = SipDigestAuthentication.GetResponseHexChars(trunk.AuthenticationId, trunk.Realm, AuthAlgorithms.Md5, trunk.Nonce,
                                                                           cnonce, nc, trunk.Password, trunk.Qop, trunk.Uri, method.ToByteArrayPart(), content);

                writer.WriteDigestAuthorization(trunk.AuthHeader, trunk.AuthenticationId, trunk.Realm, trunk.Qop, AuthAlgorithms.Md5, trunk.Uri,
                                                trunk.Nonce, nc, cnonce, trunk.Opaque, response);
            }
        }