FS-3797 --resolve

I've remade the patch to use len format used in other voicemail_message_len variable/event to be consistant
This commit is contained in:
Marc Olivier Chouinard 2012-01-04 00:18:36 -05:00
parent 736c52e38b
commit 081c232eb9
1 changed files with 14 additions and 1 deletions

View File

@ -3450,7 +3450,20 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
switch_core_session_get_pool(session), caller_id_name, caller_id_number, NULL, SWITCH_FALSE,
session ? switch_core_session_get_uuid(session) : NULL, session);
switch_event_destroy(&vars);
if (status != SWITCH_STATUS_SUCCESS) {
if (status == SWITCH_STATUS_SUCCESS) {
switch_core_time_duration_t duration;
char duration_str[80];
switch_time_t l_duration = switch_time_make(message_len, 0);
switch_core_measure_time(l_duration, &duration);
duration.day += duration.yr * 365;
duration.hr += duration.day * 24;
switch_snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u", duration.hr, duration.min, duration.sec);
switch_channel_set_variable(channel, "voicemail_message_len", duration_str);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to deliver message\n");
TRY_CODE(switch_ivr_phrase_macro(session, VM_ACK_MACRO, "deleted", NULL, NULL));
}