diff --git a/app/scripts/resources/classes/scripts.php b/app/scripts/resources/classes/scripts.php index 2e7fac461e..9b63883759 100644 --- a/app/scripts/resources/classes/scripts.php +++ b/app/scripts/resources/classes/scripts.php @@ -159,6 +159,14 @@ if (!class_exists('scripts')) { //get the recordings directory $recordings_dir = $_SESSION['switch']['recordings']['dir']; + //get the http_protocol + if (!isset($_SERVER['HTTP_PROTOCOL'])) { + $_SERVER['HTTP_PROTOCOL'] = 'http'; + if (isset($_SERVER['REQUEST_SCHEME'])) { $_SERVER['HTTP_PROTOCOL'] = $_SERVER['REQUEST_SCHEME']; } + if ($_SERVER['HTTPS'] == 'on') { $_SERVER['HTTP_PROTOCOL'] = 'https'; } + if ($_SERVER['SERVER_PORT'] == '443') { $_SERVER['HTTP_PROTOCOL'] = 'https'; } + } + //find the location to write the config.lua if (is_dir("/etc/fusionpbx")){ $config = "/etc/fusionpbx/config.lua"; @@ -205,6 +213,8 @@ if (!class_exists('scripts')) { $tmp .= " php_bin = \"php5\";\n"; } $tmp .= $this->correct_path(" document_root = [[".$_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."]];\n"); + $tmp .= $this->correct_path(" project_path = [[".PROJECT_PATH."]];\n"); + $tmp .= $this->correct_path(" http_protocol = [[".$_SERVER['HTTP_PROTOCOL'])."]];\n"); $tmp .= "\n"; $tmp .= "--store settings in memcache\n"; diff --git a/resources/install/scripts/app/conference_center/index.lua b/resources/install/scripts/app/conference_center/index.lua index 4f62a1d5e3..1e0ce98c61 100644 --- a/resources/install/scripts/app/conference_center/index.lua +++ b/resources/install/scripts/app/conference_center/index.lua @@ -87,6 +87,9 @@ moderator_pin = string.lower(row["moderator_pin"]); end); + --get the link_address + link_address = http_protocol.."://"..domain_name..project_path; + --prepare the headers headers = '{"X-FusionPBX-Domain-UUID":"'..domain_uuid..'",'; headers = headers..'"X-FusionPBX-Domain-Name":"'..domain_name..'",'; @@ -101,6 +104,7 @@ subject = subject:gsub("${conference_date_end}", conference_date_end); --subject = subject:gsub("${conference_duration}", message_length_formatted); subject = subject:gsub("${domain_name}", domain_name); + subject = subject:gsub("${link_address}", link_address); subject = trim(subject); subject = '=?utf-8?B?'..base64.enc(subject)..'?='; @@ -113,6 +117,7 @@ body = body:gsub("${conference_uuid}", conference_session_uuid); --body = body:gsub("${conference_duration}", message_length_formatted); body = body:gsub("${domain_name}", domain_name); + body = body:gsub("${link_address}", link_address); body = body:gsub(" ", " "); body = body:gsub("%s+", ""); body = body:gsub(" ", " "); diff --git a/resources/install/scripts/app/conference_center/resources/templates/en/us/email_body.tpl b/resources/install/scripts/app/conference_center/resources/templates/en/us/email_body.tpl index 7d8dc43ec8..43df21682d 100644 --- a/resources/install/scripts/app/conference_center/resources/templates/en/us/email_body.tpl +++ b/resources/install/scripts/app/conference_center/resources/templates/en/us/email_body.tpl @@ -1,6 +1,6 @@

The conference moderator pin is ${moderator_pin} and it ended on ${conference_date_end}.

-

You can download your conference recording by clicking here.

+

You can download your conference recording by clicking here.


Moderator PIN: ${moderator_pin} Ended: ${conference_date_end}
diff --git a/resources/install/scripts/app/voicemail/resources/functions/send_email.lua b/resources/install/scripts/app/voicemail/resources/functions/send_email.lua index 1534dde247..0394ba194b 100644 --- a/resources/install/scripts/app/voicemail/resources/functions/send_email.lua +++ b/resources/install/scripts/app/voicemail/resources/functions/send_email.lua @@ -105,6 +105,9 @@ file_body = scripts_dir.."/app/voicemail/resources/templates/en/us/email_body.tpl"; end + --get the link_address + link_address = http_protocol.."://"..domain_name..project_path; + --prepare the headers local headers = { ["X-FusionPBX-Domain-UUID"] = domain_uuid; @@ -141,9 +144,9 @@ if (voicemail_file == "attach") then body = body:gsub("${message}", text['label-attached']); elseif (voicemail_file == "link") then - body = body:gsub("${message}", ""..text['label-download']..""); + body = body:gsub("${message}", ""..text['label-download']..""); else - body = body:gsub("${message}", ""..text['label-listen']..""); + body = body:gsub("${message}", ""..text['label-listen']..""); end body = body:gsub(" ", " "); body = body:gsub("%s+", "");