Ejemplo n.º 1
0
 public ValidateMessageResult ValidateMessage(SipMessage message)
 {
     //testing commit
     if (message is SipRequest)
     {
         var request = message as SipRequest;
         var result  = new ValidateRequestResult();
         result.MissingRequiredHeader    = FindFirstMissingRequiredHeader(message);
         result.HasUnSupportedSipVersion = !ValidateSipVersion(request.RequestLine.Version);
         if (result.HasRequiredHeadersMissing)
         {
             return(result);
         }
         result.HasInvalidSCeqMethod     = !ValidateCSeqMethod(request);
         result.InviteHasNoContactHeader = !ValidateContactHeader(request);
         return(result);
     }
     else
     {
         var response = message as SipResponse;
         var result   = new ValidateMessageResult();
         result.MissingRequiredHeader    = FindFirstMissingRequiredHeader(message);
         result.HasUnSupportedSipVersion = !ValidateSipVersion(response.StatusLine.Version);
         return(result);
     }
 }
Ejemplo n.º 2
0
 public ValidateRequestResult ValidateRequest(SipRequest request)
 {
     var result = new ValidateRequestResult();
     if (!SipMethods.IsMethod(request.RequestLine.Method))
     {
         result.UnSupportedSipMethod = request.RequestLine.Method;
     }
     result.MissingRequiredHeader = FindFirstMissingRequiredHeader(request);
     result.HasUnSupportedSipVersion = !ValidateSipVersion(request.RequestLine.Version);
     if (result.HasRequiredHeadersMissing) return result;
     result.HasInvalidSCeqMethod = !ValidateCSeqMethod(request);
     return result;
 }
Ejemplo n.º 3
0
        public ValidateRequestResult ValidateRequest(SipRequest request)
        {
            var result = new ValidateRequestResult();

            if (!SipMethods.IsMethod(request.RequestLine.Method))
            {
                result.UnSupportedSipMethod = request.RequestLine.Method;
            }
            result.MissingRequiredHeader    = FindFirstMissingRequiredHeader(request);
            result.HasUnSupportedSipVersion = !ValidateSipVersion(request.RequestLine.Version);
            if (result.HasRequiredHeadersMissing)
            {
                return(result);
            }
            result.HasInvalidSCeqMethod = !ValidateCSeqMethod(request);
            return(result);
        }
Ejemplo n.º 4
0
 public ValidateMessageResult ValidateMessage(SipMessage message)
 {
     //testing commit
     if(message is SipRequest)
     {
         var request = message as SipRequest;
         var result = new ValidateRequestResult();
         result.MissingRequiredHeader = FindFirstMissingRequiredHeader(message);
         result.HasUnSupportedSipVersion = !ValidateSipVersion(request.RequestLine.Version);
         if (result.HasRequiredHeadersMissing) return result;
         result.HasInvalidSCeqMethod = !ValidateCSeqMethod(request);
         result.InviteHasNoContactHeader = !ValidateContactHeader(request);
         return result;
     }
     else
     {
         var response = message as SipResponse;
         var result = new ValidateMessageResult();
         result.MissingRequiredHeader = FindFirstMissingRequiredHeader(message);
         result.HasUnSupportedSipVersion = !ValidateSipVersion(response.StatusLine.Version);
         return result;
     }
 }