aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.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/rtp.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/rtp.c')
-rw-r--r--main/rtp.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 7f81ed7cf..2ff4440f0 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -3997,15 +3997,18 @@ static struct ast_cli_entry cli_rtp[] = {
stun_no_debug_usage },
};
-int ast_rtp_reload(void)
+static int __ast_rtp_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("rtp.conf", config_flags)) == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
rtpstart = 5000;
rtpend = 31000;
dtmftimeout = DEFAULT_DTMF_TIMEOUT;
- cfg = ast_config_load("rtp.conf");
if (cfg) {
if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
rtpstart = atoi(s);
@@ -4060,10 +4063,15 @@ int ast_rtp_reload(void)
return 0;
}
+int ast_rtp_reload(void)
+{
+ return __ast_rtp_reload(1);
+}
+
/*! \brief Initialize the RTP system in Asterisk */
void ast_rtp_init(void)
{
ast_cli_register_multiple(cli_rtp, sizeof(cli_rtp) / sizeof(struct ast_cli_entry));
- ast_rtp_reload();
+ __ast_rtp_reload(0);
}