aboutsummaryrefslogtreecommitdiffstats
path: root/main/udptl.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-16 21:09:46 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-16 21:09:46 +0000
commitdbec3d56c146801fad339a1d46a388865b18ffb4 (patch)
tree8fda811f62cb6ffb99847befb7b74b1519ea95ba /main/udptl.c
parent0fb9c73a989207650aa3ba603824e4593809611b (diff)
Don't reload a configuration file if nothing has changed.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79747 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/udptl.c')
-rw-r--r--main/udptl.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/main/udptl.c b/main/udptl.c
index 2385679a8..d3c6163e7 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -1183,10 +1183,14 @@ static struct ast_cli_entry cli_udptl[] = {
nodebug_usage },
};
-void ast_udptl_reload(void)
+static void __ast_udptl_reload(int reload)
{
struct ast_config *cfg;
const char *s;
+ struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
+
+ if ((cfg = ast_config_load("udptl.conf", config_flags)) == CONFIG_STATUS_FILEUNCHANGED)
+ return;
udptlstart = 4500;
udptlend = 4999;
@@ -1195,7 +1199,7 @@ void ast_udptl_reload(void)
udptlfecspan = 0;
udptlmaxdatagram = 0;
- if ((cfg = ast_config_load("udptl.conf"))) {
+ if (cfg) {
if ((s = ast_variable_retrieve(cfg, "general", "udptlstart"))) {
udptlstart = atoi(s);
if (udptlstart < 1024)
@@ -1258,8 +1262,13 @@ void ast_udptl_reload(void)
ast_verb(2, "UDPTL allocating from port range %d -> %d\n", udptlstart, udptlend);
}
+void ast_udptl_reload(void)
+{
+ __ast_udptl_reload(1);
+}
+
void ast_udptl_init(void)
{
ast_cli_register_multiple(cli_udptl, sizeof(cli_udptl) / sizeof(struct ast_cli_entry));
- ast_udptl_reload();
+ __ast_udptl_reload(0);
}