diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-06-05 19:07:27 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-06-05 19:07:27 +0000 |
commit | 9471b87d27bda1ec762c712f68489e88244b8fae (patch) | |
tree | 587127c83bf7f01e5c281920e0b216eec48c8344 /apps/app_voicemail.c | |
parent | 2347ebf43600d0fb6a0a5d5bfda326b890a8463f (diff) |
Merge the adaptive realtime branch, which will make adding new required fields
to realtime less painful in the future.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 9f0f21180..3ff833ea6 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -928,6 +928,9 @@ static int change_password_realtime(struct ast_vm_user *vmu, const char *passwor { int res; if (!ast_strlen_zero(vmu->uniqueid)) { + if (strlen(password) > 10) { + ast_realtime_require_field("voicemail", "password", RQ_CHAR, strlen(password), NULL); + } res = ast_update_realtime("voicemail", "uniqueid", vmu->uniqueid, "password", password, NULL); if (res > 0) { ast_copy_string(vmu->password, password, sizeof(vmu->password)); @@ -9367,6 +9370,9 @@ static int load_config(int reload) int tmpadsi[4]; struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 }; + ast_unload_realtime("voicemail"); + ast_unload_realtime("voicemail_data"); + if ((cfg = ast_config_load(VOICEMAIL_CONFIG, config_flags)) == CONFIG_STATUS_FILEUNCHANGED) { if ((ucfg = ast_config_load("users.conf", config_flags)) == CONFIG_STATUS_FILEUNCHANGED) return 0; @@ -10050,6 +10056,8 @@ static int unload_module(void) stop_poll_thread(); mwi_subscription_tps = ast_taskprocessor_unreference(mwi_subscription_tps); + ast_unload_realtime("voicemail"); + ast_unload_realtime("voicemail_data"); return res; } @@ -10081,6 +10089,8 @@ static int load_module(void) ast_cli_register_multiple(cli_voicemail, sizeof(cli_voicemail) / sizeof(struct ast_cli_entry)); ast_install_vm_functions(has_voicemail, inboxcount, messagecount, sayname); + ast_realtime_require_field("voicemail", "uniqueid", RQ_INTEGER, 11, "password", RQ_CHAR, 10, NULL); + ast_realtime_require_field("voicemail_data", "filename", RQ_CHAR, 30, "duration", RQ_INTEGER, 5, NULL); return res; } |