diff options
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index a561729fb..5eb767c1c 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3263,7 +3263,8 @@ void mm_lsub(MAILSTREAM * stream, int delim, char *mailbox, long attributes) void mm_status(MAILSTREAM * stream, char *mailbox, MAILSTATUS * status) { struct ast_str *str; - if (!DEBUG_ATLEAST(5) || !(str = ast_str_create(MAX_OBJECT_FIELD))) { + + if (!DEBUG_ATLEAST(5) || !(str = ast_str_create(256))) { return; } @@ -12227,6 +12228,7 @@ static int append_mailbox(const char *context, const char *box, const char *data return 0; } +#ifdef TEST_FRAMEWORK AST_TEST_DEFINE(test_voicemail_vmuser) { int res = 0; @@ -12414,6 +12416,7 @@ AST_TEST_DEFINE(test_voicemail_vmuser) free_user(vmu); return res ? AST_TEST_FAIL : AST_TEST_PASS; } +#endif static int vm_box_exists(struct ast_channel *chan, const char *data) { @@ -13450,6 +13453,8 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con int x; unsigned int tmpadsi[4]; char secretfn[PATH_MAX] = ""; + long tps_queue_low; + long tps_queue_high; #ifdef IMAP_STORAGE ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder)); @@ -14025,6 +14030,25 @@ static int actual_load_config(int reload, struct ast_config *cfg, struct ast_con pagerbody = ast_strdup(substitute_escapes(val)); } + tps_queue_high = AST_TASKPROCESSOR_HIGH_WATER_LEVEL; + if ((val = ast_variable_retrieve(cfg, "general", "tps_queue_high"))) { + if (sscanf(val, "%30ld", &tps_queue_high) != 1 || tps_queue_high <= 0) { + ast_log(AST_LOG_WARNING, "Invalid the taskprocessor high water alert trigger level '%s'\n", val); + tps_queue_high = AST_TASKPROCESSOR_HIGH_WATER_LEVEL; + } + } + tps_queue_low = -1; + if ((val = ast_variable_retrieve(cfg, "general", "tps_queue_low"))) { + if (sscanf(val, "%30ld", &tps_queue_low) != 1 || + tps_queue_low < -1 || tps_queue_high < tps_queue_low) { + ast_log(AST_LOG_WARNING, "Invalid the taskprocessor low water clear alert level '%s'\n", val); + tps_queue_low = -1; + } + } + if (ast_taskprocessor_alert_set_levels(mwi_subscription_tps, tps_queue_low, tps_queue_high)) { + ast_log(AST_LOG_WARNING, "Failed to set alert levels for voicemail taskprocessor.\n"); + } + /* load mailboxes from users.conf */ if (ucfg) { for (cat = ast_category_browse(ucfg, NULL); cat ; cat = ast_category_browse(ucfg, cat)) { |