Пример #1
0
function verifyScheduleInvite($strMID, $objDataHelper)
{
    try {
        $arrURLResponse = getURLRequestByMID($strMID, $objDataHelper);
        $strParamObject = $arrURLResponse[0]['param_object'];
        $arrParamObject = json_decode($strParamObject, true);
        $strSCID = trim($arrParamObject['SCID']);
        //schedule_id
        $strEMID = trim($arrParamObject['EMID']);
        //email_address
        $strPSCD = trim($arrParamObject['PSCD']);
        //passcode
        $strPRID = trim($arrParamObject['PRID']);
        //protocol id
        if (strlen(trim($strSCID)) <= 0) {
            $STATUS = -1;
            $MESSAGE = "Missing Parameter SCID";
        } elseif (strlen(trim($strPSCD)) <= 0) {
            $STATUS = -1;
            $MESSAGE = "Missing Parameter PSCD";
        } elseif (strlen(trim($strEMID)) <= 0) {
            $STATUS = -1;
            $MESSAGE = "Missing Parameter EMID";
        } elseif (strlen(trim($strPRID)) <= 0) {
            $STATUS = -1;
            $MESSAGE = "Missing Parameter PRID";
        } elseif (!is_numeric($strPRID)) {
            $STATUS = -1;
            $MESSAGE = "Invalid characters in PRID";
        } elseif ($strPRID != PRID) {
            $STATUS = -1;
            $MESSAGE = "Invalid PRID";
        }
        $Current_GMT_Datetime = GM_DATE;
        if (trim($STATUS) == "") {
            $Joinee_IP_Address = $_SERVER['REMOTE_ADDR'];
            $arrHead = apache_request_headers();
            $arrHeaders = array_change_key_case($arrHead, CASE_LOWER);
            $clientBrowser = trim($arrHeaders['user-agent']);
            //Update the invitee IP Address and Headers
            $IPUpdate = updInviteeIPHeaders($strSCID, $strEMID, $Joinee_IP_Address, $clientBrowser, $objDataHelper);
            $SG_Interval = MEETING_START_GRACE_INTERVAL;
            $EG_Interval = MEETING_END_GRACE_INTERVAL;
            try {
                $arrSchInviteeDtls = isScheduleInviteeValid($strSCID, $strPSCD, $strEMID, $SG_Interval, $EG_Interval, $objDataHelper);
            } catch (Exception $a) {
                throw new Exception("Error in isScheduleInviteeValid." . $a->getMessage(), 311);
            }
            if (is_array($arrSchInviteeDtls) && sizeof($arrSchInviteeDtls) > 0) {
                $Schedule_Id = trim($arrSchInviteeDtls[0]['schedule_id']);
                $Schedule_Status = trim($arrSchInviteeDtls[0]['schedule_status']);
                $SG_Time = trim($arrSchInviteeDtls[0]['start_grace_time']);
                $EG_Time = trim($arrSchInviteeDtls[0]['end_grace_time']);
                $Invitee_Email = trim($arrSchInviteeDtls[0]['invitee_email_address']);
                $Invitation_Creator = trim($arrSchInviteeDtls[0]['invitation_creator']);
                $Meeting_Status = trim($arrSchInviteeDtls[0]['meeting_status']);
                $User_Id = trim($arrSchInviteeDtls[0]['user_id']);
                $Client_Id = trim($arrSchInviteeDtls[0]['client_id']);
                $User_Email = trim($arrSchInviteeDtls[0]['email_address']);
                $User_NickName = trim($arrSchInviteeDtls[0]['nick_name']);
                $Subscription_Id = trim($arrSchInviteeDtls[0]['subscription_id']);
                $Plan_Id = trim($arrSchInviteeDtls[0]['plan_id']);
                $Plan_Type = trim($arrSchInviteeDtls[0]['plan_type']);
                try {
                    $meetingInstanceDtls = getLMInstanceByClientId($Client_Id, $objDataHelper);
                } catch (Exception $e) {
                    throw new Exception("Error in getLMInstanceByClientId." . $a->getMessage(), 312);
                }
                $LMInstanceSalt = $meetingInstanceDtls[0]["rt_server_salt"];
                $LMInstanceAPIUrl = $meetingInstanceDtls[0]["rt_server_api_url"];
                $Salt = $LMInstanceSalt;
                $IS_MEETING_RUNNING_API_URL = $Meeting_Instance . $LMInstanceAPIUrl . VIDEO_SERVER_IS_MEETING_RUNNING_API;
                //Added by Mitesh Shah 29-12-2014
                $IMRAPI_OUTPUT = Call_IsMeetingRunning_API($IS_MEETING_RUNNING_API_URL, $Schedule_Id, $Salt);
                $arrIMRAPI_Result = explode(SEPARATOR, $IMRAPI_OUTPUT);
                $IMRAPI_ReturnCode = trim($arrIMRAPI_Result[0]);
                $IMRAPI_Running = trim($arrIMRAPI_Result[1]);
                if ($IMRAPI_ReturnCode == "SUCCESS" && $IMRAPI_Running == "true") {
                    $STATUS = 2;
                    $MESSAGE = "";
                } else {
                    $STATUS = 1;
                    $MESSAGE = "";
                }
            } else {
                $STATUS = -8;
                $MESSAGE = "Error, while joining meeting.";
            }
        } else {
            $STATUS = -1;
            $MESSAGE = "Error, invalid meeting information.";
        }
        $RESPONSE = $STATUS . SEPARATOR . $MESSAGE . SEPARATOR . $Schedule_Id . SEPARATOR . $Schedule_Status . SEPARATOR . $SG_Time . SEPARATOR . $EG_Time . SEPARATOR . $Invitee_Email . SEPARATOR . $Invitation_Creator . SEPARATOR . $Meeting_Status . SEPARATOR . $User_Id . SEPARATOR . $Client_Id . SEPARATOR . $User_Email . SEPARATOR . $User_NickName . SEPARATOR . $strPSCD . SEPARATOR . $Subscription_Id . SEPARATOR . $Plan_Id . SEPARATOR . $Plan_Type . SEPARATOR . $strPRID . SEPARATOR . $strMID;
        return $RESPONSE;
    } catch (Exception $e) {
        $ErrorHandler->RaiseError($_SERVER["PHP_SELF"], $e->getCode(), $e->getMessage(), true);
    }
}
Пример #2
0
 } elseif (!is_numeric($strPRID)) {
     $STATUS = -1;
     $MESSAGE = "Invalid characters in PRID";
 } elseif ($strPRID != PRID) {
     $STATUS = -1;
     $MESSAGE = "Invalid PRID";
 }
 $URL = "";
 $RETURN_URL = $SITE_ROOT . "join";
 $RETURN_URL_DATA = '?SCID=' . urlencode($strSCID) . '&EMID=' . urlencode($strEMID) . '&PSCD=' . urlencode($strPSCD) . '&PRID=' . urlencode($strPRID);
 $Current_GMT_Datetime = GM_DATE;
 if (trim($STATUS) == "") {
     $SG_Interval = MEETING_START_GRACE_INTERVAL;
     $EG_Interval = MEETING_END_GRACE_INTERVAL;
     try {
         $arrSchDtls = isScheduleInviteeValid($strSCID, $strPSCD, $strEMID, $SG_Interval, $EG_Interval, $objDataHelper);
     } catch (Exception $a) {
         throw new Exception("Error in isScheduleInviteeValid." . $a->getMessage(), 311);
     }
     if (is_array($arrSchDtls) && sizeof($arrSchDtls) > 0) {
         $Schedule_Id = trim($arrSchDtls[0]['schedule_id']);
         $Schedule_Status = trim($arrSchDtls[0]['schedule_status']);
         $Meeting_Time = dateFormat(trim($arrSchDtls[0]['meeting_timestamp_gmt']), trim($arrSchDtls[0]['meeting_timestamp_local']), trim($arrSchDtls[0]['meeting_timezone']));
         $SG_Time = trim($arrSchDtls[0]['start_grace_time']);
         $EG_Time = trim($arrSchDtls[0]['end_grace_time']);
         $Meeting_Title = trim($arrSchDtls[0]['meeting_title']);
         $Meeting_Agenda = trim($arrSchDtls[0]['meeting_agenda']);
         $Attendee_Pwd = trim($arrSchDtls[0]['attendee_password']);
         $Moderator_Pwd = trim($arrSchDtls[0]['moderator_password']);
         $Welcome_Message = trim($arrSchDtls[0]['welcome_message']);
         $Voice_Bridge = trim($arrSchDtls[0]['voice_bridge']);