提交 622a5d7e authored 作者: Travis Cross's avatar Travis Cross

Avoid playback on dead channels in voicemail

For years we've been generating spurious messages like:

  [WARNING] switch_ivr_play_say.c:348 Macro [voicemail_ack]: 'saved' did not match any patterns

This would happen when the caller hangs up during the playback of
certain prompts in the voicemail system where we weren't checking the
return value of vm_macro_get().  Looking closely at the log, it's
clear we were calling down into switch_ivr_phrase_macro() long after
the channel was gone.

The message above is also misleading -- switch_ivr_phrase_macro()
would have been able to find that pattern just fine, but it never
actually looked because the channel was gone.  We'll clean up that
message in a follow on commit.
上级 39bbcaff
...@@ -1278,6 +1278,7 @@ static switch_status_t create_file(switch_core_session_t *session, vm_profile_t ...@@ -1278,6 +1278,7 @@ static switch_status_t create_file(switch_core_session_t *session, vm_profile_t
goto end; goto end;
} else { } else {
(void) vm_macro_get(session, VM_RECORD_FILE_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout); (void) vm_macro_get(session, VM_RECORD_FILE_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout);
if (!switch_channel_ready(channel)) goto end;
} }
if (!strcmp(input, profile->listen_file_key)) { if (!strcmp(input, profile->listen_file_key)) {
...@@ -3671,6 +3672,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p ...@@ -3671,6 +3672,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
switch_snprintf(key_buf, sizeof(key_buf), "%s:%s", profile->urgent_key, profile->terminator_key); switch_snprintf(key_buf, sizeof(key_buf), "%s:%s", profile->urgent_key, profile->terminator_key);
if (!skip_record_urgent_check) { if (!skip_record_urgent_check) {
(void) vm_macro_get(session, VM_RECORD_URGENT_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout); (void) vm_macro_get(session, VM_RECORD_URGENT_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout);
if (!switch_channel_ready(channel)) goto deliver;
if (*profile->urgent_key == *input) { if (*profile->urgent_key == *input) {
read_flags = URGENT_FLAG_STRING; read_flags = URGENT_FLAG_STRING;
(void) switch_ivr_phrase_macro(session, VM_ACK_MACRO, "marked-urgent", NULL, NULL); (void) switch_ivr_phrase_macro(session, VM_ACK_MACRO, "marked-urgent", NULL, NULL);
...@@ -3680,6 +3682,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p ...@@ -3680,6 +3682,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
} }
} }
deliver:
if (x_user) { if (x_user) {
switch_channel_get_variables(channel, &vars); switch_channel_get_variables(channel, &vars);
status = deliver_vm(profile, x_user, domain_name, file_path, message_len, read_flags, vars, status = deliver_vm(profile, x_user, domain_name, file_path, message_len, read_flags, vars,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论