Esempio n. 1
0
		public void WriteCseq(int number, Methods method)
		{
			CSeq = number;
			Method = method;

			Write(C.CSeq, C.HCOLON, C.SP, number, C.SP, method.ToByteArrayPart(), C.CRLF);
		}
Esempio n. 2
0
		public void WriteRequestLine(Methods method, Transports transport, IPEndPoint endPoint)
		{
			Method = method;

			Write(method.ToByteArrayPart(), C.SP, C.sip, C.HCOLON);
			Write(endPoint);
			Write(C.SEMI, C.transport, C.EQUAL);
			Write(transport.ToTransportParamUtf8Bytes());
			Write(C.SP, C.SIP_2_0, C.CRLF);
		}
Esempio n. 3
0
		public void WriteRequestLine(Methods method, ByteArrayPart requestUri)
		{
			Method = method;

			Write(method.ToByteArrayPart(), C.SP, requestUri, C.SP, C.SIP_2_0, C.CRLF);
		}
Esempio n. 4
0
		public void WriteRequestLine(Methods method, UriSchemes scheme, ByteArrayPart user, ByteArrayPart domain)
		{
			Method = method;

			Write(method.ToByteArrayPart(), C.SP);
			Write(scheme.ToByteArrayPart(), C.HCOLON, user, C.At, domain);
			Write(C.SP, C.SIP_2_0, C.CRLF);
		}
Esempio n. 5
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);
			}
		}