$valuefile) { if (strpos($valuefile, "\$secret") !== false) { $secret_init = explode("'", $valuefile); $secretfin = $secret_init[1]; } } } } else { $configfilelines = file('../roundpin-config.php'); if (count($configfilelines) != 0) { foreach ($configfilelines as $keyfile => $valuefile) { if (strpos($valuefile, "\$secret") !== false) { $secretinit = explode("'", $valuefile); $secretfin = $secretinit[1]; } } } } // Decrypt the extension used for external access to conference and the username of the user who created the link $componentuserext = explode(':', $retrievedstring); $encpwdinusext = $componentuserext[0]; $ivkey = $componentuserext[1]; $userExtDec = openssl_decrypt($encpwdinusext, 'AES-256-CBC', $secretfin, false, $ivkey); $userExtDecComp = explode("|", $userExtDec); $userName = $userExtDecComp[0]; $extForExtern = $userExtDecComp[1]; $retrievedSipUsername = $extForExtern; // Get the relevant information for the superadmin who created the external access link $query1 = $mysqli->query("SELECT id, userrole, username, wss_server, stun_server, video_conf_extension, enabled FROM app_users WHERE userrole = 'superadmin' AND BINARY username = '$userName' AND enabled = 1"); $queryres = $query1->fetch_array(); $userID = $queryres[0]; $retrievedWssServer = $queryres[3]; $retrievedStunServer = $queryres[4]; $retrievedVideoConfExt = $queryres[5]; // Get the SIP password from the 'external_users' table $query2 = $mysqli->query("SELECT id, userid, exten_for_external, exten_for_ext_pass FROM external_users WHERE userid = '$userID' AND exten_for_external = '$extForExtern'"); $extqueryres = $query2->fetch_array(); $extensionPass = $extqueryres[3]; // Decrypt the SIP password $componentpkey = explode(':', $extensionPass); $psswdaddedkey = file_get_contents('../restr/'.$userName.'/externalext/'.$extForExtern); $encpwdinsip = $componentpkey[0]; $ivkeysip = $componentpkey[1]; $retrievedSipPassword = openssl_decrypt($encpwdinsip, 'AES-256-CBC', $psswdaddedkey, false, $ivkeysip); ?> Roundpin Video Conference