mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-03 11:58:36 +00:00
finish up vm changes
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17047 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
25e36f8000
commit
8838c4d024
@ -4014,6 +4014,14 @@ SWITCH_STANDARD_API(voicemail_read_api_function)
|
|||||||
if (e && (p = strchr(e, ' '))) {
|
if (e && (p = strchr(e, ' '))) {
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
ru = e = p;
|
ru = e = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e && (p = strchr(e, ' '))) {
|
||||||
|
*p++ = '\0';
|
||||||
|
uuid = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ru) {
|
||||||
if (!strcasecmp(ru, "read")) {
|
if (!strcasecmp(ru, "read")) {
|
||||||
mread = 1;
|
mread = 1;
|
||||||
} else if (!strcasecmp(ru, "unread")) {
|
} else if (!strcasecmp(ru, "unread")) {
|
||||||
@ -4023,13 +4031,6 @@ SWITCH_STANDARD_API(voicemail_read_api_function)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mread > -1) {
|
|
||||||
if (e && (p = strchr(e, ' '))) {
|
|
||||||
*p++ = '\0';
|
|
||||||
uuid = p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (mread > -1 && id && domain && profile_name && (profile = get_profile(profile_name))) {
|
if (mread > -1 && id && domain && profile_name && (profile = get_profile(profile_name))) {
|
||||||
|
|
||||||
@ -4094,7 +4095,7 @@ static int api_list_callback(void *pArg, int argc, char **argv, char **columnNam
|
|||||||
SWITCH_STANDARD_API(voicemail_list_api_function)
|
SWITCH_STANDARD_API(voicemail_list_api_function)
|
||||||
{
|
{
|
||||||
char *sql;
|
char *sql;
|
||||||
char *id = NULL, *domain = NULL, *format = "text", *profile_name = "default";
|
char *id = NULL, *uuid = NULL, *domain = NULL, *format = "text", *profile_name = "default";
|
||||||
char *p, *e = NULL;
|
char *p, *e = NULL;
|
||||||
vm_profile_t *profile;
|
vm_profile_t *profile;
|
||||||
|
|
||||||
@ -4117,13 +4118,24 @@ SWITCH_STANDARD_API(voicemail_list_api_function)
|
|||||||
|
|
||||||
if (e && (p = strchr(e, ' '))) {
|
if (e && (p = strchr(e, ' '))) {
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
format = p;
|
format = e = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e && (p = strchr(e, ' '))) {
|
||||||
|
*p++ = '\0';
|
||||||
|
uuid = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id && domain && profile_name && (profile = get_profile(profile_name))) {
|
if (id && domain && profile_name && (profile = get_profile(profile_name))) {
|
||||||
sql = switch_mprintf("select created_epoch, read_epoch, username, domain, in_folder, file_path, uuid, cid_name, cid_number, "
|
if (uuid) {
|
||||||
"'%q' from voicemail_msgs where username='%q' and domain='%q'",
|
sql = switch_mprintf("select created_epoch, read_epoch, username, domain, in_folder, file_path, uuid, cid_name, cid_number, "
|
||||||
format, id, domain);
|
"'%q' from voicemail_msgs where username='%q' and domain='%q' and uuid='%q'",
|
||||||
|
format, id, domain, uuid);
|
||||||
|
} else {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
if (!strcasecmp(format, "xml")) {
|
if (!strcasecmp(format, "xml")) {
|
||||||
stream->write_function(stream, "<voicemail>\n");
|
stream->write_function(stream, "<voicemail>\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user