private static bool IsDisplayNameValid(StringSegment chars)
        {
            if (chars == StringSegment.Empty)
            {
                return(true);
            }

            if (SipCharacters.IsValidQuoted(chars))
            {
                return(true);
            }

            if (SipCharacters.IsValidTokenExcludeWhitespase(chars))
            {
                return(true);
            }

            return(false);
        }
示例#2
0
        private bool IsValidValue()
        {
            if (isSingleName)
            {
                return(true);
            }

            if (currentValue == StringSegment.Empty)
            {
                return(false);
            }

            if (SipCharacters.IsValidQuoted(currentValue))
            {
                return(true);
            }

            if (!SipCharacters.IsValidToken(currentValue))
            {
                return(false);
            }

            return(true);
        }