mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
mod_voicemail: Add ability to skip greeting and instructions when leaving voicemail (MODAPP-331)
Add 1 or 2 of these variable in your user directory : skip_greeting = Will skip the user greeting or generated greeting skip_instructions = Will skip the system standards instructions to record message git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14990 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
c8de5ee105
commit
940536c8ba
@ -2826,6 +2826,11 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||||||
switch_event_t *vars = NULL;
|
switch_event_t *vars = NULL;
|
||||||
const char *vm_cc = NULL, *vtmp, *vm_ext = NULL;
|
const char *vm_cc = NULL, *vtmp, *vm_ext = NULL;
|
||||||
int disk_quota = 0;
|
int disk_quota = 0;
|
||||||
|
switch_bool_t skip_greeting = switch_true(switch_channel_get_variable(channel, "skip_greeting"));
|
||||||
|
switch_bool_t skip_instructions = switch_true(switch_channel_get_variable(channel, "skip_instructions"));
|
||||||
|
|
||||||
|
switch_channel_set_variable(channel, "skip_greeting", NULL);
|
||||||
|
switch_channel_set_variable(channel, "skip_instructions", NULL);
|
||||||
|
|
||||||
if (!(caller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name"))) {
|
if (!(caller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name"))) {
|
||||||
caller_id_name = caller_profile->caller_id_name;
|
caller_id_name = caller_profile->caller_id_name;
|
||||||
@ -2949,7 +2954,8 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||||||
greet_path = cbt.greeting_path;
|
greet_path = cbt.greeting_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
greet:
|
greet:
|
||||||
|
if (!skip_greeting) {
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
args.input_callback = cancel_on_dtmf;
|
args.input_callback = cancel_on_dtmf;
|
||||||
args.buf = buf;
|
args.buf = buf;
|
||||||
@ -2977,7 +2983,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (*buf != '\0') {
|
if (*buf != '\0') {
|
||||||
greet_key_press:
|
greet_key_press:
|
||||||
if (switch_stristr(buf, profile->login_keys)) {
|
if (switch_stristr(buf, profile->login_keys)) {
|
||||||
voicemail_check_main(session, profile, domain_name, id, 0);
|
voicemail_check_main(session, profile, domain_name, id, 0);
|
||||||
} else if (!strcasecmp(buf, profile->operator_key) && !switch_strlen_zero(profile->operator_key)) {
|
} else if (!strcasecmp(buf, profile->operator_key) && !switch_strlen_zero(profile->operator_key)) {
|
||||||
@ -3009,11 +3015,16 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (*profile->skip_greet_key && !strcasecmp(buf, profile->skip_greet_key)) {
|
} else if (*profile->skip_greet_key && !strcasecmp(buf, profile->skip_greet_key)) {
|
||||||
record_macro = NULL;
|
skip_instructions = SWITCH_TRUE;
|
||||||
} else {
|
} else {
|
||||||
goto greet;
|
goto greet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (skip_instructions) {
|
||||||
|
record_macro = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (disk_quota) {
|
if (disk_quota) {
|
||||||
callback_t callback = { 0 };
|
callback_t callback = { 0 };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user