Update email_send.php
Email transcription has a value no need to transcribe again so run the transcription when the value is empty.
This commit is contained in:
@@ -134,6 +134,7 @@
|
|||||||
$email_to = $row["email_to"];
|
$email_to = $row["email_to"];
|
||||||
$email_subject = $row["email_subject"];
|
$email_subject = $row["email_subject"];
|
||||||
$email_body = $row["email_body"];
|
$email_body = $row["email_body"];
|
||||||
|
$email_transcription = $row["email_transcription"];
|
||||||
$email_status = $row["email_status"];
|
$email_status = $row["email_status"];
|
||||||
$email_retry_count = $row["email_retry_count"];
|
$email_retry_count = $row["email_retry_count"];
|
||||||
$email_uuid = $row["email_uuid"];
|
$email_uuid = $row["email_uuid"];
|
||||||
@@ -225,20 +226,28 @@
|
|||||||
//debug message
|
//debug message
|
||||||
echo "transcribe enabled: true\n";
|
echo "transcribe enabled: true\n";
|
||||||
|
|
||||||
//add the settings object
|
//if email transcription has a value no need to transcribe again so run the transcription when the value is empty
|
||||||
$transcribe_engine = $settings->get('transcribe', 'engine', '');
|
if (empty($email_transcription)) {
|
||||||
|
//add the settings object
|
||||||
|
$transcribe_engine = $settings->get('transcribe', 'engine', '');
|
||||||
|
|
||||||
//add the transcribe object and get the languages arrays
|
//add the transcribe object and get the languages arrays
|
||||||
if (!empty($transcribe_engine)) {
|
if (!empty($transcribe_engine)) {
|
||||||
$transcribe = new transcribe($settings);
|
$transcribe = new transcribe($settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
//transcribe the voicemail recording
|
||||||
|
$transcribe->audio_path = $email_attachment_path;
|
||||||
|
$transcribe->audio_filename = $email_attachment_name;
|
||||||
|
$transcribe_message = $transcribe->transcribe();
|
||||||
|
|
||||||
|
echo "transcribe path: ".$email_attachment_path."\n";
|
||||||
|
echo "transcribe name: ".$email_attachment_name."\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$transcribe_message = $email_transcription;
|
||||||
}
|
}
|
||||||
|
|
||||||
//transcribe the voicemail recording
|
|
||||||
$transcribe->audio_path = $email_attachment_path;
|
|
||||||
$transcribe->audio_filename = $email_attachment_name;
|
|
||||||
$transcribe_message = $transcribe->transcribe();
|
|
||||||
echo "transcribe path: ".$email_attachment_path."\n";
|
|
||||||
echo "transcribe name: ".$email_attachment_name."\n";
|
|
||||||
echo "transcribe message: ".$transcribe_message."\n";
|
echo "transcribe message: ".$transcribe_message."\n";
|
||||||
|
|
||||||
//prepare the email body
|
//prepare the email body
|
||||||
|
|||||||
Reference in New Issue
Block a user