<%
'SUBROUTINES DEFINED:
'"""""""""""""""""""
'SetupSessionVariables(AuthUser)		Sets up the session variables
'GetSessionStatusStr()					Returns the error string associated with the session error code
'SetError(Message)						Sets the text of the main error message
'SetReason(Message)						Sets the text of the reason paragraph
'AddFix(Message)						Adds an item to the bulleted list of suggestions
'Check_Browser_Capabilities()			Sets error if the Client browser lacks Tables and JavaScript support
'Invalid_Password()						Sets an error due to an invalid password
'IsConfID()								Sets error if the Conference ID is not set (inConfID)
'ValidateMeetingID()					Sets error if the DCS Meeting ID is not valid (inMeetingID)
'Verify_ConfLocator()					Verifies ConfLocator points to the Conference Locator
'DisplayErrorPage()						Setup the error page when we have an error
'
'FUNCTIONS DEFINED:
'"""""""""""""""""
'CheckSetError(Source, Description) Checks for error values in Result/Err and adds error messages if appropriate
'
' ================================ CONSTANTS =================================================
'ERROR CONSTANTS:
'C++ returns HRESULTS as 4-byte signed ints, so the bit pattern
'0x81000203 comes out as a negative number.
'VBScript also uses 4-byte signed ints, so assigning the bit patterns
'as below makes for better readability while still giving the 
'same negative numbers.
'If VBScript ever changes to use ints larger than 4 bytes, the
'bit patterns below will be interpreted as positive numbers and
'will have to be changed to explicitly reference the negative
'number returned by C++.
CONST E_CMS_EVENTMANAGER_NOT_INITIALIZED                = &H8004100A
CONST E_CMS_CONFERENCE_NOT_SCHEDULED                    = &H8004100B
CONST E_CMS_CONFERENCE_NOT_STARTED                      = &H8004100C
CONST E_CMS_CONFERENCE_NOT_RUNNING                      = &H8004100D
CONST E_CMS_CONFERENCE_NOT_FOUND                        = &H8004100E
CONST E_CMS_INVALID_CONFERENCE_PASSWORD                 = &H8004100F
CONST E_CMS_ANONYMOUS_USER_DENIED_ACCESS                = &H80041010
CONST E_CMS_USER_DENIED_ACCESS                          = &H80041011
CONST E_CMS_CTP_JOIN_REQUEST_FAILED                     = &H80041012
CONST E_CMS_PROVIDER_NOT_INITIALIZED                    = &H80041013
CONST E_CMS_PROVIDER_NOT_FOUND                          = &H80041014
CONST E_CMS_E_CONFERENCE_NOT_EXIST                      = &H80041015
CONST E_CMS_RECURRING_CONFERENCE_NOT_FOUND              = &H80041016
CONST E_CMS_NOT_HOST_SERVER                             = &H80041017
CONST E_CMS_RECURRING_INSTANCE_NOT_WITHIN_TIME_BOUND    = &H80041018
CONST E_CMS_AMBIGUOUS_RECURRING_JOIN                    = &H80041019
CONST E_CMS_TIME_EXTENSIONS_NOT_ALLOWED                 = &H8004101B
CONST E_CMS_RESOURCE_EXTENSIONS_NOT_ALLOWED             = &H8004101C
CONST E_CMS_SERVER_NOT_INITIALIZED                      = &H80041037
CONST E_CMS_PROFILE_STORE_NOT_INITIALIZED               = &H80041038
CONST E_CMS_SHUTTING_DOWN                               = &H4101E

CONST E_DCS_NO_MCUS_AVAILABLE                           = &H8004F001
CONST E_DCS_CONFERENCE_NOT_RUNNING                      = &H8004F002
CONST E_DCS_CONFERENCE_ALREADY_ENDED                    = &H8004F003
CONST E_DCS_ACCESS_DENIED_CAPACITY_LIMIT                = &H8004F004
CONST E_DCS_NO_PROXY_MCUS_AVAILABLE                     = &H8004F005
CONST E_DCS_NO_INTERNET_MCUS_AVAILABLE                  = &H8004F006
CONST E_DCS_NOT_RUNNING                                 = &H8004F007
CONST E_DCS_NOT_INIT                                    = &H8004F008

CONST E_NETMEETING_ERRORS_MASK                          = &H80040300
CONST E_NETMEETING_INVITE_FAILURE                       = &H8004036A
CONST E_NETMEETING_INVITE_TIMEOUT                       = &H80040372

CONST E_PKCS7_NO_CERT_STORE                             = &H80043000
CONST E_SESSION_UNAVAILABLE                             = &H80043001
CONST E_NO_DISPLAY_STATE                                = &H80043002
CONST E_UNSUPPORTED_TABLES_BROWSER                      = &H80043003
CONST E_UNSUPPORTED_JAVASCRIPT_BROWSER                  = &H80043004

CONST E_ACCESS_DENIED                                   = 70 '&H80070005 comes across as error 70 if returned
CONST E_ACCESS_DENIED_HRESULT                           = &H80070005 'if passed back as a result
CONST E_SERVER_CREATE_OBJECT                            = &H800401F3 'Server.CreateObject() error
CONST NM_E_NOT_ACTIVE                                   = &H81000203 'NetMeeting was closed since last use
CONST E_NO_GLOBAL_CONF_CALENDAR                         = &H80010105
CONST E_DSGETSITENAME_NO_SITE                           = &H8007077F
CONST E_MANUAL_JOIN_INSTRUCTIONS                        = &H80040100
CONST E_CMS_RESTARTED                                   = &H1CE

CONST E_MCU_HANG                                        = &H800706BA
CONST E_MCU_NO_SERVER_CERTIFICATE                       = &H80070546

'DISPLAY STATE CONTANTS:
'These define the various display states that can be used
'The quotes are required because the state is passed as a string
'The DCS programmatically uses {0,7,8} so those cannot easily be changed
CONST DISPLAY_JOIN                      = "0"
CONST DISPLAY_JOIN_PASSWORD             = "6"
CONST DISPLAY_PREJOIN                   = "7"
CONST DISPLAY_POSTJOIN                  = "8"
CONST DISPLAY_NO_MADCAP_SERVERS         = "9"
CONST DISPLAY_TOO_MANY_USERS            = "10"
CONST DISPLAY_ALL_MADCAP_SERVERS_FAILED = "11"
CONST DISPLAY_NO_MADCAP_SERVERS_MATCH_SCOPE = "12"
CONST DISPLAY_NO_MADCAP_SCOPES_FOUND    = "13"
CONST DISPLAY_NO_SCOPES_IN_RESOURCE     = "14"
CONST DISPLAY_MAX_JOIN_TYPES            = "14"
CONST DISPLAY_MULTICAST_CLIENT          = "15"
CONST DISPLAY_H323_CLIENT               = "16"
CONST DISPLAY_OLDER_H323_CLIENT         = "51"
CONST DISPLAY_NO_AUDIOVIDEO_CLIENT      = "52"
CONST DISPLAY_NO_AUDIOVIDEO_ACTIVEX     = "53"

CONST DISPLAY_WELCOME                   = "11"
CONST DISPLAY_RECURRING                 = "14"
CONST DISPLAY_AGENDA                    = "17"
CONST DISPLAY_MODIFY                    = "18"
CONST DISPLAY_MAX_NO_JOIN_TYPES         = "19"

CONST DISPLAY_MIN_ERR_TYPES             = "20"
CONST DISPLAY_ERR_CONFID                = "22"
CONST DISPLAY_ERR_CTP_STARTUP           = "23"
CONST DISPLAY_ERR_VALUE                 = "38"
CONST DISPLAY_MAX_ERR_TYPES             = "39"

'SESSION VARIABLE CONSTANTS
CONST SESSION_CONFPROFILE            = "ConfProfile"
CONST SESSION_CONFLOCATOR            = "ConfLocator"
CONST SESSION_CMSZONE                = "CMSZone"
CONST SESSION_CMSCONFIG              = "CMSConfig"
CONST SESSION_MEETINGID              = "MeetingID"
CONST SESSION_RESULT                 = "Result"
CONST SESSION_ERRNUMBER              = "ErrNumber"
CONST SESSION_ERRSOURCE              = "ErrSource"
CONST SESSION_ERRDESCRIPTION         = "ErrDescription"
CONST SESSION_STATUS                 = "Status"
CONST SESSION_ATTENDEE               = "Attendee"
CONST SESSION_PASSWORD				 = "Password"

CONST L_Page_HTMLTitle       = "Microsoft Exchange 会议"
CONST L_ErrorPage_HTMLTitle  = "Microsoft Exchange 会议 - 错误"
CONST L_TryTheFollowing_Text = "请尝试以下操作:"

'Session debugging/status information strings (must stay the same as global.asa)
CONST L_OK_Text                 = "确定"
CONST L_GetConfLocator_Text     = "无法从会议管理区域获取会议定位程序"
CONST L_GetZone_Text            = "无法从会议管理配置对象定位区域"
CONST L_CreateObject_Text       = "无法初始化会议管理配置对象"
CONST L_Unknown_Text            = "未知"
CONST L_Uninitialized_Text      = "未初始化"

'Common strings
CONST L_MCUProxyInvite_ErrorMessage     = "如果正在试图通过代理服务器参加会议，数据会议服务可能无法连接到您的客户端程序。要手动连接数据会议客户端，请使用以下信息:"
CONST L_ManualJoinServer_ErrorMessage   = "数据会议服务器: "
CONST L_ManualJoinID_ErrorMessage       = "会议 ID: "
CONST L_ManualJoinPassword_ErrorMessage = "会议密码: "
CONST L_NetMeetingInviteTitle_ErrorMessage  = "数据会议邀请失败"
CONST L_NetMeetingInviteReason_ErrorMessage = "数据会议服务无法邀请 T.120 数据会议客户端程序 (如 Microsoft NetMeeting) 加入到会议。"
CONST L_NetMeetingInviteFix1_ErrorMessage   = "确认已经启动了会议客户端程序，然后尝试再次参加会议。"
CONST L_LinkToConferenceListsFix_ErrorMessage  = "从有效会议列表中选择"
CONST L_LinkToConferenceListsFix2_ErrorMessage = "一个当前会议。"

CONST PR_SUBJECT             = "subject"   'Defines the subject property code for user properties
CONST PR_BODY                = "268435487" 'Defines the body text property code for user properties
CONST PR_BODY_HTML           = "269680670" 'Defines the body text (in HTML) property code for user properties
CONST MAPI_RESOURCE          = "MAPI"      'Defines the resource used when getting user properties

CONST CONF_ID_CODED_LENGTH   = 255 'Length of the Base-64 encoded conference ID
CONST CONF_ID_DECODED_LENGTH = 22 'Conference ID must be 22 digits

' ================================ VARIABLES =================================================
'ERROR VARIABLES:
DIM ErrorMsg        'Holds the main error message (displayed at the top of the error page)
DIM Reason          'Holds the paragraph description of the error (displayed below the main message)
DIM Fixes()         'Holds the suggested remedies (displayed in the bulleted list below the paragraph)
DIM HiddenError     'Holds the system-level error message (displayed in small print at the bottom)
DIM ErrorCount      'Counts the errors encountered (0 or 1)
DIM Result          'Global variable used for function return values
DIM SessionErr(5)   'Holds the error messages that are defined in the session variables code to allow localization

' =============================== INITIALIZATION ==============================================
ErrorMsg        = ""
HiddenError     = ""
Reason          = ""
ErrorCount      = 0
Result          = 0
SessionErr(0)   = L_OK_Text
SessionErr(1)   = L_GetConfLocator_Text
SessionErr(2)   = L_GetZone_Text
SessionErr(3)   = L_CreateObject_Text
SessionErr(4)   = L_Unknown_Text
SessionErr(5)   = L_Uninitialized_Text
REDIM Fixes(0)                          'Puts the array Fixes in a known state

' ================================ FUNCTIONS =================================================
'== SUB: Sets up the session variables (GetSessionStatusStr() is used for SESSION_STATUS strings)
SUB SetupSessionVariables(AuthUser)
    ON ERROR RESUME NEXT

    DIM CMSConfiguration
    DIM CMSZone
    DIM ConfLocator
    
    Session(SESSION_RESULT)          = 0
    Session(SESSION_ERRNUMBER)       = 0
    Session(SESSION_ERRSOURCE)       = 0
    Session(SESSION_ERRDESCRIPTION)  = 0
    Session(SESSION_STATUS)          = 5 'L_Uninitialized_Text
    
    'Create the CMS Configuration object (dllhost will create this from xcmsadm)
    SET CMSConfiguration = Server.CreateObject("XCMSCOM.CMSConfiguration")
    
    IF (0 <> Err.Number) THEN
        Session(SESSION_ERRNUMBER)      = Err.Number
        Session(SESSION_ERRSOURCE)      = Err.Source
        Session(SESSION_ERRDESCRIPTION) = Err.Description
        Err.Clear()
        Session(SESSION_STATUS)         = 3 'L_CreateObject_Text
        EXIT SUB
    END IF
    
    SET Session(SESSION_CMSCONFIG) = CMSConfiguration 'Save the singleton CMSConfig for up to 20 mins
    
    'Create the CMS Zone object (dllhost will create this from xcmsadm)
    CALL CMSConfiguration.GetZone("", CMSZone)
    
    IF (0 <> Err.Number) THEN
        Session(SESSION_RESULT)         = Err.Number
        Session(SESSION_ERRNUMBER)      = Err.Number
        Session(SESSION_ERRSOURCE)      = Err.Source
        Session(SESSION_ERRDESCRIPTION) = Err.Description
        Err.Clear()
        Session(SESSION_STATUS)         = 2 'L_GetZone_Text
        EXIT SUB
    END IF
    
    SET Session(SESSION_CMSZONE) = CMSZone 'Save the CMS Zone object for use later
    
    'Create the Conference Locator object (dllhost will create this from the xconfmgr service)
    CALL CMSZone.GetConferenceLocator(ConfLocator)
    
    IF (0 <> Err.Number) THEN
        Session(SESSION_RESULT)         = Err.Number
        Session(SESSION_ERRNUMBER)      = Err.Number
        Session(SESSION_ERRSOURCE)      = Err.Source
        Session(SESSION_ERRDESCRIPTION) = Err.Description
        Err.Clear()
        Session(SESSION_STATUS)         = 1 'L_GetConfLocator_Text
        EXIT SUB
    END IF

	Session(SESSION_ATTENDEE)		 = AuthUser
	    
    SET Session(SESSION_CONFLOCATOR) = ConfLocator 'Save the Conference Locator for use later
    Session(SESSION_STATUS)          = 0 'L_OK_Text
END SUB

'== SUB: Creates the session status string that we use on the bottom of the error pages
FUNCTION GetSessionStatusStr(errVal)
    IF (errVal >= 0 AND errVal <= 5) THEN
        GetSessionStatusStr = SessionErr(errVal)
    ELSE
        GetSessionStatusStr = errVal
    END IF
END FUNCTION

'== SUB: Sets the text of the main error message
SUB SetError(Message, Value, Source, Description)
    IF (0 = ErrorCount) THEN
        ErrorCount  = ErrorCount + 1
        ErrorMsg    = ErrorMsg & Message
        HiddenError = HiddenError & Source & " Error #" & Hex(Value) & ": " & Description & vbNewLine
    END IF
END SUB

'== SUB: Sets the text of the reason paragraph
SUB SetReason(Message)
    Reason = Message
END SUB

'== SUB: Adds an item to the bulleted list of suggestions
SUB AddFix(Message)
    DIM NewSize
    
    NewSize = UBound(Fixes) + 1
    REDIM PRESERVE Fixes(NewSize)
    
    Fixes(NewSize) = Message
END SUB

'== FUNCTION: Checks for error values in Result/Err and adds error messages if appropriate
FUNCTION CheckSetError(ResultSource, ResultDescription)
    DIM Value, Source, Description
    
    IF (0 <> Err.Number) THEN
        Value       = Err.Number
        Source      = Err.Source & " / [" & ResultSource & "]"
        Description = Err.Description & " / [" & ResultDescription & "]"
        Err.Clear()
    ELSEIF (0 <> Result) THEN
        IF (IsNumeric(Result)) THEN
            Value = CDbl(Result)
        ELSE
            Value = Result
        END IF
        Source      = ResultSource
        Description = ResultDescription
        Result      = 0
    ELSE
        CheckSetError = FALSE
        EXIT FUNCTION
    END IF

    'Bitwise-AND to detect all NetMeeting errors
    IF (E_NETMEETING_ERRORS_MASK = (E_NETMEETING_ERRORS_MASK AND Value)) THEN

        IF (E_NETMEETING_INVITE_FAILURE = Value) THEN
            
            CALL SetError(L_NetMeetingInviteTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NetMeetingInviteReason_ErrorMessage)
            CALL AddFix(L_NetMeetingInviteFix1_ErrorMessage)
            CALL AddFix(L_MCUProxyInvite_ErrorMessage)
            CALL AddFix(L_ManualJoinServer_ErrorMessage & Session("MCUAddress"))
            CALL AddFix(L_ManualJoinID_ErrorMessage & Request.QueryString("ID"))
            CALL AddFix(L_ManualJoinPassword_ErrorMessage & Session(SESSION_PASSWORD))
        ELSEIF (E_NETMEETING_INVITE_TIMEOUT = Value) THEN
            CONST L_NetMeetingInviteTimeoutTitle_ErrorMessage  = "数据会议邀请超时"
            CONST L_NetMeetingInviteTimeoutReason_ErrorMessage = "数据会议服务器试图邀请会议客户端程序 (如 Microsoft NetMeeting) 加入会议时，服务器发送的邀请已过期。"
            CONST L_NetMeetingInviteTimeoutFix1_ErrorMessage   = "重新参加会议并接受服务器的邀请。这可能需要将邀请放在窗口的前端，因为它可能会被隐藏在桌面上某些活动窗口的后面。"
            
            CALL SetError(L_NetMeetingInviteTimeoutTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NetMeetingInviteTimeoutReason_ErrorMessage)
            CALL AddFix(L_NetMeetingInviteTimeoutFix1_ErrorMessage)
            CALL AddFix(L_MCUProxyInvite_ErrorMessage)
            CALL AddFix(L_ManualJoinServer_ErrorMessage & Session("MCUAddress"))
            CALL AddFix(L_ManualJoinID_ErrorMessage & Request.QueryString("ID"))
            CALL AddFix(L_ManualJoinPassword_ErrorMessage & Session(SESSION_PASSWORD))
        ELSE
            CONST L_NetMeetingMaskTitle_ErrorMessage  = "NetMeeting 冲突"
            CONST L_NetMeetingMaskReason_ErrorMessage = "NetMeeting 正在控制计算机上的资源，或者它运行不正常。"
            CONST L_NetMeetingMaskFix1_ErrorMessage   = "关闭可能与 NetMeeting 发生冲突的其它视频、音频或网络程序。"
            
            CALL SetError(L_NetMeetingMaskTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NetMeetingMaskReason_ErrorMessage)
            CALL AddFix(L_NetMeetingMaskFix1_ErrorMessage)
            CALL AddFix(L_MCUProxyInvite_ErrorMessage)
            CALL AddFix(L_ManualJoinServer_ErrorMessage & Session("MCUAddress"))
            CALL AddFix(L_ManualJoinID_ErrorMessage & Request.QueryString("ID"))
            CALL AddFix(L_ManualJoinPassword_ErrorMessage & Session(SESSION_PASSWORD))
        END IF

        EXIT FUNCTION
    END IF

    SELECT CASE Value
        CASE E_CMS_EVENTMANAGER_NOT_INITIALIZED,E_CMS_SERVER_NOT_INITIALIZED
            CONST L_EventManagerNotInitializedTitle_ErrorMessage  = "服务器未初始化"
            CONST L_EventManagerNotInitializedReason_ErrorMessage = "Exchange 会议服务正在启动并且尚未完成启动过程。"
            CONST L_EventManagerNotInitializedFix1_ErrorMessage   = "请稍候几分钟，然后重试。"
            
            CALL SetError(L_EventManagerNotInitializedTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_EventManagerNotInitializedReason_ErrorMessage)
            CALL AddFix(L_EventManagerNotInitializedFix1_ErrorMessage)
        
        CASE E_CMS_PROFILE_STORE_NOT_INITIALIZED
            CONST L_ServerOrProfileStoreNotInitializedTitle_ErrorMessage    = "服务器存储未初始化"
            CONST L_ServerOrProfileStoreNotInitializedReason_ErrorMessage   = "Exchange 会议服务器未初始化。"
            CONST L_ProfileStoreNotInitializedFix1_ErrorMessage             = "请与系统管理员联系。会议日历邮箱存储可能不可用。"
                        
            CALL SetError(L_ServerOrProfileStoreNotInitializedTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ServerOrProfileStoreNotInitializedReason_ErrorMessage)
            CALL AddFix(L_ProfileStoreNotInitializedFix1_ErrorMessage)

        CASE E_CMS_CONFERENCE_NOT_RUNNING
            CONST L_ConferenceNotRunningCMSTitle_ErrorMessage  = "会议没有运行"
            CONST L_ConferenceNotRunningCMSReason_ErrorMessage = "试图参加的会议尚未作好准备，或者会议技术提供程序不允许会议开始。"
            CONST L_ConferenceNotRunningCMSFix1_ErrorMessage   = "请稍候几分钟，然后重试。"
            
            CALL SetError(L_ConferenceNotRunningCMSTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ConferenceNotRunningCMSReason_ErrorMessage)
            CALL AddFix(L_ConferenceNotRunningCMSFix1_ErrorMessage)
            CALL AddFix(L_LinkToConferenceListsFix_ErrorMessage & "<A HREF=""list.asp"">" & L_LinkToConferenceListsFix2_ErrorMessage & "</A>")

        CASE E_CMS_CONFERENCE_NOT_SCHEDULED
            CONST L_ConferenceNotScheduledTitle_ErrorMessage  = "会议没有安排"
            CONST L_ConferenceNotScheduledReason_ErrorMessage = "这不是由 Exchange 会议服务安排的会议(根据 URL 中的会议 ID 判定)。"
            CONST L_ConferenceNotScheduledFix1_ErrorMessage   = "会议可能已被删除，或者会议 ID 可能已损坏。"
            CONST L_ConferenceNotScheduledFix2_ErrorMessage   = "请与会议组织者或者系统管理员联系。"
            
            CALL SetError(L_ConferenceNotScheduledTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ConferenceNotScheduledReason_ErrorMessage)
            CALL AddFix(L_ConferenceNotScheduledFix1_ErrorMessage)
            CALL AddFix(L_ConferenceNotScheduledFix2_ErrorMessage)
            CALL AddFix(L_LinkToConferenceListsFix_ErrorMessage & "<A HREF=""list.asp"">" & L_LinkToConferenceListsFix2_ErrorMessage & "</A>")
        
        CASE E_CMS_CONFERENCE_NOT_STARTED
            CONST L_ConferenceNotStartedTitle_ErrorMessage  = "会议尚未开始"
            CONST L_ConferenceNotStartedReason_ErrorMessage = "会议正在启动，但启动过程尚未完成。"
            CONST L_ConferenceNotStartedFix1_ErrorMessage   = "请稍候几分钟，然后重试。"
            
            CALL SetError(L_ConferenceNotStartedTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ConferenceNotStartedReason_ErrorMessage)
            CALL AddFix(L_ConferenceNotStartedFix1_ErrorMessage)
            CALL AddFix(L_LinkToConferenceListsFix_ErrorMessage & "<A HREF=""list.asp"">" & L_LinkToConferenceListsFix2_ErrorMessage & "</A>")

        CASE E_CMS_CONFERENCE_NOT_FOUND,E_CMS_RECURRING_INSTANCE_NOT_WITHIN_TIME_BOUND,E_CMS_AMBIGUOUS_RECURRING_JOIN,E_CMS_E_CONFERENCE_NOT_EXIST,1 'S_FALSE
            CONST L_ConferenceNotFoundTitle_ErrorMessage  = "无法找到会议"
            CONST L_ConferenceNotFoundReason_ErrorMessage = "会议管理服务无法找到要参加的会议。"
            CONST L_ConferenceNotFoundFix1_ErrorMessage   = "如果会议是最近安排的，请稍候几分钟重试。"
            CONST L_ConferenceNotFoundFix2_ErrorMessage   = "请与会议组织者联系；此会议可能已被取消。"
            CONST L_ConferenceNotFoundFix3_ErrorMessage   = "确认浏览器 URL 中显示的会议 ID 与您的会议 ID 相同。"
            CONST L_ConferenceNotFoundFix4_ErrorMessage   = "如果这是一个定期举行的会议，则可能在解析单个事件时发生了错误。"
            
            CALL SetError(L_ConferenceNotFoundTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ConferenceNotFoundReason_ErrorMessage)
            CALL AddFix(L_ConferenceNotFoundFix1_ErrorMessage)
            CALL AddFix(L_ConferenceNotFoundFix2_ErrorMessage)
            CALL AddFix(L_ConferenceNotFoundFix3_ErrorMessage)
            CALL AddFix(L_ConferenceNotFoundFix4_ErrorMessage)
            CALL AddFix(L_LinkToConferenceListsFix_ErrorMessage & "<A HREF=""list.asp"">" & L_LinkToConferenceListsFix2_ErrorMessage & "</A>")

        CASE E_CMS_SHUTTING_DOWN
            CONST L_ConfServerShuttingDownTitle_ErrorMessage  = "会议管理服务关闭"
            CONST L_ConfServerShuttingDownReason_ErrorMessage = "会议管理服务正在关闭。"
            CONST L_ConfServerShuttingDownFix1_ErrorMessage   = "请稍候几分钟等待服务重新启动，以便会议能够继续。"
            CONST L_ConfServerShuttingDownFix2_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_ConfServerShuttingDownTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ConfServerShuttingDownReason_ErrorMessage)
            CALL AddFix(L_ConfServerShuttingDownFix1_ErrorMessage)
            CALL AddFix(L_ConfServerShuttingDownFix2_ErrorMessage)

        CASE E_CMS_INVALID_CONFERENCE_PASSWORD
            CONST L_InvalidConferencePasswordTitle_ErrorMessage  = "无效的会议密码"
            CONST L_InvalidConferencePasswordReason_ErrorMessage = "由于密码无效，会议管理服务拒绝了参加会议的请求。"
            CONST L_InvalidConferencePasswordFix1_ErrorMessage   = "确认输入了正确的会议密码。"

            CALL SetError(L_InvalidConferencePasswordTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_InvalidConferencePasswordReason_ErrorMessage)
            CALL AddFix(L_InvalidConferencePasswordFix1_ErrorMessage)
        
        CASE E_CMS_ANONYMOUS_USER_DENIED_ACCESS
            CONST L_AnonymousUserDeniedAccessTitle_ErrorMessage  = "拒绝匿名访问"
            CONST L_AnonymousUserDeniedAccessReason_ErrorMessage = "由于无法验证身份，会议管理服务拒绝了参加会议的请求。"
            CONST L_AnonymousUserDeniedAccessFix1_ErrorMessage   = "确认没有试图参加未被邀请的非公开会议。"
            CONST L_AnonymousUserDeniedAccessFix2_ErrorMessage   = "请确认是以自己的身份登录到网络，以便能够正确地进行身份验证。"

            CALL SetError(L_AnonymousUserDeniedAccessTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_AnonymousUserDeniedAccessReason_ErrorMessage)
            CALL AddFix(L_AnonymousUserDeniedAccessFix1_ErrorMessage)
            CALL AddFix(L_AnonymousUserDeniedAccessFix2_ErrorMessage)
        
        CASE E_CMS_USER_DENIED_ACCESS
            CONST L_UserDeniedAccessTitle_ErrorMessage  = "拒绝访问"
            CONST L_UserDeniedAccessReason_ErrorMessage = "由于没有参加会议所需的权限，会议管理服务拒绝了参加会议的请求。您已验证的身份为: "
            CONST L_UserDeniedAccessFix1_ErrorMessage   = "确认没有试图参加未被邀请的非公开会议。查看原始会议邀请信并确认复选了“允许外部与会者”选项。查看原始会议邀请信并确认您的用户名位于被邀请的“收件人”或“抄送”列表中，同时以此用户身份登录到服务器。"
            CONST L_UserDeniedAccessFix2_ErrorMessage   = "请与系统管理员联系。原因可能为会议虚拟根目录权限设置不正确，或者会议管理服务对非公开会议强制进行客户身份验证(即，复选了“对非公开会议页的访问进行身份验证”选项)。"

            CALL SetError(L_UserDeniedAccessTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_UserDeniedAccessReason_ErrorMessage & Request.ServerVariables("AUTH_USER"))
            CALL AddFix(L_UserDeniedAccessFix1_ErrorMessage)
            CALL AddFix(L_UserDeniedAccessFix2_ErrorMessage)

        CASE E_CMS_CTP_JOIN_REQUEST_FAILED
            CONST L_CTPJoinRequestFailedTitle_ErrorMessage  = "CTP 参加请求失败"
            CONST L_CTPJoinRequestFailedReason_ErrorMessage = "由于会议技术提供程序不允许参加会议，会议管理服务拒绝了您的请求。"
            CONST L_CTPJoinRequestFailedFix1_ErrorMessage   = "请与系统管理员联系。"

            CALL SetError(L_CTPJoinRequestFailedTitle_ErrorMessage, Value, Replace(Request.QueryString("PNAME"), "+"," "), Description)
            CALL SetReason(L_CTPJoinRequestFailedReason_ErrorMessage)
            CALL AddFix(L_CTPJoinRequestFailedFix1_ErrorMessage)
        
        CASE E_CMS_PROVIDER_NOT_INITIALIZED
            CONST L_ProviderNotInitializedTitle_ErrorMessage  = "提供程序未初始化"
            CONST L_ProviderNotInitializedReason_ErrorMessage = "由于会议技术提供程序没有完成初始化，会议管理服务拒绝了您的请求。"
            CONST L_ProviderNotInitializedFix1_ErrorMessage   = "请与系统管理员联系。"

            CALL SetError(L_ProviderNotInitializedTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ProviderNotInitializedReason_ErrorMessage)
            CALL AddFix(L_ProviderNotInitializedFix1_ErrorMessage)
        
        CASE E_CMS_PROVIDER_NOT_FOUND
            CONST L_ProviderNotFoundTitle_ErrorMessage  = "无法找到提供程序"
            CONST L_ProviderNotFoundReason_ErrorMessage = "由于无法与会议技术提供程序联系，会议管理服务拒绝了您的请求。"
            CONST L_ProviderNotFoundFix1_ErrorMessage   = "请与系统管理员联系。"

            CALL SetError(L_ProviderNotFoundTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ProviderNotFoundReason_ErrorMessage)
            CALL AddFix(L_ProviderNotFoundFix1_ErrorMessage)
        
        CASE E_CMS_RECURRING_CONFERENCE_NOT_FOUND
            CONST L_RecurringConferenceNotFoundTitle_ErrorMessage  = "无法找到定期举行的会议"
            CONST L_RecurringConferenceNotFoundReason_ErrorMessage = "由于无法找到试图参加的定期举行的会议，会议管理服务拒绝了您的请求。"
            CONST L_RecurringConferenceNotFoundFix1_ErrorMessage   = "请与系统管理员联系。"

            CALL SetError(L_RecurringConferenceNotFoundTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_RecurringConferenceNotFoundReason_ErrorMessage)
            CALL AddFix(L_RecurringConferenceNotFoundFix1_ErrorMessage)
            CALL AddFix(L_LinkToConferenceListsFix_ErrorMessage & "<A HREF=""list.asp"">" & L_LinkToConferenceListsFix2_ErrorMessage & "</A>")
        
        CASE E_CMS_NOT_HOST_SERVER
            CONST L_NotHostServerTitle_ErrorMessage  = "无效主机 URL"
            CONST L_NotHostServerReason_ErrorMessage = "由于此服务器不是主机服务器，会议管理服务拒绝了您的请求。"
            CONST L_NotHostServerFix1_ErrorMessage   = "请与系统管理员联系。"

            CALL SetError(L_NotHostServerTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NotHostServerReason_ErrorMessage)
            CALL AddFix(L_NotHostServerFix1_ErrorMessage)

        CASE E_DCS_NO_MCUS_AVAILABLE
            CONST L_NoAvailableMCUsTitle_ErrorMessage  = "没有可用的 T.120 MCU 服务器"
            CONST L_NoAvailableMCUsReason_ErrorMessage = "数据会议服务不可用或者没有配置为允许从您的地址连接到 T.120 MCU 服务器。要参加会议，数据会议客户端 (如 NetMeeting) 必须连接到 T.120 MCU 服务器。"
            CONST L_NoAvailableMCUsFix1_ErrorMessage   = "如果此问题持续存在，请与系统管理员联系。"
            
            CALL SetError(L_NoAvailableMCUsTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NoAvailableMCUsReason_ErrorMessage)
            CALL AddFix(L_NoAvailableMCUsFix1_ErrorMessage)

        CASE E_DCS_NO_PROXY_MCUS_AVAILABLE
            CONST L_NoAvailableProxyMCUsTitle_ErrorMessage  = "没有可用的代理 T.120 MCU 服务器"
            CONST L_NoAvailableProxyMCUsReason_ErrorMessage = "数据会议服务不可用或者没有配置为允许从 Windows 2000 站点连接到代理 T.120 MCU 服务器。参加另一个站点中的会议需要连接到代理 T.120 MCU 服务器。"
            CONST L_NoAvailableProxyMCUsFix1_ErrorMessage   = "如果此问题持续存在，请与系统管理员联系。"
            
            CALL SetError(L_NoAvailableProxyMCUsTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NoAvailableProxyMCUsReason_ErrorMessage)
            CALL AddFix(L_NoAvailableProxyMCUsFix1_ErrorMessage)

        CASE E_DCS_NO_INTERNET_MCUS_AVAILABLE
            CONST L_NoAvailableInternetMCUsTitle_ErrorMessage  = "没有可用的  Internet T.120 MCU 服务器"
            CONST L_NoAvailableInternetMCUsReason_ErrorMessage = "数据会议服务不可用或者没有配置为允许从组织外连接到 Internet T.120 MCU 服务器。参加另一个组织中的会议需要连接到 Internet T.120 MCU 服务器。"
            CONST L_NoAvailableInternetMCUsFix1_ErrorMessage   = "如果此问题持续存在，请与系统管理员联系。"
            
            CALL SetError(L_NoAvailableInternetMCUsTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NoAvailableInternetMCUsReason_ErrorMessage)
            CALL AddFix(L_NoAvailableInternetMCUsFix1_ErrorMessage)

        CASE E_DCS_CONFERENCE_NOT_RUNNING
            CONST L_ConferenceNotRunningDCSTitle_ErrorMessage  = "会议没有运行"
            CONST L_ConferenceNotRunningDCSReason_ErrorMessage = "此会议当前没有运行在 T.120 MCU 服务器上。"
            CONST L_ConferenceNotRunningDCSFix1_ErrorMessage   = "如果此问题持续存在，请与系统管理员联系。"
            
            CALL SetError(L_ConferenceNotRunningDCSTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ConferenceNotRunningDCSReason_ErrorMessage)
            CALL AddFix(L_ConferenceNotRunningDCSFix1_ErrorMessage)
            CALL AddFix(L_LinkToConferenceListsFix_ErrorMessage & "<A HREF=""list.asp"">" & L_LinkToConferenceListsFix2_ErrorMessage & "</A>")
            
        CASE E_DCS_CONFERENCE_ALREADY_ENDED
            CONST L_ConferenceAlreadyEndedTitle_ErrorMessage  = "会议已结束"
            CONST L_ConferenceAlreadyEndedReason_ErrorMessage = "试图参加的数据会议已结束。"
            CONST L_ConferenceAlreadyEndedFix1_ErrorMessage   = "如果此问题持续存在，请与系统管理员联系。"
            
            CALL SetError(L_ConferenceAlreadyEndedTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ConferenceAlreadyEndedReason_ErrorMessage)
            CALL AddFix(L_ConferenceAlreadyEndedFix1_ErrorMessage)
            CALL AddFix(L_LinkToConferenceListsFix_ErrorMessage & "<A HREF=""list.asp"">" & L_LinkToConferenceListsFix2_ErrorMessage & "</A>")
            
        CASE E_DCS_ACCESS_DENIED_CAPACITY_LIMIT
            CONST L_CapacityLimitTitle_ErrorMessage  = "数据会议容量限制"
            CONST L_CapacityLimitReason_ErrorMessage = "数据会议达到了容量限制，并且当前无法接受任何新用户。"
            CONST L_CapacityLimitFix1_ErrorMessage   = "请稍候几分钟后再重试参加会议。因为自从最后一次尝试参加会议后，可能有其他用户离开了会议。"
            CONST L_CapacityLimitFix2_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_CapacityLimitTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_CapacityLimitReason_ErrorMessage)
            CALL AddFix(L_CapacityLimitFix1_ErrorMessage)
            CALL AddFix(L_CapacityLimitFix2_ErrorMessage)

        CASE E_DCS_NOT_RUNNING
            CONST L_DCSNotRunningTitle_ErrorMessage  = "数据会议服务未运行"
            CONST L_DCSNotRunningReason_ErrorMessage = "数据会议服务当前未在运行。"
            CONST L_DCSNotRunningFix1_ErrorMessage   = "请稍候几分钟后再重试参加会议。服务可能正在重新启动。"
            CONST L_DCSNotRunningFix2_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_DCSNotRunningTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_DCSNotRunningReason_ErrorMessage)
            CALL AddFix(L_DCSNotRunningFix1_ErrorMessage)
            CALL AddFix(L_DCSNotRunningFix2_ErrorMessage)

        CASE E_DCS_NOT_INIT
            CONST L_DCSNotInitTitle_ErrorMessage  = "数据会议服务未初始化"
            CONST L_DCSNotInitReason_ErrorMessage = "数据会议服务尚未完成初始化。"
            CONST L_DCSNotInitFix1_ErrorMessage   = "请稍候几分钟后再重试参加会议。"
            CONST L_DCSNotInitFix2_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_DCSNotInitTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_DCSNotInitReason_ErrorMessage)
            CALL AddFix(L_DCSNotInitFix1_ErrorMessage)
            CALL AddFix(L_DCSNotInitFix2_ErrorMessage)

        CASE E_PKCS7_NO_CERT_STORE
            CONST L_NoCertStoreTitle_ErrorMessage    = "打开证书存储时出错"
            CONST L_NoCertStoreReason_ErrorMessage   = "打开试图参加的会议管理服务器上的证书存储时出错。"
            CONST L_NoCertStoreFix1_ErrorMessage     = "请与系统管理员联系。"

            CALL SetError(L_NoCertStoreTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NoCertStoreReason_ErrorMessage)
            CALL AddFix(L_NoCertStoreFix1_ErrorMessage)
        
        CASE E_MCU_NO_SERVER_CERTIFICATE
            CONST L_NoServerCertificateTitle_ErrorMessage    = "没有数据会议服务器证书"
            CONST L_NoServerCertificateReason_ErrorMessage   = "Exchange 数据会议服务器当前不能提供非公开会议服务。"
            CONST L_NoServerCertificateFix1_ErrorMessage     = "请与系统管理员联系并确认数据会议服务服务器上安装了机器证书。"

            CALL SetError(L_NoServerCertificateTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NoServerCertificateReason_ErrorMessage)
            CALL AddFix(L_NoServerCertificateFix1_ErrorMessage)

        CASE E_MANUAL_JOIN_INSTRUCTIONS            
            CONST L_ManualJoinInstructionsTitle_ErrorMessage  = "会议参加说明"
            CALL SetError(L_ManualJoinInstructionsTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NetMeetingInviteReason_ErrorMessage)
            CALL AddFix(L_MCUProxyInvite_ErrorMessage)
            CALL AddFix(L_ManualJoinServer_ErrorMessage & Session("MCUAddress"))
            CALL AddFix(L_ManualJoinID_ErrorMessage & Request.QueryString("ID"))
            CALL AddFix(L_ManualJoinPassword_ErrorMessage & Session(SESSION_PASSWORD))


        CASE E_SESSION_UNAVAILABLE
        
            SELECT CASE Session(SESSION_RESULT)

                CASE &H8007000E
                    CONST L_SessionUnavailableResoveHostTitle_ErrorMessage    = "无法解析主机"
                    CONST L_SessionUnavailableResoveHostReason_ErrorMessage   = "Exchange 会议 Web 服务器发生了错误。服务器无法解析目录服务器的主机名。"
                    CONST L_SessionUnavailableResoveHostFix1_ErrorMessage     = "请与系统管理员联系。"

                    CALL SetError(L_SessionUnavailableResoveHostTitle_ErrorMessage, Value, Source, Description)
                    CALL SetReason(L_SessionUnavailableResoveHostReason_ErrorMessage)
                    CALL AddFix(L_SessionUnavailableResoveHostFix1_ErrorMessage)

                CASE &H8000FFFF
                    CONST L_SessionUnavailableNoRightsTitle_ErrorMessage    = "没有足够权限"
                    CONST L_SessionUnavailableNoRightsReason_ErrorMessage   = "Exchange 会议 Web 服务器发生了错误。您没有足够的权限访问目录服务器。默认 IIS 帐号设置或者目录服务器安全性设置可能不正确。"
                    CONST L_SessionUnavailableNoRightsFix1_ErrorMessage     = "请与系统管理员联系。"

                    CALL SetError(L_SessionUnavailableNoRightsTitle_ErrorMessage, Value, Source, Description)
                    CALL SetReason(L_SessionUnavailableNoRightsReason_ErrorMessage)
                    CALL AddFix(L_SessionUnavailableNoRightsFix1_ErrorMessage)

                CASE &H800704E1
                    CONST L_SessionUnavailableBadSiteTitle_ErrorMessage    = "无效站点"
                    CONST L_SessionUnavailableBadSiteReason_ErrorMessage   = "Exchange 会议 Web 服务器发生了错误。服务试图为某个无法找到的站点查找区域。"
                    CONST L_SessionUnavailableBadSiteFix1_ErrorMessage     = "请与系统管理员联系。"

                    CALL SetError(L_SessionUnavailableBadSiteTitle_ErrorMessage, Value, Source, Description)
                    CALL SetReason(L_SessionUnavailableBadSiteReason_ErrorMessage)
                    CALL AddFix(L_SessionUnavailableBadSiteFix1_ErrorMessage)
            
                CASE ELSE
                    CONST L_SessionUnavailableTitle_ErrorMessage    = "服务器不可用"
                    CONST L_SessionUnavailableReason_ErrorMessage   = "Exchange 会议 Web 服务器此时不可用。"
                    CONST L_SessionUnavailableFix1_ErrorMessage     = "关闭浏览器，然后重试此操作。"
                    CONST L_SessionUnavailableFix2_ErrorMessage     = "请与系统管理员联系。"

                    CALL SetError(L_SessionUnavailableTitle_ErrorMessage, Value, Source, Description)
                    CALL SetReason(L_SessionUnavailableReason_ErrorMessage)
                    CALL AddFix(L_SessionUnavailableFix1_ErrorMessage)
                    CALL AddFix(L_SessionUnavailableFix2_ErrorMessage)
        
            END SELECT
        
        CASE E_SERVER_CREATE_OBJECT
            CONST L_ServerCreateObjectTitle_ErrorMessage  = "Web 服务器配置错误"
            CONST L_ServerCreateObjectReason_ErrorMessage = "试图连接到的 Web 服务器没有配置为可以使用 Exchange 会议服务组件。"
            CONST L_ServerCreateObjectFix1_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_ServerCreateObjectTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_ServerCreateObjectReason_ErrorMessage)
            CALL AddFix(L_ServerCreateObjectFix1_ErrorMessage)

        CASE E_UNSUPPORTED_JAVASCRIPT_BROWSER
            CONST L_JavaScriptRequiredTitle_ErrorMessage  = "要求支持 Javascript"
            CONST L_JavaScriptRequiredReason_ErrorMessage = "要查看此页面，必须使用支持 Javascript 的浏览器，如 Internet Explorer 5.0。"
            CONST L_JavaScriptRequiredFix1_ErrorMessage   = "<A HREF=""http://www.microsoft.com/ie_intl/cn"">下载 Internet Explorer</A>."
        
            CALL SetError(L_JavaScriptRequiredTitle_ErrorMessage, 0, "Browser", "Browser doesn't support javascript")
            CALL SetReason(L_JavaScriptRequiredReason_ErrorMessage)
            CALL AddFix(L_JavaScriptRequiredFix1_ErrorMessage)

        CASE E_UNSUPPORTED_TABLES_BROWSER
            CONST L_TablesRequiredTitle_ErrorMessage  = "要求支持表格"
            CONST L_TablesRequiredReason_ErrorMessage = "要查看此页面，必须使用支持表格的浏览器，如 Internet Explorer 5.0。"
            CONST L_TablesRequiredFix1_ErrorMessage   = "<A HREF=""http://www.microsoft.com/ie_intl/cn"">下载 Internet Explorer</A>."
        
            CALL SetError(L_TablesRequiredTitle_ErrorMessage, 0, "Browser", "Browser doesn't support tables")
            CALL SetReason(L_TablesRequiredReason_ErrorMessage)
            CALL AddFix(L_TablesRequiredFix1_ErrorMessage)

        CASE E_ACCESS_DENIED
            CONST L_AccessDeniedTitle_ErrorMessage  = "拒绝访问"
            CONST L_AccessDeniedReason_ErrorMessage = "由于缺少权限，会议管理服务拒绝了您的请求。"
            CONST L_AccessDeniedFix1_ErrorMessage   = "如果会议要求密码，请确认使用的密码正确。"
            CONST L_AccessDeniedFix2_ErrorMessage   = "确认没有试图参加未被邀请的非公开会议。"
            CONST L_AccessDeniedFix3_ErrorMessage   = "请与系统管理员联系。"

            Err.Number = E_ACCESS_DENIED_HRESULT 'Set for better display
            CALL SetError(L_AccessDeniedTitle_ErrorMessage, Value, Source, Description)
            Err.Number = E_ACCESS_DENIED 'Reset for no complications
            CALL SetReason(L_AccessDeniedReason_ErrorMessage)
            CALL AddFix(L_AccessDeniedFix1_ErrorMessage)
            CALL AddFix(L_AccessDeniedFix2_ErrorMessage)
            CALL AddFix(L_AccessDeniedFix3_ErrorMessage)

        CASE E_CMS_RESTARTED
            CONST L_CMSRestartedTitle_ErrorMessage  = "与 Exchange 会议服务连接时出错"
            CONST L_CMSRestartedReason_ErrorMessage = "Exchange 会议服务当前不可用。"
            CONST L_CMSRestartedFix1_ErrorMessage   = "关闭浏览器并打开一个与 Exchange 会议服务的新连接。"
            CONST L_CMSRestartedFix2_ErrorMessage   = "如果仍然无法连接，请与管理员联系。服务可能没有运行。"
            
            CALL SetError(L_CMSRestartedTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_CMSRestartedReason_ErrorMessage)
            CALL AddFix(L_CMSRestartedFix1_ErrorMessage)
            CALL AddFix(L_CMSRestartedFix2_ErrorMessage)
        
        CASE E_MCU_HANG
            CONST L_MCUHangTitle_ErrorMessage  = "与数据会议服务器连接时出错"
            CONST L_MCUHangReason_ErrorMessage = "Exchange 会议服务在使用数据会议服务器时出错。"
            CONST L_MCUHangFix1_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_MCUHangTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_MCUHangReason_ErrorMessage)
            CALL AddFix(L_MCUHangFix1_ErrorMessage)

        CASE E_NO_GLOBAL_CONF_CALENDAR
            CONST L_NoGlobalConfCalTitle_ErrorMessage  = "Exchange 会议服务配置不正确"
            CONST L_NoGlobalConfCalReason_ErrorMessage = "没有为 Exchange 会议服务定义默认会议邮箱。"
            CONST L_NoGlobalConfCalFix1_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_NoGlobalConfCalTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_NoGlobalConfCalReason_ErrorMessage)
            CALL AddFix(L_NoGlobalConfCalFix1_ErrorMessage)

        CASE E_DSGETSITENAME_NO_SITE
            CONST L_DsGetSiteNameTitle_ErrorMessage  = "无法定位站点"
            CONST L_DsGetSiteNameReason_ErrorMessage = "Exchange 会议服务无法确定其 Active Directory 服务器。"
            CONST L_DsGetSiteNameFix1_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_DsGetSiteNameTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_DsGetSiteNameReason_ErrorMessage)
            CALL AddFix(L_DsGetSiteNameFix1_ErrorMessage)

        CASE ELSE 'OTHER ERRORS
                    
            CONST L_DefaultTitle_ErrorMessage  = "服务器错误"
            CONST L_DefaultReason_ErrorMessage = "Exchange 会议服务遇到了服务器错误。"
            CONST L_DefaultFix1_ErrorMessage   = "请与系统管理员联系。"
            
            CALL SetError(L_DefaultTitle_ErrorMessage, Value, Source, Description)
            CALL SetReason(L_DefaultReason_ErrorMessage)
            CALL AddFix(L_DefaultFix1_ErrorMessage)

    END SELECT

    CheckSetError = Value
END FUNCTION

'== SUB: Verifies ConfLocator points to the Conference Locator
SUB Verify_ConfLocator()
    ON ERROR RESUME NEXT

	DIM AuthUser
    
	AuthUser	=  Request.ServerVariables("AUTH_USER")
    IF (L_OK_Text <> GetSessionStatusStr(Session(SESSION_STATUS)) OR 0 <> Session(SESSION_ERRNUMBER) OR NOT IsObject(Session(SESSION_CONFLOCATOR)) OR NOT IsObject(Session(SESSION_CMSZONE)) OR (AuthUser <> "" AND LCase(AuthUser) <> LCase(Session(SESSION_ATTENDEE)))) THEN
        CALL SetupSessionVariables(AuthUser)
    END IF
    
    IF (L_OK_Text <> GetSessionStatusStr(Session(SESSION_STATUS)) AND 0 <> Session(SESSION_ERRNUMBER)) THEN
        Err.Number      = Session(SESSION_ERRNUMBER)
        Err.Description = Session(SESSION_ERRDESCRIPTION)
        Err.Source      = Session(SESSION_ERRSOURCE)
    ELSEIF (L_OK_Text <> GetSessionStatusStr(Session(SESSION_STATUS)) OR NOT IsObject(Session(SESSION_CONFLOCATOR)) OR NOT IsObject(Session(SESSION_CMSZONE))) THEN
        Result          = E_SESSION_UNAVAILABLE
    END IF
END SUB

'== SUB: Sets error if the Client browser lacks Tables and JavaScript support
SUB Check_Browser_Capabilities()
    DIM Browscap
    
    SET Browscap = Server.CreateObject("MSWC.BrowserType")

    ' No longer trying to detect javascript from the browser (wasn't working with Navigator)
    'IF (0 = Browscap.JavaScript) THEN
    '    displayState = DISPLAY_ERR_VALUE
    '    Err.Number   = E_UNSUPPORTED_JAVASCRIPT_BROWSER
    'ELSE
    IF (0 = Browscap.tables) THEN
        displayState = DISPLAY_ERR_VALUE
        Err.Number   = E_UNSUPPORTED_TABLES_BROWSER
    END IF
END SUB

'== SUB: Sets an error due to an invalid password
SUB Invalid_Password()
    CONST L_IncorrectPasswordTitle_ErrorMessage  = "错误密码"
    CONST L_IncorrectPasswordReason_ErrorMessage = "没有输入参加此会议所需的密码。如果上面的 URL 是手动键入的，请检查键入内容是否正确。您可能键入了错误的密码。"
    CONST L_IncorrectPasswordFix1_ErrorMessage   = "检查键入内容是否正确。"
    CONST L_IncorrectPasswordFix2_ErrorMessage   = "请与会议组织者或者系统管理员联系。"
        
    CALL SetError(L_IncorrectPasswordTitle_ErrorMessage, 0, "Security", "Invalid Password")
    CALL SetReason(L_IncorrectPasswordReason_ErrorMessage)
    CALL AddFix(L_IncorrectPasswordFix1_ErrorMessage)
    CALL AddFix(L_IncorrectPasswordFix2_ErrorMessage)
END SUB

'== SUB: Sets error if the Conference ID is not set
SUB IsConfID()
    IF ("" = inConfID OR CONF_ID_CODED_LENGTH < Len(inConfID)) THEN
        displayState = DISPLAY_ERR_CONFID
    END IF
END SUB

'== SUB: Sets error if the DCS Meeting ID is not valid
SUB ValidateMeetingID()
    IF (CONF_ID_DECODED_LENGTH <> Len(inMeetingID)) THEN
        CONST L_NoConferenceIDTitle_ErrorMessage  = "无效的会议访问 URL"
        CONST L_NoConferenceIDReason_ErrorMessage = "只能从有效的会议访问 URL 参加会议。"
        CONST L_NoConferenceIDFix1_ErrorMessage   = "如果是复制的 URL，请检查键入内容。或者参加通过电子邮件邀请您参加的会议。"

        Err.Number      = Len(inMeetingID)
        Err.Description = "Invalid conference ID"
        Err.Source      = "Exchange Conferencing Service"
        CALL SetError(L_NoConferenceIDTitle_ErrorMessage, 0, "Validate Meeting ID", "Invalid Conference ID")
        CALL SetReason(L_NoConferenceIDReason_ErrorMessage)
        CALL AddFix(L_NoConferenceIDFix1_ErrorMessage)
        CALL AddFix(L_LinkToConferenceListsFix_ErrorMessage & "<A HREF=""list.asp"">" & L_LinkToConferenceListsFix2_ErrorMessage & "</A>")
    END IF
END SUB

'== SUB: Setup the error page when we have an error
SUB DisplayErrorPage() %>
<TITLE><%=L_ErrorPage_HTMLTitle%></TITLE>
</HEAD>
<body BGCOLOR="#FFFFFF" BACKGROUND="filespw.gif" LEFTMARGIN="40" RIGHTMARGIN="40" TEXT="#000000" LINK="#000000" ALINK="#FFCC66" VLINK="#0080FF" STYLE="background-color:#FFFFFF; background-image:url(filespw.gif); background-attachment:fixed; background-repeat:no-repeat; background-position:bottom right;">

<center>
<table CELLSPACING="12">
<tr><td COLSPAN="2" ROWSPAN="1" ALIGN="LEFT"><b><font FACE="verdana" SIZE="+3"><%=ErrorMsg%></font></b></td></tr>
<tr><td COLSPAN="2" ROWSPAN="1" ALIGN="LEFT"><font FACE="verdana" SIZE="-1">
    <%=Reason%>
    <P><%=L_TryTheFollowing_Text%></P>
    <UL>
        <%
            DIM count
            FOR count = 1 TO UBound(Fixes)
                Response.write("<LI>" + Fixes(count) + "</LI>")
            NEXT
        %>
    </UL>
    <P>
    <SMALL>
        <%=HiddenError%>
        <BR>
        <%=L_Page_HTMLTitle%>
    </SMALL>
</font></td></tr>
</table>
</center>
</body>
</HTML>
<% END SUB %>
