#define FREE_DOMAIN_ROOT() if (x_user) switch_xml_free(x_user); x_user = NULL
-
-static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *profile, const char *domain_name, const char *id, int auth)
+static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *profile, const char *domain_name, const char *id, int auth, const char *uuid_in)
{
vm_check_state_t vm_check_state = VM_CHECK_START;
switch_channel_t *channel = switch_core_session_get_channel(session);
cbt.type = play_msg_type;
cbt.move = VM_MOVE_NEXT;
vm_execute_sql_callback(profile, profile->mutex, sql, listen_callback, &cbt);
+ if (strcmp(cbt.uuid, uuid_in)) {
+ continue;
+ }
status = listen_file(session, profile, &cbt);
if (cbt.move == VM_MOVE_PREV) {
if (cur_message <= 0) {
if (*buf != '\0') {
greet_key_press:
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, NULL);
} else if ((!zstr(profile->operator_ext) || !zstr(operator_ext)) && !zstr(profile->operator_key) && !strcasecmp(buf, profile->operator_key) ) {
int argc;
char *argv[4];
char *mycmd;
-
+
if ((!zstr(operator_ext) && (mycmd = switch_core_session_strdup(session, operator_ext))) ||
(!zstr(profile->operator_ext) && (mycmd = switch_core_session_strdup(session, profile->operator_ext)))) {
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
#define VM_DESC "voicemail"
-#define VM_USAGE "[check] [auth] <profile_name> <domain_name> [<id>]"
+#define VM_USAGE "[check] [auth] <profile_name> <domain_name> [<id>] [uuid]"
SWITCH_STANDARD_APP(voicemail_function)
{
const char *domain_name = NULL;
const char *id = NULL;
const char *auth_var = NULL;
+ const char *uuid = NULL;
int x = 0, check = 0, auth = 0;
switch_channel_t *channel = switch_core_session_get_channel(session);
}
if (check) {
- voicemail_check_main(session, profile, domain_name, id, auth);
+ if (argv[x]) {
+ uuid = argv[x++];
+ }
+ voicemail_check_main(session, profile, domain_name, id, auth, uuid);
} else {
voicemail_leave_main(session, profile, domain_name, id);
}