diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 2ec4d59e50..140f773e82 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -3986,16 +3986,18 @@ 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[5], "xml")) { + if (!strcasecmp(argv[7], "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, " \n"); } else { - stream->write_function(stream, "%s:%s:%s:%s:%s\n", argv[0], argv[1], argv[2], argv[3], argv[4]); + 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]); } return 0; @@ -4033,7 +4035,8 @@ 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, '%q' from voicemail_msgs where username='%q' and domain='%q'", + sql = switch_mprintf("select username, domain, in_folder, file_path, uuid, cid_name, cid_number, " + "'%q' from voicemail_msgs where username='%q' and domain='%q'", format, id, domain); if (!strcasecmp(format, "xml")) {