diff options
author | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-09 18:51:52 +0000 |
---|---|---|
committer | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-09 18:51:52 +0000 |
commit | 722eb3c4c3cfa1c0cee915c949c5f95199ee24dd (patch) | |
tree | 25683963c5e51bdedd6211cd0ea92a85639505c3 /main/ccss.c | |
parent | 815b5b09da5e555add7bba3d8fca588e7611248a (diff) |
Merged revisions 285710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r285710 | bbryant | 2010-09-09 14:50:13 -0400 (Thu, 09 Sep 2010) | 8 lines
Fixes an issue with dialplan pattern matching where the specificity for pattern ranges and pattern special characters was inconsistent.
(closes issue #16903)
Reported by: Nick_Lewis
Patches:
pbx.c-specificity.patch uploaded by Nick Lewis (license 657)
Tested by: Nick_Lewis
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@285711 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/ccss.c')
-rw-r--r-- | main/ccss.c | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/main/ccss.c b/main/ccss.c index 2cf828470..4dcacd360 100644 --- a/main/ccss.c +++ b/main/ccss.c @@ -501,38 +501,45 @@ static int count_agents_cb(void *obj, void *arg, void *data, int flags) return 0; } -static const unsigned int CC_OFFER_TIMER_DEFAULT = 20u; -static const unsigned int CCNR_AVAILABLE_TIMER_DEFAULT = 7200u; -static const unsigned int CCBS_AVAILABLE_TIMER_DEFAULT = 4800u; -static const unsigned int CC_RECALL_TIMER_DEFAULT = 20u; -static const unsigned int CC_MAX_AGENTS_DEFAULT = 5u; -static const unsigned int CC_MAX_MONITORS_DEFAULT = 5u; -static const unsigned int GLOBAL_CC_MAX_REQUESTS_DEFAULT = 20u; +#define CC_OFFER_TIMER_DEFAULT 20 /* Seconds */ +#define CCNR_AVAILABLE_TIMER_DEFAULT 7200 /* Seconds */ +#define CCBS_AVAILABLE_TIMER_DEFAULT 4800 /* Seconds */ +#define CC_RECALL_TIMER_DEFAULT 20 /* Seconds */ +#define CC_MAX_AGENTS_DEFAULT 5 +#define CC_MAX_MONITORS_DEFAULT 5 +#define GLOBAL_CC_MAX_REQUESTS_DEFAULT 20 + +static const struct ast_cc_config_params cc_default_params = { + .cc_agent_policy = AST_CC_AGENT_NEVER, + .cc_monitor_policy = AST_CC_MONITOR_NEVER, + .cc_offer_timer = CC_OFFER_TIMER_DEFAULT, + .ccnr_available_timer = CCNR_AVAILABLE_TIMER_DEFAULT, + .ccbs_available_timer = CCBS_AVAILABLE_TIMER_DEFAULT, + .cc_recall_timer = CC_RECALL_TIMER_DEFAULT, + .cc_max_agents = CC_MAX_AGENTS_DEFAULT, + .cc_max_monitors = CC_MAX_MONITORS_DEFAULT, + .cc_callback_macro = "", + .cc_agent_dialstring = "", +}; + +void ast_cc_default_config_params(struct ast_cc_config_params *params) +{ + *params = cc_default_params; +} struct ast_cc_config_params *__ast_cc_config_params_init(const char *file, int line, const char *function) { #if defined(__AST_DEBUG_MALLOC) - struct ast_cc_config_params *params = __ast_calloc(1, sizeof(*params), file, line, function); + struct ast_cc_config_params *params = __ast_malloc(sizeof(*params), file, line, function); #else - struct ast_cc_config_params *params = ast_calloc(1, sizeof(*params)); + struct ast_cc_config_params *params = ast_malloc(sizeof(*params)); #endif if (!params) { return NULL; } - /* Yeah, I could use the get/set functions, but what's the point since - * I have direct access to the structure fields in this file. - */ - params->cc_agent_policy = AST_CC_AGENT_NEVER; - params->cc_monitor_policy = AST_CC_MONITOR_NEVER; - params->cc_offer_timer = CC_OFFER_TIMER_DEFAULT; - params->ccnr_available_timer = CCNR_AVAILABLE_TIMER_DEFAULT; - params->ccbs_available_timer = CCBS_AVAILABLE_TIMER_DEFAULT; - params->cc_recall_timer = CC_RECALL_TIMER_DEFAULT; - params->cc_max_agents = CC_MAX_AGENTS_DEFAULT; - params->cc_max_monitors = CC_MAX_MONITORS_DEFAULT; - /* No need to set cc_callback_macro since calloc will 0 it out anyway */ + ast_cc_default_config_params(params); return params; } |