Voicemail-to-Email: Domain Settings fix.
This commit is contained in:
parent
5f20080c66
commit
aaca2bb47c
|
|
@ -73,6 +73,9 @@
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
|
//message divider for log file
|
||||||
|
echo "\n\n======================================================================================================================================================================================\n\n";
|
||||||
|
|
||||||
//testing show the raw email
|
//testing show the raw email
|
||||||
//echo "Message: \n".$msg."\n";
|
//echo "Message: \n".$msg."\n";
|
||||||
|
|
||||||
|
|
@ -99,6 +102,7 @@
|
||||||
// 'SkipBody' => 1,
|
// 'SkipBody' => 1,
|
||||||
);
|
);
|
||||||
$success = $mime->Decode($parameters, $decoded);
|
$success = $mime->Decode($parameters, $decoded);
|
||||||
|
unset($parameters);
|
||||||
|
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
echo "MIME message decoding error: ".HtmlSpecialChars($mime->error)."\n";
|
echo "MIME message decoding error: ".HtmlSpecialChars($mime->error)."\n";
|
||||||
|
|
@ -162,12 +166,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// overwrite with domain-specific smtp server settings, if any
|
// overwrite with domain-specific smtp server settings, if any
|
||||||
if ($headers["X-FusionPBX-Domain-UUID"] != '') {
|
if (is_uuid($headers["X-FusionPBX-Domain-UUID"])) {
|
||||||
$sql = "select domain_setting_subcategory, domain_setting_value ";
|
$sql = "select domain_setting_subcategory, domain_setting_value ";
|
||||||
$sql .= "from v_domain_settings ";
|
$sql .= "from v_domain_settings ";
|
||||||
$sql .= "where domain_uuid = :domain_uuid ";
|
$sql .= "where domain_uuid = :domain_uuid ";
|
||||||
$sql .= "and (domain_setting_category = 'email' or domain_setting_category = 'voicemail') ";
|
$sql .= "and (domain_setting_category = 'email' or domain_setting_category = 'voicemail') ";
|
||||||
$sql .= "and domain_setting_name = 'text' ";
|
|
||||||
$sql .= "and domain_setting_enabled = 'true' ";
|
$sql .= "and domain_setting_enabled = 'true' ";
|
||||||
$parameters['domain_uuid'] = $headers["X-FusionPBX-Domain-UUID"];
|
$parameters['domain_uuid'] = $headers["X-FusionPBX-Domain-UUID"];
|
||||||
$database = new database;
|
$database = new database;
|
||||||
|
|
@ -273,7 +276,7 @@
|
||||||
|
|
||||||
//get the attachments and add to the email
|
//get the attachments and add to the email
|
||||||
if ($success) {
|
if ($success) {
|
||||||
foreach ($decoded[0][Parts] as &$parts_array) {
|
foreach ($decoded[0]["Parts"] as &$parts_array) {
|
||||||
$content_type = $parts_array["Parts"][0]["Headers"]["content-type:"];
|
$content_type = $parts_array["Parts"][0]["Headers"]["content-type:"];
|
||||||
//image/tiff;name="testfax.tif"
|
//image/tiff;name="testfax.tif"
|
||||||
//text/plain; charset=ISO-8859-1; format=flowed
|
//text/plain; charset=ISO-8859-1; format=flowed
|
||||||
|
|
@ -317,11 +320,12 @@
|
||||||
|
|
||||||
//add an attachment
|
//add an attachment
|
||||||
$mail->AddStringAttachment($parts_array["Body"],$file,$encoding,$mime_type);
|
$mail->AddStringAttachment($parts_array["Body"],$file,$encoding,$mime_type);
|
||||||
if (function_exists(get_transcription)) {
|
if (function_exists('get_transcription')) {
|
||||||
$attachments_array = $mail->GetAttachments();
|
$attachments_array = $mail->GetAttachments();
|
||||||
$transcription = get_transcription($attachments_array[0]);
|
$transcription = get_transcription($attachments_array[0]);
|
||||||
echo "Transcription: " . $transcription;
|
echo "Transcription: " . $transcription;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$transcription = '';
|
$transcription = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue