Пример #1
0
 public function getJoinMeetingURL_proxy($joinParams, $joinUrl = null)
 {
     /*
      NOTE: At this point, we don't use a corresponding joinMeetingWithXmlResponse here because the API
      doesn't respond on success, but you can still code that method if you need it. Or, you can take the URL
      that's returned from this method and simply send your users off to that URL in your code.
      USAGE:
      $joinParams = array(
      'meetingId' => '1234',        -- REQUIRED - A unique id for the meeting
      'username' => 'Jane Doe', -- REQUIRED - The name that will display for the user in the meeting
      'password' => 'ap',           -- REQUIRED - The attendee or moderator password, depending on what's passed here
      'createTime' => '',           -- OPTIONAL - string. Leave blank ('') unless you set this correctly.
      'userID' => '',               -- OPTIONAL - string
      'webVoiceConf' => ''      -- OPTIONAL - string
      );
     */
     global $CFG;
     $this->_meetingId = $this->_requiredParam($joinParams['meetingId'], 'meetingId');
     $this->_username = $this->_requiredParam($joinParams['username'], 'username');
     $this->_password = $this->_requiredParam($joinParams['password'], 'password');
     // Establish the basic join URL:
     if (!$joinUrl || !$this->TpeSettings->EnableProxyBalance) {
         $joinUrl = $this->_bbbServerBaseUrl . "api/join?";
     }
     // Add parameters to the URL:
     //datnv
     if ($joinParams['userdata-roomTypeOrigin'] != 'ROOM') {
         // //tao lop
         // $creationParams['meetingId']='213076';
         // $creationParams['meetingName']='213076';
         // $this->getCreateMeetingUrl($creationParams);
         $settings = get_config('local_tpebbb');
         if ($SecuritySalt === null) {
             $SecuritySalt = $settings->SecuritySalt;
         }
         if ($ServerBBBURL === null) {
             $ServerBBBURL = $settings->ServerBBBURL;
         }
         $ServerBBBURL = $CFG->NAF2;
         $this->_securitySalt = $SecuritySalt;
         $this->_bbbServerBaseUrl = $ServerBBBURL;
         $this->TpeSettings = $settings;
         $this->processConfigValue();
         parent::__construct($SecuritySalt, $ServerBBBURL);
         $joinUrl = $this->_bbbServerBaseUrl . "api/join?";
     }
     //end datnv
     $params = 'meetingID=' . urlencode($this->_meetingId) . '&fullName=' . urlencode($this->_username) . '&password='******'&userID=' . urlencode($joinParams['userId']) . '&webVoiceConf=' . urlencode($joinParams['webVoiceConf']);
     // Only use createTime if we really want to use it. If it's '', then don't pass it:
     if (isset($joinParams['createTime']) && $joinParams['createTime'] != '') {
         $params .= '&createTime=' . urlencode($joinParams['createTime']);
     }
     foreach ($joinParams as $key => $value) {
         if (strpos($key, "userdata-") !== false) {
             $params .= "&" . $key . "=" . urlencode($value);
         }
     }
     // Return the URL:
     return $joinUrl . $params . '&checksum=' . sha1("join" . $params . $this->_securitySalt);
 }