tweak
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6406 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
e715379871
commit
ba448989c8
|
@ -297,8 +297,8 @@ static switch_status_t load_config(void)
|
||||||
char *storage_dir = "";
|
char *storage_dir = "";
|
||||||
char *callback_dialplan = "XML";
|
char *callback_dialplan = "XML";
|
||||||
char *callback_context = "default";
|
char *callback_context = "default";
|
||||||
char *email_body = "";
|
char *email_body = NULL;
|
||||||
char *email_headers = "";
|
char *email_headers = NULL;
|
||||||
char *email_from = "";
|
char *email_from = "";
|
||||||
char *date_fmt = "%A, %B %d %Y, %I %M %p";
|
char *date_fmt = "%A, %B %d %Y, %I %M %p";
|
||||||
uint32_t record_threshold = 200;
|
uint32_t record_threshold = 200;
|
||||||
|
@ -311,12 +311,12 @@ static switch_status_t load_config(void)
|
||||||
db = NULL;
|
db = NULL;
|
||||||
|
|
||||||
if ((x_email = switch_xml_child(x_profile, "email"))) {
|
if ((x_email = switch_xml_child(x_profile, "email"))) {
|
||||||
if ((param = switch_xml_child(x_email,"body"))) {
|
if ((param = switch_xml_child(x_email, "body"))) {
|
||||||
email_body = switch_core_strdup(globals.pool,param->txt);
|
email_body = switch_core_strdup(globals.pool, param->txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((param = switch_xml_child(x_email,"headers"))) {
|
if ((param = switch_xml_child(x_email, "headers"))) {
|
||||||
email_headers = switch_core_strdup(globals.pool,param->txt);
|
email_headers = switch_core_strdup(globals.pool, param->txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1120,11 +1120,11 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!switch_strlen_zero(profile->email_headers)) {
|
if (profile->email_body) {
|
||||||
body = switch_mprintf("Voicemail from %s %s",
|
body = switch_channel_expand_variables(channel, profile->email_body);
|
||||||
cbt->cid_name, cbt->cid_number);
|
|
||||||
} else {
|
} else {
|
||||||
body = switch_channel_expand_variables(channel,profile->email_body);
|
body = switch_mprintf("%u second Voicemail from %s %s", message_len,
|
||||||
|
cbt->cid_name, cbt->cid_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_simple_email(cbt->email, from, header_string, body, cbt->file_path);
|
switch_simple_email(cbt->email, from, header_string, body, cbt->file_path);
|
||||||
|
@ -1913,11 +1913,12 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, cons
|
||||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Message-Type", "voicemail");
|
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Message-Type", "voicemail");
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
if (!switch_strlen_zero(profile->email_headers)) {
|
|
||||||
body = switch_mprintf("Voicemail from %s %s",
|
if (profile->email_body) {
|
||||||
caller_profile->caller_id_name, caller_profile->caller_id_number);
|
body = switch_channel_expand_variables(channel, profile->email_body);
|
||||||
} else {
|
} else {
|
||||||
body = switch_channel_expand_variables(channel,profile->email_body);
|
body = switch_mprintf("%u second Voicemail from %s %s", message_len,
|
||||||
|
caller_profile->caller_id_name, caller_profile->caller_id_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (email_attach) {
|
if (email_attach) {
|
||||||
|
|
|
@ -220,7 +220,7 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *fr
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n", buf);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
//unlink(filename);
|
unlink(filename);
|
||||||
|
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
|
|
Loading…
Reference in New Issue