From fa2a84c8c71dfffe218a187848bf8dda6507f892 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 16 Mar 2010 18:28:33 +0000 Subject: [PATCH] update vm_list to include timestamps git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17014 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_voicemail/mod_voicemail.c | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index a967645ef8..b7a6843deb 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -3938,7 +3938,7 @@ SWITCH_STANDARD_API(voicemail_delete_api_function) domain = e = p; } - if ((p = strchr(domain, '/'))) { + if (domain && (p = strchr(domain, '/'))) { *p++ = '\0'; profile_name = e = p; } @@ -4004,7 +4004,7 @@ SWITCH_STANDARD_API(voicemail_read_api_function) domain = e = p; } - if ((p = strchr(domain, '/'))) { + if (domain && (p = strchr(domain, '/'))) { *p++ = '\0'; profile_name = e = p; } @@ -4044,18 +4044,20 @@ static int api_list_callback(void *pArg, int argc, char **argv, char **columnNam { switch_stream_handle_t *stream = (switch_stream_handle_t *) pArg; - if (!strcasecmp(argv[7], "xml")) { + if (!strcasecmp(argv[9], "xml")) { stream->write_function(stream, " \n"); - stream->write_function(stream, " %s\n", argv[0]); - stream->write_function(stream, " %s\n", argv[1]); - stream->write_function(stream, " %s\n", argv[2]); - stream->write_function(stream, " %s\n", argv[3]); - stream->write_function(stream, " %s\n", argv[4]); - stream->write_function(stream, " %s\n", argv[5]); - stream->write_function(stream, " %s\n", argv[5]); + stream->write_function(stream, " %s\n", argv[0]); + stream->write_function(stream, " %s\n", argv[1]); + stream->write_function(stream, " %s\n", argv[2]); + stream->write_function(stream, " %s\n", argv[3]); + stream->write_function(stream, " %s\n", argv[4]); + stream->write_function(stream, " %s\n", argv[5]); + stream->write_function(stream, " %s\n", argv[6]); + stream->write_function(stream, " %s\n", argv[7]); + stream->write_function(stream, " %s\n", argv[8]); stream->write_function(stream, " \n"); } else { - stream->write_function(stream, "%s:%s:%s:%s:%s:%s:%s\n", argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]); + stream->write_function(stream, "%s:%s:%s:%s:%s:%s:%s:%s:%s\n", argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8]); } return 0; @@ -4082,7 +4084,7 @@ SWITCH_STANDARD_API(voicemail_list_api_function) domain = e = p; } - if ((p = strchr(domain, '/'))) { + if (domain && (p = strchr(domain, '/'))) { *p++ = '\0'; profile_name = e = p; } @@ -4093,7 +4095,7 @@ SWITCH_STANDARD_API(voicemail_list_api_function) } if (id && domain && profile_name && (profile = get_profile(profile_name))) { - sql = switch_mprintf("select username, domain, in_folder, file_path, uuid, cid_name, cid_number, " + sql = switch_mprintf("select created_epoch, read_epoch, username, domain, in_folder, file_path, uuid, cid_name, cid_number, " "'%q' from voicemail_msgs where username='%q' and domain='%q'", format, id, domain);