case VM_CHECK_PLAY_MESSAGES:
{
listen_callback_t cbt;
- char sql[256];
+ char sql[512];
int cur_message, total_messages;
message_count(profile, myid, domain_name, myfolder, &total_new_messages, &total_saved_messages,
case MSG_NEW:
{
switch_snprintf(sql, sizeof(sql),
- "select * from voicemail_msgs where username='%s' and domain='%s' and read_epoch=0"
+ "select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs where username='%s' and domain='%s' and read_epoch=0"
" order by read_flags, created_epoch", myid, domain_name);
total_messages = total_new_messages;
heard_auto_new = heard_auto_saved = 1;
default:
{
switch_snprintf(sql, sizeof(sql),
- "select * from voicemail_msgs where username='%s' and domain='%s' and read_epoch !=0"
+ "select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs where username='%s' and domain='%s' and read_epoch !=0"
" order by read_flags, created_epoch", myid, domain_name);
total_messages = total_saved_messages;
heard_auto_new = heard_auto_saved = 1;
vm_execute_sql(profile, sql, profile->mutex);
free(sql);
- sql = switch_mprintf("select * from voicemail_msgs where username='%s' and domain='%s' and file_path like '%%%s' order by created_epoch",
+ sql = switch_mprintf("select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs where username='%s' and domain='%s' and file_path like '%%%s' order by created_epoch",
user, domain, file);
memset(&holder, 0, sizeof(holder));
holder.profile = profile;
ref = switch_event_get_header(stream->param_event, "http-referer");
}
- sql = switch_mprintf("select * from voicemail_msgs where username='%s' and domain='%s' and file_path like '%%%s' order by created_epoch",
+ sql = switch_mprintf("select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs where username='%s' and domain='%s' and file_path like '%%%s' order by created_epoch",
user, domain, file);
memset(&holder, 0, sizeof(holder));
holder.profile = profile;
x_tmp = switch_xml_add_child_d(holder.x_channel, "ttl", 0);
switch_xml_set_txt_d(x_tmp, "15");
- sql = switch_mprintf("select * from voicemail_msgs where username='%s' and domain='%s' order by read_flags, created_epoch", user, domain);
+ sql = switch_mprintf("select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs where username='%s' and domain='%s' order by read_flags, created_epoch", user, domain);
vm_execute_sql_callback(profile, profile->mutex, sql, rss_callback, &holder);
xmlstr = switch_xml_toxml(holder.xml, SWITCH_TRUE);
cbt.buf = buf;
cbt.len = sizeof(buf);
- sql = switch_mprintf("select * from voicemail_msgs where username='%s' and domain='%s' order by read_flags, created_epoch", user, domain);
+ sql = switch_mprintf("select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs where username='%s' and domain='%s' order by read_flags, created_epoch", user, domain);
vm_execute_sql_callback(profile, profile->mutex, sql, web_callback, &holder);
switch_safe_free(sql);
goto done;
} else {
const char *file_path = NULL;
- sql = switch_mprintf("SELECT * FROM voicemail_msgs WHERE username = '%q' AND domain = '%q' AND uuid = '%q' ORDER BY read_flags, created_epoch", id, domain, uuid);
+ sql = switch_mprintf("select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs WHERE username = '%q' AND domain = '%q' AND uuid = '%q' ORDER BY read_flags, created_epoch", id, domain, uuid);
memset(&cbt, 0, sizeof(cbt));
switch_event_create(&cbt.my_params, SWITCH_EVENT_REQUEST_PARAMS);
vm_execute_sql_callback(profile, profile->mutex, sql, message_get_callback, &cbt);
goto done;
}
- sql = switch_mprintf("SELECT * FROM voicemail_msgs WHERE username = '%q' AND domain = '%q' AND uuid = '%q' ORDER BY read_flags, created_epoch", id, domain, uuid);
+ sql = switch_mprintf("select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs WHERE username = '%q' AND domain = '%q' AND uuid = '%q' ORDER BY read_flags, created_epoch", id, domain, uuid);
memset(&cbt, 0, sizeof(cbt));
char duration_str[80];
char *formatted_cid_num = NULL;
- sql = switch_mprintf("SELECT * FROM voicemail_msgs WHERE username = '%q' AND domain = '%q' AND uuid = '%q' ORDER BY read_flags, created_epoch", id, domain, uuid);
+ sql = switch_mprintf("select created_epoch, read_epoch, username, domain, uuid, cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags, forwarded_by from voicemail_msgs WHERE username = '%q' AND domain = '%q' AND uuid = '%q' ORDER BY read_flags, created_epoch", id, domain, uuid);
memset(&cbt, 0, sizeof(cbt));
switch_event_create(&cbt.my_params, SWITCH_EVENT_GENERAL);
vm_execute_sql_callback(profile, profile->mutex, sql, message_get_callback, &cbt);